Malloy
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
malloy
core
html
multipart_parser.hpp
1
#pragma once
2
3
#include "../http/request.hpp"
4
5
#include <optional>
6
#include <string>
7
#include <vector>
8
9
namespace
malloy::html
10
{
11
17
class
multipart_parser
18
{
19
public
:
23
struct
part
24
{
25
std::string_view disposition;
26
std::string_view type;
27
std::string_view content;
28
29
part() =
default
;
30
part(
const
part&) =
default
;
31
part(part&&)
noexcept
=
default
;
32
virtual
~part() =
default
;
33
34
part& operator=(
const
part&) =
default
;
35
part& operator=(part&&)
noexcept
=
default
;
36
};
37
44
[[nodiscard]]
45
static
46
std::vector<part>
47
parse
(
const
malloy::http::request<>
& req);
48
56
[[nodiscard]]
57
static
58
std::vector<part>
59
parse
(std::string_view body,
const
std::string& boundary);
60
61
private
:
62
constexpr
static
std::string_view str_disposition = {
"Content-Disposition: "
};
63
constexpr
static
std::string_view str_type = {
"Content-Type: "
};
64
65
[[nodiscard]]
66
static
67
std::optional<part>
68
parse_part(std::string_view part_raw);
69
};
70
71
}
malloy::html::multipart_parser
Definition
multipart_parser.hpp:18
malloy::html::multipart_parser::parse
static std::vector< part > parse(const malloy::http::request<> &req)
Definition
multipart_parser.cpp:9
malloy::http::request
Definition
request.hpp:19
malloy::html
Definition
form.hpp:12
Generated by
1.18.0