LineBuffer< BUFSIZE > Class Template Reference

Class to enable buffering of a single line of text, with simple editing. More...

#include <LineBuffer.h>

Inheritance diagram for LineBuffer< BUFSIZE >:
Collaboration diagram for LineBuffer< BUFSIZE >:

Public Member Functions

 LineBuffer ()
 
- Public Member Functions inherited from LineBufferBase
 LineBufferBase (char *buffer, uint16_t size)
 
Action process (Stream &input, ReadWriteStream &output)
 Process all available data from input More...
 
Action processKey (char key, ReadWriteStream *output=nullptr)
 Process a keypress in a consistent manner for console editing. More...
 
char addChar (char c)
 Add a character to the buffer. More...
 
void clear ()
 Clear contents of buffer. More...
 
 operator bool () const
 
 operator String () const
 Copy buffer contents into a String. More...
 
char * getBuffer ()
 Get the text, nul-terminated. More...
 
unsigned getLength () const
 Get number of characters in the text line. More...
 
bool startsWith (const char *text) const
 Check for matching text at start of line, case-sensitive. More...
 
bool contains (const char *text) const
 Check for matching text anywhere in line, case-sensitive. More...
 
bool backspace ()
 Remove last character from buffer. More...
 
size_t printTo (Print &p) const
 

Additional Inherited Members

- Public Types inherited from LineBufferBase
enum class  Action {
  none , clear , echo , backspace ,
  submit
}
 Returned from processKey method directing caller. More...
 

Detailed Description

template<uint16_t BUFSIZE>
class LineBuffer< BUFSIZE >

Class to enable buffering of a single line of text, with simple editing.

Note
We define this as a template class for simplicity, no need for separate buffer memory management

Constructor & Destructor Documentation

◆ LineBuffer()

template<uint16_t BUFSIZE>
LineBuffer< BUFSIZE >::LineBuffer ( )
inline

The documentation for this class was generated from the following file: