Incremental HTTP multipart/form-data parser. More...
#include <HttpMultipartParser.h>
Public Types | |
| enum class | State { Parsing , Result , Finished } |
| State of the parser. More... | |
| enum class | Token { HeaderName , HeaderValue , PartBody , Boundary , PartHeaderEnd , Finished } |
| One possible Token reported by the parser. More... | |
Public Member Functions | |
| Result | initWithBoundary (StringSpan boundary) |
| Initializes the parser with the given boundary (that excludes the leading '–') | |
| void | reset () |
| Resets the parser state. | |
| Result | parse (Span< const char > data, size_t &readBytes, Span< const char > &parsedData) |
| Parse an incoming chunk of bytes, returning actually parsed span. | |
Public Attributes | |
| Token | token = Token::Boundary |
| Last found result. | |
| State | state = State::Parsing |
| Current state of the parser. | |
Incremental HTTP multipart/form-data parser.
|
strong |
|
strong |
One possible Token reported by the parser.
| Result SC::HttpMultipartParser::initWithBoundary | ( | StringSpan | boundary | ) |
Initializes the parser with the given boundary (that excludes the leading '–')
| Result SC::HttpMultipartParser::parse | ( | Span< const char > | data, |
| size_t & | readBytes, | ||
| Span< const char > & | parsedData ) |
Parse an incoming chunk of bytes, returning actually parsed span.
| data | Incoming chunk of bytes to be parsed |
| readBytes | Number of bytes actually read |
| parsedData | A sub-span of data pointing at the actually parsed data |
| void SC::HttpMultipartParser::reset | ( | ) |
Resets the parser state.
| State SC::HttpMultipartParser::state = State::Parsing |
Current state of the parser.
| Token SC::HttpMultipartParser::token = Token::Boundary |
Last found result.