Go to the documentation of this file.
67 bool contains(
const char* text)
const;
76 char buffer[BUFSIZE] = {
'\0'};
82 if(c ==
'\n' || c ==
'\r') {
86 if(c >= 0x20 && c < 0x7f && length < (BUFSIZE - 1)) {
88 buffer[length] =
'\0';
101 buffer[length] =
'\0';
108 auto len = strlen(text);
109 return memcmp(buffer, text, len) == 0;
114 return strstr(buffer, text) !=
nullptr;
bool startsWith(const char *text) const
Check for matching text at start of line, case-sensitive.
Definition: LineBuffer.h:106
void clear()
Clear contents of buffer.
Definition: LineBuffer.h:44
unsigned getLength() const
Get number of characters in the text line.
Definition: LineBuffer.h:60
char addChar(char c)
Add a character to the buffer.
Definition: LineBuffer.h:80
bool contains(const char *text) const
Check for matching text anywhere in line, case-sensitive.
Definition: LineBuffer.h:112
char * getBuffer()
Get the text, nul-terminated.
Definition: LineBuffer.h:52
Class to enable buffering of a single line of text, with simple editing.
Definition: LineBuffer.h:22
bool backspace()
Remove last character from buffer.
Definition: LineBuffer.h:95