Functions & utilities
FUNCTIONSNamespace: CppUtils::Terminal
Public enums
Section titled “Public enums”Direction
Section titled “Direction”enum class Direction { Row, Column};JustifyContent
Section titled “JustifyContent”enum class JustifyContent { Start, Center, End, SpaceBetween, SpaceAround, SpaceEvenly};AlignItems
Section titled “AlignItems”enum class AlignItems { Start, Center, End, Stretch};PrimitiveStyle
Section titled “PrimitiveStyle”enum class PrimitiveStyle { Outline, Filled};enum class Flag { None = 0, Raw = None, WaitForEnter = ICANON, PrintTypedKeys = ECHO, ProcessInterruptSignals = ISIG, TextEditingShortcuts = IEXTEN, MouseInput = 0, MouseTextSelection = 0, AllowMouseSelection = 0, AnsiEscapeCodes = 0, Default = static_cast<tcflag_t>(WaitForEnter) | static_cast<tcflag_t>(PrintTypedKeys) | static_cast<tcflag_t>(ProcessInterruptSignals) | static_cast<tcflag_t>(TextEditingShortcuts)};Alignment
Section titled “Alignment”enum class Alignment { Begin, Center, End};Public types
Section titled “Public types”DynamicAreaBuffer
Section titled “DynamicAreaBuffer”using CppUtils::Terminal::DynamicAreaBuffer = Thread::SharedLocker<DynamicAreaBufferStorage>;InputHandle
Section titled “InputHandle”using CppUtils::Terminal::InputHandle = int;ProgressBarStyle
Section titled “ProgressBarStyle”using CppUtils::Terminal::ProgressBarStyle = std::string;using CppUtils::Terminal::State = termios;Constants & variables
Section titled “Constants & variables”Public functions
Section titled “Public functions”template <Type::Byte ByteType = std::byte>bool readLine(std::istream& inputStream, std::vector<ByteType>& destination);Reads a line from an input stream into an existing byte vector.
Handles LF (\n), CRLF (\r\n), and standalone CR (\r) line endings. | Template parameter | Description |
| :--- | :--- |
| ByteType | Element type of the vector, must satisfy Type::Byte. |
| Parameter | Description |
|---|---|
inputStream | The input stream to read from. |
destination | The byte vector where extracted bytes are appended. |
Returns: True if any characters or line endings were extracted; false on end-of-file without data.
template <Type::Byte ByteType = std::byte>std::optional<std::vector<ByteType>> readLine(std::istream& inputStream, std::vector<ByteType>&& destination={});Reads a line from an input stream into an optional byte vector.
Accepts an optional rvalue vector destination allowing callers to reuse preallocated capacity across calls. | Template parameter | Description |
| :--- | :--- |
| ByteType | Element type of the vector, must satisfy Type::Byte. |
| Parameter | Description |
|---|---|
inputStream | The input stream to read from. |
destination | The byte vector to move and populate, defaults to an empty vector. |
Returns: An optional containing the line bytes, or std::nullopt if the stream reached end-of-file.