35 virtual void OnPartData(
const char * a_Data,
size_t a_Size) = 0;
45 void Parse(
const char * a_Data,
size_t a_Size);
virtual void OnHeaderLine(const AString &a_Key, const AString &a_Value) override
Called when a full header line is parsed.
cCallbacks & m_Callbacks
The callbacks to call for various parsing events.
bool m_IsValid
True if the data parsed so far is valid; if false, further parsing is skipped.
void ParseLine(const char *a_Data, size_t a_Size)
Parse one line of incoming data.
cMultipartParser(const AString &a_ContentType, cCallbacks &a_Callbacks)
Creates the parser, expects to find the boundary in a_ContentType.
cEnvelopeParser m_EnvelopeParser
Parser for each part's envelope.
AString m_Boundary
The boundary, excluding both the initial "--" and the terminating CRLF.
void Parse(const char *a_Data, size_t a_Size)
Parses more incoming data.
void ParseHeaderLine(const char *a_Data, size_t a_Size)
Parse one line of incoming data in the headers section of a part.
bool m_HasHadData
Set to true if some data for the current part has already been signalized to m_Callbacks.
AString m_IncomingData
Buffer for the incoming data until it is parsed.
virtual void OnPartHeader(const AString &a_Key, const AString &a_Value)=0
Called when a complete header line is received for a part.
virtual void OnPartStart(void)=0
Called when a new part starts.
virtual void OnPartEnd(void)=0
Called when the current part ends.
virtual void OnPartData(const char *a_Data, size_t a_Size)=0
Called when body for a part is received.