Cuberite
A lightweight, fast and extensible game server for Minecraft
|
Used as both the interface that all the parsers share and the (static) factory creating such parsers. More...
#include <TransferEncodingParser.h>
Classes | |
class | cCallbacks |
Public Member Functions | |
virtual void | Finish (void)=0 |
To be called when the stream is terminated from the source (connection closed). More... | |
virtual size_t | Parse (const char *a_Data, size_t a_Size)=0 |
Parses the incoming data and calls the appropriate callbacks. More... | |
virtual | ~cTransferEncodingParser () |
Static Public Member Functions | |
static cTransferEncodingParserPtr | Create (cCallbacks &a_Callbacks, const AString &a_TransferEncoding, size_t a_ContentLength) |
Creates a new parser for the specified encoding. More... | |
Protected Member Functions | |
cTransferEncodingParser (cCallbacks &a_Callbacks) | |
Protected Attributes | |
cCallbacks & | m_Callbacks |
The callbacks used to report progress. More... | |
Used as both the interface that all the parsers share and the (static) factory creating such parsers.
Definition at line 21 of file TransferEncodingParser.h.
|
inlinevirtual |
Definition at line 42 of file TransferEncodingParser.h.
|
inlineprotected |
Definition at line 68 of file TransferEncodingParser.h.
|
static |
Creates a new parser for the specified encoding.
If the encoding is not known, returns a nullptr. a_ContentLength is the length of the content, received in a Content-Length header. It is used for the Identity encoding, it is ignored for the Chunked encoding.
Definition at line 373 of file TransferEncodingParser.cpp.
|
pure virtual |
To be called when the stream is terminated from the source (connection closed).
Flushes any buffers and calls appropriate callbacks.
Implemented in cIdentityTEParser, and cChunkedTEParser.
|
pure virtual |
Parses the incoming data and calls the appropriate callbacks.
Returns the number of bytes from the end of a_Data that is already not part of this message (if the parser can detect it). Returns AString::npos on an error.
Implemented in cIdentityTEParser, and cChunkedTEParser.
|
protected |
The callbacks used to report progress.
Definition at line 65 of file TransferEncodingParser.h.