14 m_Callbacks(a_Callbacks),
32 searchStart = (searchStart > 1) ? searchStart - 1 : 0;
37 if (idxCRLF == AString::npos)
62 }
while (idxCRLF != AString::npos);
102 if (a_Data[0] <=
' ')
116 for (
size_t i = 0; i < a_Size; i++)
118 if (a_Data[i] ==
':')
123 m_LastValue.assign(a_Data + i + 2, a_Size - i - 2);
void Reset(void)
Makes the parser forget everything parsed so far, so that it can be reused for parsing another datast...
cCallbacks & m_Callbacks
Callbacks to call for the various events.
size_t Parse(const char *a_Data, size_t a_Size)
Parses the incoming data.
AString m_LastValue
Holds the last parsed value; used for line-wrapped values.
bool ParseLine(const char *a_Data, size_t a_Size)
Parses one line of header data.
AString m_LastKey
Holds the last parsed key; used for line-wrapped values.
cEnvelopeParser(cCallbacks &a_Callbacks)
bool m_IsInHeaders
Set to true while the parser is still parsing the envelope headers.
AString m_IncomingData
Buffer for the incoming data until it is parsed.
void NotifyLast(void)
Notifies the callback of the key / value stored in m_LastKey / m_LastValue, then erases them.
virtual void OnHeaderLine(const AString &a_Key, const AString &a_Value)=0
Called when a full header line is parsed.