csAnsiParser Class Reference
[Utilities]
Helper to parse a string for ANSI codes.
More...
#include <csutil/ansiparse.h>
Public Types | |
enum | Command { cmdUnknown, cmdFormatAttrReset, cmdFormatAttrEnable, cmdFormatAttrDisable, cmdFormatAttrForeground, cmdFormatAttrBackground } |
Identifier for the ANSI command. More... | |
enum | CommandClass { classNone, classUnknown, classFormat } |
Classification of the command sequence. More... | |
enum | FormatAttr { attrBold, attrItalics, attrUnderline, attrBlink, attrReverse, attrStrikethrough, attrDim, attrInvisible } |
Types of attributes in the cmdFormatAttrEnable/cmdFormatAttrBackground command. More... | |
enum | FormatColor { colNone = -1, colBlack, colRed, colGreen, colYellow, colBlue, colMagenta, colCyan, colWhite } |
Values for foreground/background color. More... | |
Static Public Member Functions | |
static bool | DecodeCommand (const char *&cmd, size_t &cmdLen, Command &command, CommandParams &commandParams) |
Decode an ANSI code sequence. | |
static bool | ParseAnsi (const char *str, size_t &ansiCommandLen, CommandClass &cmdClass, size_t &textLen) |
Parse a string for ANSI codes. | |
Classes | |
struct | CommandParams |
Parameters to ANSI command. More... |
Detailed Description
Helper to parse a string for ANSI codes.
Definition at line 31 of file ansiparse.h.
Member Enumeration Documentation
|
Identifier for the ANSI command.
Definition at line 35 of file ansiparse.h. |
|
Classification of the command sequence.
Definition at line 51 of file ansiparse.h. |
|
Types of attributes in the cmdFormatAttrEnable/cmdFormatAttrBackground command.
Definition at line 64 of file ansiparse.h. |
|
Values for foreground/background color.
Definition at line 84 of file ansiparse.h. |
Member Function Documentation
|
Decode an ANSI code sequence. Decodes a part of an ANSI code sequence, if known. Returns whether the decoding was was successful. cmd is updated to point to the start of the next sequence part.
|
|
Parse a string for ANSI codes. Looks if a string contains an ANSI code sequence at the beginning. If yes, the ansiCommandLen parameter is filled with the length of the sequence. textLen contains the number of chars up to the next ANSI sequence or the end of the string of no sequence is found. |
The documentation for this class was generated from the following file:
- csutil/ansiparse.h
Generated for Crystal Space by doxygen 1.4.6