Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <NameValueParser.h>
Public Member Functions | |
cNameValueParser (bool a_AllowsKeyOnly=true) | |
Creates an empty parser. More... | |
cNameValueParser (const char *a_Data, size_t a_Size, bool a_AllowsKeyOnly=true) | |
Creates an empty parser, then parses the data given. More... | |
bool | Finish (void) |
Notifies the parser that no more data will be coming. More... | |
bool | IsFinished (void) const |
Returns true if the parser expects no more data. More... | |
bool | IsValid (void) const |
Returns true if the data parsed so far was valid. More... | |
void | Parse (const char *a_Data, size_t a_Size) |
Parses the data given. More... | |
Protected Types | |
enum | eState { psKeySpace , psKey , psEqualSpace , psEqual , psValueInSQuotes , psValueInDQuotes , psValueRaw , psAfterValue , psInvalid , psFinished } |
Protected Attributes | |
bool | m_AllowsKeyOnly |
If true, the parser will accept keys without an equal sign and the value. More... | |
AString | m_CurrentKey |
Buffer for the current Key. More... | |
AString | m_CurrentValue |
Buffer for the current Value;. More... | |
eState | m_State |
The current state of the parser. More... | |
Definition at line 16 of file NameValueParser.h.
|
protected |
Definition at line 39 of file NameValueParser.h.
cNameValueParser::cNameValueParser | ( | bool | a_AllowsKeyOnly = true | ) |
Creates an empty parser.
Definition at line 74 of file NameValueParser.cpp.
cNameValueParser::cNameValueParser | ( | const char * | a_Data, |
size_t | a_Size, | ||
bool | a_AllowsKeyOnly = true |
||
) |
Creates an empty parser, then parses the data given.
Doesn't call Finish(), so more data can be parsed later
Definition at line 84 of file NameValueParser.cpp.
bool cNameValueParser::Finish | ( | void | ) |
Notifies the parser that no more data will be coming.
Returns true if the parser state is valid
Definition at line 361 of file NameValueParser.cpp.
|
inline |
Returns true if the parser expects no more data.
Definition at line 36 of file NameValueParser.h.
|
inline |
Returns true if the data parsed so far was valid.
Definition at line 33 of file NameValueParser.h.
void cNameValueParser::Parse | ( | const char * | a_Data, |
size_t | a_Size | ||
) |
Parses the data given.
Definition at line 95 of file NameValueParser.cpp.
|
protected |
If true, the parser will accept keys without an equal sign and the value.
Definition at line 57 of file NameValueParser.h.
|
protected |
Buffer for the current Key.
Definition at line 60 of file NameValueParser.h.
|
protected |
Buffer for the current Value;.
Definition at line 63 of file NameValueParser.h.
|
protected |
The current state of the parser.
Definition at line 54 of file NameValueParser.h.