Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cMultipartParser Class Reference

#include <MultipartParser.h>

Inheritance diagram for cMultipartParser:
Inheritance graph
[legend]
Collaboration diagram for cMultipartParser:
Collaboration graph
[legend]

Classes

class  cCallbacks
 

Public Member Functions

 cMultipartParser (const AString &a_ContentType, cCallbacks &a_Callbacks)
 Creates the parser, expects to find the boundary in a_ContentType. More...
 
void Parse (const char *a_Data, size_t a_Size)
 Parses more incoming data. More...
 

Protected Member Functions

virtual void OnHeaderLine (const AString &a_Key, const AString &a_Value) override
 Called when a full header line is parsed. More...
 
void ParseHeaderLine (const char *a_Data, size_t a_Size)
 Parse one line of incoming data in the headers section of a part. More...
 
void ParseLine (const char *a_Data, size_t a_Size)
 Parse one line of incoming data. More...
 
- Protected Member Functions inherited from cEnvelopeParser::cCallbacks
virtual ~cCallbacks ()
 

Protected Attributes

AString m_Boundary
 The boundary, excluding both the initial "--" and the terminating CRLF. More...
 
cCallbacksm_Callbacks
 The callbacks to call for various parsing events. More...
 
cEnvelopeParser m_EnvelopeParser
 Parser for each part's envelope. More...
 
bool m_HasHadData
 Set to true if some data for the current part has already been signalized to m_Callbacks. More...
 
AString m_IncomingData
 Buffer for the incoming data until it is parsed. More...
 
bool m_IsValid
 True if the data parsed so far is valid; if false, further parsing is skipped. More...
 

Detailed Description

Definition at line 18 of file MultipartParser.h.

Constructor & Destructor Documentation

◆ cMultipartParser()

cMultipartParser::cMultipartParser ( const AString a_ContentType,
cCallbacks a_Callbacks 
)

Creates the parser, expects to find the boundary in a_ContentType.

Definition at line 94 of file MultipartParser.cpp.

Member Function Documentation

◆ OnHeaderLine()

void cMultipartParser::OnHeaderLine ( const AString a_Key,
const AString a_Value 
)
overrideprotectedvirtual

Called when a full header line is parsed.

Implements cEnvelopeParser::cCallbacks.

Definition at line 247 of file MultipartParser.cpp.

◆ Parse()

void cMultipartParser::Parse ( const char *  a_Data,
size_t  a_Size 
)

Parses more incoming data.

Definition at line 147 of file MultipartParser.cpp.

◆ ParseHeaderLine()

void cMultipartParser::ParseHeaderLine ( const char *  a_Data,
size_t  a_Size 
)
protected

Parse one line of incoming data in the headers section of a part.

The CRLF has already been stripped from a_Data / a_Size

◆ ParseLine()

void cMultipartParser::ParseLine ( const char *  a_Data,
size_t  a_Size 
)
protected

Parse one line of incoming data.

The CRLF has already been stripped from a_Data / a_Size

Member Data Documentation

◆ m_Boundary

AString cMultipartParser::m_Boundary
protected

The boundary, excluding both the initial "--" and the terminating CRLF.

Definition at line 61 of file MultipartParser.h.

◆ m_Callbacks

cCallbacks& cMultipartParser::m_Callbacks
protected

The callbacks to call for various parsing events.

Definition at line 49 of file MultipartParser.h.

◆ m_EnvelopeParser

cEnvelopeParser cMultipartParser::m_EnvelopeParser
protected

Parser for each part's envelope.

Definition at line 55 of file MultipartParser.h.

◆ m_HasHadData

bool cMultipartParser::m_HasHadData
protected

Set to true if some data for the current part has already been signalized to m_Callbacks.

Used for proper CRLF inserting.

Definition at line 64 of file MultipartParser.h.

◆ m_IncomingData

AString cMultipartParser::m_IncomingData
protected

Buffer for the incoming data until it is parsed.

Definition at line 58 of file MultipartParser.h.

◆ m_IsValid

bool cMultipartParser::m_IsValid
protected

True if the data parsed so far is valid; if false, further parsing is skipped.

Definition at line 52 of file MultipartParser.h.


The documentation for this class was generated from the following files: