coan
6.0.1
A C/C++ Configuration Analyzer
|
struct parse_buffer
is a polymorphic base for classes representing possibly extensible lines of parsed text.
More...
#include <parse_buffer.h>
Public Types | |
using | value_type = char |
Value-type of parse_buffer | |
Public Member Functions | |
parse_buffer ()=default | |
Default constuctor. | |
virtual | ~parse_buffer () |
Destructor. | |
parse_buffer (std::string const &str) | |
Explicitly construct from an std::string | |
parse_buffer & | operator= (parse_buffer const &)=default |
Assign another parse_buffer | |
parse_buffer & | operator= (std::string const &str) |
Assign an std::string | |
bool | operator== (parse_buffer const &other) const |
Equality. | |
bool | operator!= (parse_buffer const &other) const |
Inequality operator. | |
size_t | size () const |
Get the length of the parse_buffer | |
operator std::string const & () const | |
Explicitly cast to std::string | |
std::string | substr (size_t start, size_t len=std::string::npos) const |
Get a substring of the parse_buffer . | |
bool | overshoot (size_t off=0) const |
Say whether an offset is out of tange. | |
char | at (size_t off) const |
Get the character indexed by an offset. Not range-checked. | |
char & | at (size_t off) |
Get a reference to the character an offset. Not range-checked. | |
char | operator[] (size_t off) const |
Get the character at an offset. Not range checked. | |
char & | operator[] (size_t offset) |
Get a reference to the character at an offset. Not range checked. | |
void | clear () |
Empty the parse_buffer . | |
unsigned | eol (size_t offset) const |
Say whether there is a newline sequence at an offset. More... | |
virtual size_t | extend () |
Extend the string, perhaps. More... | |
virtual size_t | extension_pending (size_t off) const |
Test whether an extension of the string is pending at an offset. More... | |
virtual size_t | extend (size_t skip) |
Extend the string, perhaps. More... | |
std::string & | str () |
Get a [const] reference to the underlying std::string. | |
std::string const & | str () const |
char const * | data () const |
Get a [const] pointer to the data. | |
char * | data () |
Protected Attributes | |
std::string | _text |
The data. | |
struct parse_buffer
is a polymorphic base for classes representing possibly extensible lines of parsed text.
Definition at line 51 of file parse_buffer.h.
|
inline |
Say whether there is a newline sequence at an offset.
offset | An offset into the parse_buffer |
offset
; otherwise the length of the newline sequence at offset
Definition at line 156 of file parse_buffer.h.
|
inlinevirtual |
Extend the string, perhaps.
The virtual member function may either do nothing or it may attempt to extend the string by appending characters from some opaque source.
Reimplemented in parsed_line.
Definition at line 168 of file parse_buffer.h.
|
inlinevirtual |
Extend the string, perhaps.
skip | The number of characters currently ahead of the cursor that constitute a sequence betokening an extension. This should be the value returned immediately beforehand by extension_pending() |
The virtual member function shall do nothing if skip
is 0. Otherwise it may either do nothing or it may attempt to extend the string by appending characters from some opaque source, possibly replacing up to skip
characters that are ahead of the cursor.
Reimplemented in parsed_line.
Definition at line 202 of file parse_buffer.h.
|
inlinevirtual |
Test whether an extension of the string is pending at an offset.
off | The offset at which to test. |
The virtual member function shall return a value to indicate whether a sequence of characters at offset off
betokens a logical extension of the string already in the buffer.
Reimplemented in parsed_line.
Definition at line 183 of file parse_buffer.h.