34 virtual void OnBodyData(
const void * a_Data,
size_t a_Size) = 0;
47 virtual size_t Parse(
const char * a_Data,
size_t a_Size) = 0;
59 const AString & a_TransferEncoding,
60 size_t a_ContentLength
std::shared_ptr< cTransferEncodingParser > cTransferEncodingParserPtr
Used as both the interface that all the parsers share and the (static) factory creating such parsers.
virtual size_t Parse(const char *a_Data, size_t a_Size)=0
Parses the incoming data and calls the appropriate callbacks.
cCallbacks & m_Callbacks
The callbacks used to report progress.
virtual void Finish(void)=0
To be called when the stream is terminated from the source (connection closed).
virtual ~cTransferEncodingParser()
cTransferEncodingParser(cCallbacks &a_Callbacks)
static cTransferEncodingParserPtr Create(cCallbacks &a_Callbacks, const AString &a_TransferEncoding, size_t a_ContentLength)
Creates a new parser for the specified encoding.
virtual void OnError(const AString &a_ErrorDescription)=0
Called when an error has occured while parsing.
virtual void OnBodyData(const void *a_Data, size_t a_Size)=0
Called for each chunk of the incoming body data.
virtual void OnBodyFinished(void)=0
Called when the entire body has been reported by OnBodyData().