36 #define CURSORFORWARD "\x1B[1C" 37 #define CURSORBACKWARD "\x1B[1D" 38 #define ERASEINLINE "\x1B[K" 39 #define INSERT1CHAR "\x1B[1@" 40 #define DELETE1CHAR "\x1B[1P" 41 #define DELETELINE "\x0D\x1B[K" 42 #define DELETE1CHARASC "\b \b" 67 if (
lines[i] !=
nullptr)
106 unsigned char ch = character;
115 bool processed =
false;
126 else if (ch == 155 || (
escmode && ch == 79) || (
escmode && ch == 91))
208 if (ch == 13 || ch == 10)
277 for (
int i = 0; i <
maxLines - 1; i++)
void Append(const char c)
const char * GetLine() const
void Append(const char *source)
CharBuffer()
Initialize without allocating memory.
AnsiConoleEngine(const char *prompt, CharValidator *validator)
static const int maxLines
void SetPrompt(const char *string)
CharValidator * validator
void EnsureGrowth(unsigned int size)
int StrLen(const char *string)
Get the length of a null terminated string.
const char * ProcessChar(const unsigned char character)
static const int lineSize
unsigned int AllocAndCopy(char **destination, const char *source)
Allocate memory and copy a string into the array.
Encapsulate an character array which can be used as a string.
void EnsureSize(unsigned int size)
Ensure a memory block of specified size is allocated.
virtual bool Validate(char c)=0
void ClearAndAlloc(unsigned int size)
Release memory and allocate new size.