#include <TsValue.h>
Public Types | |
enum | Result { ERROR, TAG, INDEX, EOP } |
Parsing result. More... | |
typedef Parser | self |
Self reference type. | |
Public Member Functions | |
Parser () | |
Default constructor. | |
Parser (ConstBuffer const &text) | |
Construct with input. | |
self & | setInput (ConstBuffer const &text) |
Set the input text. | |
Rv< Result > | parse (ConstBuffer *cbuff=0) |
Parse the next element in the path. | |
bool | hasInput () const |
Check if input is available. | |
Protected Attributes | |
ConstBuffer | _input |
Current input buffer. | |
char const * | _c |
Next input character. |
Parser for path text.
This is restartable so a path can be parsed in pieces.
Definition at line 115 of file TsValue.h.
typedef Parser ts::config::Path::Parser::self |
ts::config::Path::Parser::Parser | ( | ) | [inline] |
ts::config::Path::Parser::Parser | ( | ConstBuffer const & | text | ) | [inline] |
bool ts::config::Path::Parser::hasInput | ( | ) | const [inline] |
Check if input is available.
Definition at line 727 of file TsValue.h.
References _c, _input, ts::ConstBuffer::_ptr, and ts::ConstBuffer::_size.
Referenced by parse().
Rv< Path::Parser::Result > ts::config::Path::Parser::parse | ( | ConstBuffer * | cbuff = 0 |
) |
Parse the next element in the path.
cbuff may be NULL
in which case no data about elements is available. In general this should be called until EOP
or ERROR
is returned, each call returning the next element.
Result
.[out] | cbuff | Parsed path element. |
Definition at line 227 of file TsValue.cc.
References _c, _input, ts::ConstBuffer::_size, hasInput(), ts::RvBase::isOK(), ts::msg::log(), ts::msg::logf(), ts::ConstBuffer::reset(), ts::ConstBuffer::set(), start, and ts::msg::WARN.
Referenced by ts::config::Value::find().
self& ts::config::Path::Parser::setInput | ( | ConstBuffer const & | text | ) |
Set the input text.
Parsing state is reset and the next parsing call will start at the beginning of text.
text | Input buffer. |
char const* ts::config::Path::Parser::_c [protected] |
Next input character.
Definition at line 169 of file TsValue.h.
Referenced by hasInput(), and parse().
ConstBuffer ts::config::Path::Parser::_input [protected] |
Current input buffer.
Definition at line 168 of file TsValue.h.
Referenced by hasInput(), and parse().