|
Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
|
Streaming parser for multipart/form-data. More...
#include <MultipartStreamParser.hpp>
Public Types | |
| using | OnFieldCallback = std::function< void(const std::string &name, const std::string &value)> |
| using | OnFileCallback = std::function< void(const std::string &name, const std::string &filename, const std::string &content_type, const std::string &tmp_filepath)> |
Public Member Functions | |
| MultipartStreamParser (const std::string &boundary, OnFieldCallback on_field, OnFileCallback on_file) | |
| Constructs a new MultipartStreamParser. | |
| ~MultipartStreamParser () | |
| void | feed (std::string_view chunk) |
| Feeds a chunk of data into the parser. | |
| void | end () |
| Signals the end of the input stream. | |
Streaming parser for multipart/form-data.
| using http::MultipartStreamParser::OnFieldCallback = std::function<void(const std::string& name, const std::string& value)> |
| using http::MultipartStreamParser::OnFileCallback = std::function<void(const std::string& name, const std::string& filename, const std::string& content_type, const std::string& tmp_filepath)> |
| http::MultipartStreamParser::MultipartStreamParser | ( | const std::string & | boundary, |
| OnFieldCallback | on_field, | ||
| OnFileCallback | on_file | ||
| ) |
Constructs a new MultipartStreamParser.
| boundary | The boundary string from the Content-Type header. |
| on_field | Callback invoked when a standard form field is parsed. |
| on_file | Callback invoked when a file is parsed and saved to a temporary location. |
| http::MultipartStreamParser::~MultipartStreamParser | ( | ) |
| void http::MultipartStreamParser::end | ( | ) |
Signals the end of the input stream.
| void http::MultipartStreamParser::feed | ( | std::string_view | chunk | ) |
Feeds a chunk of data into the parser.
| chunk | The data chunk to parse. |