15 using OnFieldCallback = std::function<void(
const std::string& name,
const std::string& value)>;
16 using OnFileCallback = std::function<void(
const std::string& name,
const std::string& filename,
const std::string& content_type,
const std::string& tmp_filepath)>;
31 void feed(std::string_view chunk);
39 std::string boundary_;
40 std::string dash_boundary_;
50 State state_ = State::FINDING_BOUNDARY;
53 std::string current_name_;
54 std::string current_filename_;
55 std::string current_content_type_;
56 std::string current_field_value_;
57 std::ofstream current_file_;
58 std::string current_tmp_filepath_;
60 void process_buffer();
61 void parse_headers(std::string_view headers);
62 void open_temp_file();
63 void close_current_part();
Streaming parser for multipart/form-data.
Definition MultipartStreamParser.hpp:13
void feed(std::string_view chunk)
Feeds a chunk of data into the parser.
Definition MultipartStreamParser.cpp:16
std::function< void(const std::string &name, const std::string &value)> OnFieldCallback
Definition MultipartStreamParser.hpp:15
void end()
Signals the end of the input stream.
Definition MultipartStreamParser.cpp:21
std::function< void(const std::string &name, const std::string &filename, const std::string &content_type, const std::string &tmp_filepath)> OnFileCallback
Definition MultipartStreamParser.hpp:16
~MultipartStreamParser()
Definition MultipartStreamParser.cpp:12
Definition Http2Session.hpp:21