Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <EnvelopeParser.h>
Classes | |
class | cCallbacks |
Public Member Functions | |
cEnvelopeParser (cCallbacks &a_Callbacks) | |
bool | IsInHeaders (void) const |
Returns true if more input is expected for the envelope header. More... | |
void | NotifyLast (void) |
Notifies the callback of the key / value stored in m_LastKey / m_LastValue, then erases them. More... | |
size_t | Parse (const char *a_Data, size_t a_Size) |
Parses the incoming data. More... | |
bool | ParseLine (const char *a_Data, size_t a_Size) |
Parses one line of header data. More... | |
void | Reset (void) |
Makes the parser forget everything parsed so far, so that it can be reused for parsing another datastream. More... | |
void | SetIsInHeaders (bool a_IsInHeaders) |
Sets the IsInHeaders flag; used by cMultipartParser to simplify the parser initial conditions. More... | |
Public Attributes | |
cCallbacks & | m_Callbacks |
Callbacks to call for the various events. More... | |
AString | m_IncomingData |
Buffer for the incoming data until it is parsed. More... | |
bool | m_IsInHeaders |
Set to true while the parser is still parsing the envelope headers. More... | |
AString | m_LastKey |
Holds the last parsed key; used for line-wrapped values. More... | |
AString | m_LastValue |
Holds the last parsed value; used for line-wrapped values. More... | |
Definition at line 16 of file EnvelopeParser.h.
cEnvelopeParser::cEnvelopeParser | ( | cCallbacks & | a_Callbacks | ) |
Definition at line 13 of file EnvelopeParser.cpp.
|
inline |
Returns true if more input is expected for the envelope header.
Definition at line 42 of file EnvelopeParser.h.
void cEnvelopeParser::NotifyLast | ( | void | ) |
Notifies the callback of the key / value stored in m_LastKey / m_LastValue, then erases them.
Definition at line 85 of file EnvelopeParser.cpp.
size_t cEnvelopeParser::Parse | ( | const char * | a_Data, |
size_t | a_Size | ||
) |
Parses the incoming data.
Returns the number of bytes consumed from the input. The bytes not consumed are not part of the envelope header. Returns AString::npos on error
Definition at line 23 of file EnvelopeParser.cpp.
bool cEnvelopeParser::ParseLine | ( | const char * | a_Data, |
size_t | a_Size | ||
) |
Parses one line of header data.
Returns true if successful
Definition at line 99 of file EnvelopeParser.cpp.
void cEnvelopeParser::Reset | ( | void | ) |
Makes the parser forget everything parsed so far, so that it can be reused for parsing another datastream.
Definition at line 73 of file EnvelopeParser.cpp.
|
inline |
Sets the IsInHeaders flag; used by cMultipartParser to simplify the parser initial conditions.
Definition at line 45 of file EnvelopeParser.h.
cCallbacks& cEnvelopeParser::m_Callbacks |
Callbacks to call for the various events.
Definition at line 49 of file EnvelopeParser.h.
AString cEnvelopeParser::m_IncomingData |
Buffer for the incoming data until it is parsed.
Definition at line 55 of file EnvelopeParser.h.
bool cEnvelopeParser::m_IsInHeaders |
Set to true while the parser is still parsing the envelope headers.
Once set to true, the parser will not consume any more data.
Definition at line 52 of file EnvelopeParser.h.
AString cEnvelopeParser::m_LastKey |
Holds the last parsed key; used for line-wrapped values.
Definition at line 58 of file EnvelopeParser.h.
AString cEnvelopeParser::m_LastValue |
Holds the last parsed value; used for line-wrapped values.
Definition at line 61 of file EnvelopeParser.h.