2
3
6
7
8
9
10
14#include <restinio/helpers/http_field_parsers/basics.hpp>
16#include <restinio/helpers/http_field_parsers/details/pct_encoded_symbols.hpp>
35
36
37
38
39
40
41
42
43
44
54 const auto result = hfp_impl::token_producer_t::try_parse( from );
57 if(
'*' == *(result->rbegin()) )
61 consumer.started_at() + result->size() - 1,
77
78
79
80
81
82
83
84
85
86
96 const auto result = hfp_impl::token_producer_t::try_parse( from );
99 if(
'*' != *(result->rbegin()) )
103 consumer.started_at(),
119
120
121
122
123
124
125
155
156
157
158
159
160
165 return ep_impl::symbol_producer_template_t< mime_charsetc_predicate_t >{};
172
173
174
175
176
177
178
179
180
181
182
183
201
202
203
204
209 return ep_impl::symbol_producer_template_t< language_predicate_t >{};
216
217
218
219
220
221
222
251
252
253
254
255
256
261 return ep_impl::symbol_producer_template_t< attr_char_predicate_t >{};
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
301 return produce< std::string >(
302 repeat( 1, N, mime_charsetc_symbol_p() >> to_container() ),
303 symbol_p(
'\'' ) >> to_container(),
304 repeat( 0, N, language_symbol_p() >> to_container() ),
305 symbol_p(
'\'' ) >> to_container(),
308 attr_char_symbol_p() >> to_container(),
309 hfp_details::pct_encoded_symbols_p() >>
310 hfp_details::pct_encoded_symbols_consumer_t{} )
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
346
347
348
349
356 return produce< content_disposition_value_t >(
357 token_p() >> to_lower()
358 >> &content_disposition_value_t::value,
359 produce< parameter_container_t >(
361 produce< parameter_t >(
367 regular_token_producer_t{}
368 >> to_lower() >> ¶meter_t::first,
371 token_p() >> ¶meter_t::second,
372 quoted_string_p() >> ¶meter_t::second
376 ext_token_producer_t{}
377 >> to_lower() >> ¶meter_t::first,
379 ext_parameter_value_p() >> ¶meter_t::second
384 ) >> &content_disposition_value_t::parameters
389
390
391
392
A helper class to automatically return acquired content back to the input stream.
void commit() noexcept
Consume all acquired content.
content_consumer_t(source_t &from) noexcept
The class that implements "input stream".
Information about parsing error.
A producer for token that is an "extended parameter name" in sense of RCF6266 and RCF5987.
expected_t< result_type, parse_error_t > try_parse(ep_impl::source_t &from) const
A producer for token that is a "regular parameter name" in sense of RCF6266 and RCF5987.
expected_t< result_type, parse_error_t > try_parse(ep_impl::source_t &from) const
constexpr bool is_digit(const char ch) noexcept
Is a character a decimal digit?
error_reason_t
Reason of parsing error.
@ unexpected_character
Unexpected character is found in the input.
@ pattern_not_found
Required pattern is not found in the input.
auto ext_parameter_value_p()
A producer for an "extended parameter value" in sense of RCF6266 and RCF5987.
auto language_symbol_p()
A factory for producer that extracts language symbols.
auto mime_charsetc_symbol_p()
A factory for producer that extracts mime-charsetc symbols.
auto attr_char_symbol_p()
A factory for producer that extracts attr-char symbols.
constexpr bool is_alpha(const char ch) noexcept
Is a character an ALPHA?
std::pair< std::string, std::string > parameter_with_mandatory_value_t
A type that describes a parameter with mandatory value.
A preducate for symbol_producer_template that checks that a symbol is attr-char symbol from RCF5987.
bool operator()(const char actual) const noexcept
A preducate for symbol_producer_template that checks that a symbol is language symbol from RCF5646.
bool operator()(const char actual) const noexcept
A preducate for symbol_producer_template that checks that a symbol is mime-charsetc symbol from RCF59...
bool operator()(const char actual) const noexcept
Tools for working with the value of Content-Disposition HTTP-field.
static auto make_parser()
A factory function for a parser of Content-Disposition value.
static expected_t< content_disposition_value_t, restinio::easy_parser::parse_error_t > try_parse(string_view_t what)
An attempt to parse Content-Disposition HTTP-field.
parameter_container_t parameters
parameter_with_mandatory_value_t parameter_t