basics.hpp
Go to the documentation of this file.
/*
* RESTinio
*/
#pragma once
#include <restinio/impl/string_caseless_compare.hpp>
#include <restinio/helpers/easy_parser.hpp>
#include <restinio/expected.hpp>
#include <algorithm>
namespace restinio
{
namespace http_field_parsers
{
using namespace restinio::easy_parser;
namespace meta = restinio::utils::metaprogramming;
namespace qvalue_details
{
using underlying_uint_t = std::uint_least16_t;
constexpr underlying_uint_t maximum = 1000u;
constexpr underlying_uint_t zero = 0u;
// A part of workaround for problem with static constexpr members
// detected after release of v.0.6.1.
enum class extremum_min_t { v };
enum class extremum_max_t { v };
class trusted
{
const underlying_uint_t m_value;
public :
explicit constexpr
trusted( underlying_uint_t value ) noexcept : m_value{ value } {}
constexpr auto get() const noexcept { return m_value; }
};
class untrusted
{
underlying_uint_t m_value;
public :
explicit
untrusted( underlying_uint_t value ) : m_value{ value }
{
if( m_value > maximum )
throw exception_t( "invalid value for "
"http_field_parser::rfc::qvalue_t" );
}
auto get() const noexcept { return m_value; }
};
} /* namespace qvalue_details */
//
// qvalue_t
//
class qvalue_t
{
public :
using underlying_uint_t = qvalue_details::underlying_uint_t;
using trusted = qvalue_details::trusted;
using untrusted = qvalue_details::untrusted;
static constexpr qvalue_details::extremum_max_t maximum =
qvalue_details::extremum_max_t::v;
static constexpr qvalue_details::extremum_min_t zero =
qvalue_details::extremum_min_t::v;
private :
// Note: with the terminal 0-symbol.
using underlying_char_array_t = std::array<char, 6>;
underlying_uint_t m_value{};
underlying_char_array_t
make_char_array() const noexcept
{
underlying_char_array_t result;
if( qvalue_details::maximum == m_value )
{
std::strcpy( &result[0], "1.000" );
}
else
{
result[0] = '0';
result[1] = '.';
result[2] = '0' + static_cast<char>(m_value / 100u);
const auto d2 = m_value % 100u;
result[3] = '0' + static_cast<char>(d2 / 10u);
const auto d3 = d2 % 10u;
result[4] = '0' + static_cast<char>(d3);
result[5] = 0;
}
return result;
}
public :
constexpr qvalue_t() = default;
qvalue_t( untrusted val ) noexcept
: m_value{ val.get() }
{}
constexpr qvalue_t( trusted val ) noexcept
: m_value{ val.get() }
{}
constexpr qvalue_t( qvalue_details::extremum_min_t ) noexcept
: m_value{ qvalue_details::zero }
{}
constexpr qvalue_t( qvalue_details::extremum_max_t ) noexcept
: m_value{ qvalue_details::maximum }
{}
constexpr auto as_uint() const noexcept { return m_value; }
auto as_string() const
{
return std::string{ &make_char_array().front() };
}
friend std::ostream &
operator<<( std::ostream & to, const qvalue_t & what )
{
return (to << &what.make_char_array().front());
}
};
RESTINIO_NODISCARD
inline bool
operator==( const qvalue_t & a, const qvalue_t & b ) noexcept
{
return a.as_uint() == b.as_uint();
}
RESTINIO_NODISCARD
inline bool
operator!=( const qvalue_t & a, const qvalue_t & b ) noexcept
{
return a.as_uint() != b.as_uint();
}
RESTINIO_NODISCARD
inline bool
operator<( const qvalue_t & a, const qvalue_t & b ) noexcept
{
return a.as_uint() < b.as_uint();
}
RESTINIO_NODISCARD
inline bool
operator<=( const qvalue_t & a, const qvalue_t & b ) noexcept
{
return a.as_uint() <= b.as_uint();
}
namespace impl
{
using namespace restinio::easy_parser::impl;
//
// is_alpha
//
RESTINIO_NODISCARD
inline constexpr bool
is_alpha( const char ch ) noexcept
{
return (ch >= '\x41' && ch <= '\x5A') ||
(ch >= '\x61' && ch <= '\x7A');
}
//
// is_alpha_predicate_t
//
struct is_alpha_predicate_t
{
RESTINIO_NODISCARD
bool
operator()( const char actual ) const noexcept
{
return is_alpha(actual);
}
};
//
// is_alphanum_predicate_t
//
struct is_alphanum_predicate_t
{
RESTINIO_NODISCARD
bool
operator()( const char actual ) const noexcept
{
return is_alpha(actual) || is_digit(actual);
}
};
//
// is_vchar
//
RESTINIO_NODISCARD
inline constexpr bool
is_vchar( const char ch ) noexcept
{
return (ch >= '\x21' && ch <= '\x7E');
}
//
// is_vchar_predicate_t
//
struct is_vchar_predicate_t
{
RESTINIO_NODISCARD
bool
operator()( const char actual ) const noexcept
{
return is_vchar(actual);
}
};
//
// is_obs_text
//
RESTINIO_NODISCARD
inline constexpr bool
is_obs_text( const char ch ) noexcept
{
constexpr unsigned short left = 0x80u;
constexpr unsigned short right = 0xFFu;
const unsigned short t = static_cast<unsigned short>(
static_cast<unsigned char>(ch));
return (t >= left && t <= right);
}
//
// is_qdtext
//
RESTINIO_NODISCARD
inline constexpr bool
is_qdtext( const char ch ) noexcept
{
return ch == SP ||
ch == HTAB ||
ch == '!' ||
(ch >= '\x23' && ch <= '\x5B') ||
(ch >= '\x5D' && ch <= '\x7E') ||
is_obs_text( ch );
}
//
// is_ctext
//
RESTINIO_NODISCARD
inline constexpr bool
is_ctext( const char ch ) noexcept
{
return ch == SP ||
ch == HTAB ||
(ch >= '\x21' && ch <= '\x27') ||
(ch >= '\x2A' && ch <= '\x5B') ||
(ch >= '\x5D' && ch <= '\x7E') ||
is_obs_text( ch );
}
//
// is_ctext_predicate_t
//
struct is_ctext_predicate_t
{
RESTINIO_NODISCARD
bool
operator()( const char actual ) const noexcept
{
return is_ctext(actual);
}
};
//
// is_token_char_predicate_t
//
struct is_token_char_predicate_t
{
RESTINIO_NODISCARD
static constexpr bool
is_token_char( const char ch ) noexcept
{
return is_alpha(ch) || is_digit(ch) ||
ch == '!' ||
ch == '#' ||
ch == '$' ||
ch == '%' ||
ch == '&' ||
ch == '\'' ||
ch == '*' ||
ch == '+' ||
ch == '-' ||
ch == '.' ||
ch == '^' ||
ch == '_' ||
ch == '`' ||
ch == '|' ||
ch == '~';
}
RESTINIO_NODISCARD
bool
operator()( const char actual ) const noexcept
{
return is_token_char(actual);
}
};
//
// ows_producer_t
//
class ows_producer_t : public producer_tag< restinio::optional_t<char> >
{
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse(
source_t & from ) const noexcept
{
std::size_t extracted_spaces{};
character_t ch;
for( ch = from.getch();
!ch.m_eof && is_space(ch.m_ch);
ch = from.getch() )
{
++extracted_spaces;
}
if( !ch.m_eof )
// The first non-space char should be returned back.
from.putback();
if( extracted_spaces > 0u )
return result_type{ ' ' };
return result_type{ nullopt };
}
};
//
// token_producer_t
//
class token_producer_t : public producer_tag< std::string >
{
RESTINIO_NODISCARD
static optional_t< parse_error_t >
try_parse_value( source_t & from, std::string & accumulator )
{
error_reason_t reason = error_reason_t::pattern_not_found;
do
{
const auto ch = from.getch();
if( ch.m_eof )
{
reason = error_reason_t::unexpected_eof;
break;
}
if( !is_token_char(ch.m_ch) )
{
from.putback();
reason = error_reason_t::unexpected_character;
break;
}
accumulator += ch.m_ch;
}
while( true );
if( accumulator.empty() )
{
return parse_error_t{ from.current_position(), reason };
}
return nullopt;
}
RESTINIO_NODISCARD
static constexpr bool
is_token_char( const char ch ) noexcept
{
return is_token_char_predicate_t::is_token_char( ch );
}
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from ) const
{
std::string value;
const auto try_result = try_parse_value( from, value );
if( !try_result )
return { std::move(value) };
else
return make_unexpected( *try_result );
}
};
//
// quoted_string_producer_t
//
class quoted_string_producer_t : public producer_tag< std::string >
{
RESTINIO_NODISCARD
static optional_t< parse_error_t >
try_parse_value( source_t & from, std::string & accumulator )
{
error_reason_t reason = error_reason_t::pattern_not_found;
bool second_quote_extracted{ false };
do
{
const auto ch = from.getch();
if( ch.m_eof )
{
reason = error_reason_t::unexpected_eof;
break;
}
if( '"' == ch.m_ch )
second_quote_extracted = true;
else if( '\\' == ch.m_ch )
{
const auto next = from.getch();
if( next.m_eof )
{
reason = error_reason_t::unexpected_eof;
break;
}
else if( SP == next.m_ch || HTAB == next.m_ch ||
is_vchar( next.m_ch ) ||
is_obs_text( next.m_ch ) )
{
accumulator += next.m_ch;
}
else
{
reason = error_reason_t::unexpected_character;
from.putback();
break;
}
}
else if( is_qdtext( ch.m_ch ) )
accumulator += ch.m_ch;
else
{
reason = error_reason_t::unexpected_character;
from.putback();
break;
}
}
while( !second_quote_extracted );
if( !second_quote_extracted )
return parse_error_t{ from.current_position(), reason };
else
return nullopt;
}
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from ) const
{
source_t::content_consumer_t consumer{ from };
const auto ch = from.getch();
if( !ch.m_eof )
{
if( '"' == ch.m_ch )
{
std::string value;
const auto try_result = try_parse_value( from, value );
if( !try_result )
{
consumer.commit();
return { std::move(value) };
}
else
return make_unexpected( *try_result );
}
else
{
return make_unexpected( parse_error_t{
consumer.started_at(),
error_reason_t::unexpected_character
} );
}
}
else
return make_unexpected( parse_error_t{
consumer.started_at(),
error_reason_t::unexpected_eof
} );
}
};
//
// quoted_pair_producer_t
//
class quoted_pair_producer_t : public producer_tag< char >
{
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from ) const
{
source_t::content_consumer_t consumer{ from };
error_reason_t reason = error_reason_t::unexpected_eof;
const auto ch = from.getch();
if( !ch.m_eof )
{
if( '\\' == ch.m_ch )
{
const auto next = from.getch();
if( !next.m_eof )
{
if( SP == next.m_ch || HTAB == next.m_ch ||
is_vchar( next.m_ch ) ||
is_obs_text( next.m_ch ) )
{
consumer.commit();
return next.m_ch;
}
reason = error_reason_t::unexpected_character;
}
}
else
reason = error_reason_t::unexpected_character;
}
return make_unexpected( parse_error_t{
from.current_position(),
reason
} );
}
};
//
// comment_producer_t
//
class comment_producer_t : public producer_tag< std::string >
{
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from ) const; // NOTE: implementation below.
};
} /* namespace impl */
//
// alpha_symbol_producer
//
RESTINIO_NODISCARD
inline auto
alpha_symbol_p()
{
return restinio::easy_parser::impl::symbol_producer_template_t<
impl::is_alpha_predicate_t >{};
}
//
// alphanum_symbol_producer
//
RESTINIO_NODISCARD
inline auto
alphanum_symbol_p()
{
return restinio::easy_parser::impl::symbol_producer_template_t<
impl::is_alphanum_predicate_t >{};
}
//
// vchar_symbol_producer
//
RESTINIO_NODISCARD
inline auto
vchar_symbol_p()
{
return restinio::easy_parser::impl::symbol_producer_template_t<
impl::is_vchar_predicate_t >{};
}
//
// ctext_symbol_producer
//
RESTINIO_NODISCARD
inline auto
ctext_symbol_p()
{
return restinio::easy_parser::impl::symbol_producer_template_t<
impl::is_ctext_predicate_t >{};
}
//
// comment_producer
//
RESTINIO_NODISCARD
inline auto
comment_p()
{
return impl::comment_producer_t{};
}
//
// ows_producer
//
RESTINIO_NODISCARD
inline auto
ows_p() noexcept { return impl::ows_producer_t{}; }
//
// ows
//
RESTINIO_NODISCARD
inline auto
ows() noexcept { return ows_p() >> skip(); }
//
// token_symbol_producer
//
RESTINIO_NODISCARD
inline auto
token_symbol_p() noexcept
{
return restinio::easy_parser::impl::symbol_producer_template_t<
impl::is_token_char_predicate_t >{};
}
//
// token_producer
//
RESTINIO_NODISCARD
inline auto
token_p() noexcept { return impl::token_producer_t{}; }
//
// quoted_string_producer
//
RESTINIO_NODISCARD
inline auto
quoted_string_p() noexcept
{
return impl::quoted_string_producer_t{};
}
//
// quoted_pair_producer
//
RESTINIO_NODISCARD
inline auto
quoted_pair_p() noexcept
{
return impl::quoted_pair_producer_t{};
}
//
// expected_token_p
//
RESTINIO_NODISCARD
inline auto
expected_token_p( string_view_t token )
{
return produce< bool >(
exact_p( token ) >> as_result(),
not_clause( token_symbol_p() >> skip() ) );
}
//
// expected_caseless_token_p
//
RESTINIO_NODISCARD
inline auto
expected_caseless_token_p( string_view_t token )
{
return produce< bool >(
caseless_exact_p( token ) >> as_result(),
not_clause( token_symbol_p() >> skip() ) );
}
namespace impl
{
//
// comment_producer_t implementation
//
RESTINIO_NODISCARD
inline expected_t< comment_producer_t::result_type, parse_error_t >
comment_producer_t::try_parse( source_t & from ) const
{
return produce< std::string >(
sequence(
symbol('('),
repeat(0, N,
alternatives(
ctext_symbol_p() >> to_container(),
quoted_pair_p() >> to_container(),
comment_p() >> custom_consumer(
[]( std::string & dest, std::string && what ) {
dest += what;
} )
) ),
symbol(')') )
).try_parse( from );
}
//
// qvalue_producer_t
//
class qvalue_producer_t
: public producer_tag< qvalue_t >
{
// This type has to be used as type parameter for produce().
struct zero_initialized_unit_t
{
qvalue_t::underlying_uint_t m_value{0u};
};
class digit_consumer_t : public consumer_tag
{
const qvalue_t::underlying_uint_t m_multiplier;
public :
constexpr digit_consumer_t( qvalue_t::underlying_uint_t m )
: m_multiplier{ m }
{}
void
consume( zero_initialized_unit_t & dest, char && digit )
{
dest.m_value += m_multiplier *
static_cast< qvalue_t::underlying_uint_t >(digit - '0');
}
};
public :
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from ) const noexcept
{
const auto parse_result = produce< zero_initialized_unit_t >(
alternatives(
sequence(
symbol('0'),
maybe(
symbol('.'),
maybe( digit_p() >> digit_consumer_t{100},
maybe( digit_p() >> digit_consumer_t{10},
maybe( digit_p() >> digit_consumer_t{1} )
)
)
)
),
sequence(
symbol_p('1') >> digit_consumer_t{1000},
maybe(
symbol('.'),
maybe( symbol('0'),
maybe( symbol('0'),
maybe( symbol('0') )
)
)
)
)
)
).try_parse( from );
if( parse_result )
return qvalue_t{ qvalue_t::trusted{ parse_result->m_value } };
else
return make_unexpected( parse_result.error() );
}
};
} /* namespace impl */
//
// qvalue_producer
//
RESTINIO_NODISCARD
inline auto
qvalue_p() noexcept
{
return impl::qvalue_producer_t{};
}
//
// weight_producer
//
RESTINIO_NODISCARD
inline auto
weight_p() noexcept
{
return produce< qvalue_t >(
ows(),
symbol(';'),
ows(),
caseless_symbol('q'),
symbol('='),
qvalue_p() >> as_result()
);
}
namespace impl
{
//
// non_empty_comma_separated_list_producer_t
//
template<
typename Container,
typename Element_Producer >
class non_empty_comma_separated_list_producer_t
: public producer_tag< Container >
{
static_assert( impl::is_producer_v<Element_Producer>,
"Element_Producer should be a value producer type" );
Element_Producer m_element;
public :
using typename producer_tag< Container >::result_type;
non_empty_comma_separated_list_producer_t(
Element_Producer && element )
: m_element{ std::move(element) }
{}
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from )
{
Container tmp_value;
const auto appender = to_container();
const auto process_result = sequence(
repeat( 0, N, symbol(','), ows() ),
m_element >> appender,
repeat( 0, N,
ows(), symbol(','),
maybe( ows(), m_element >> appender )
)
).try_process( from, tmp_value );
if( !process_result )
return { std::move(tmp_value) };
else
return make_unexpected( *process_result );
}
};
//
// maybe_empty_comma_separated_list_producer_t
//
template<
typename Container,
typename Element_Producer >
class maybe_empty_comma_separated_list_producer_t
: public producer_tag< Container >
{
static_assert( impl::is_producer_v<Element_Producer>,
"Element_Producer should be a value producer type" );
Element_Producer m_element;
public :
using typename producer_tag< Container >::result_type;
maybe_empty_comma_separated_list_producer_t(
Element_Producer && element )
: m_element{ std::move(element) }
{}
RESTINIO_NODISCARD
expected_t< result_type, parse_error_t >
try_parse( source_t & from )
{
Container tmp_value;
const auto appender = to_container();
const auto process_result = maybe(
alternatives( symbol(','), m_element >> appender ),
repeat( 0, N,
ows(), symbol(','),
maybe( ows(), m_element >> appender )
)
).try_process( from, tmp_value );
if( !process_result )
return { std::move(tmp_value) };
else
return make_unexpected( *process_result );
}
};
} /* namespace impl */
//
// non_empty_comma_separated_list_producer
//
template<
typename Container,
typename Element_Producer >
RESTINIO_NODISCARD
auto
non_empty_comma_separated_list_p( Element_Producer element )
{
static_assert( impl::is_producer_v<Element_Producer>,
"Element_Producer should be a value producer type" );
return impl::non_empty_comma_separated_list_producer_t<
Container,
Element_Producer >{ std::move(element) };
}
//
// maybe_empty_comma_separated_list_producer
//
template<
typename Container,
typename Element_Producer >
RESTINIO_NODISCARD
auto
maybe_empty_comma_separated_list_p( Element_Producer element )
{
static_assert( impl::is_producer_v<Element_Producer>,
"Element_Producer should be a value producer type" );
return impl::maybe_empty_comma_separated_list_producer_t<
Container,
Element_Producer >{ std::move(element) };
}
//
// parameter_with_mandatory_value_t
//
using parameter_with_mandatory_value_t = std::pair< std::string, std::string >;
//
// parameter_with_mandatory_value_container_t
//
using parameter_with_mandatory_value_container_t =
std::vector< parameter_with_mandatory_value_t >;
//
// not_found_t
//
struct not_found_t {};
//
// find_first
//
RESTINIO_NODISCARD
inline expected_t< string_view_t, not_found_t >
find_first(
const parameter_with_mandatory_value_container_t & where,
string_view_t what )
{
const auto it = std::find_if( where.begin(), where.end(),
[&what]( const auto & pair ) {
return restinio::impl::is_equal_caseless( pair.first, what );
} );
if( it != where.end() )
return string_view_t{ it->second };
else
return make_unexpected( not_found_t{} );
}
namespace impl
{
namespace params_with_value_producer_details
{
//
// make_parser
//
RESTINIO_NODISCARD
inline auto
make_parser()
{
return produce< parameter_with_mandatory_value_container_t >(
repeat( 0, N,
produce< parameter_with_mandatory_value_t >(
ows(),
symbol(';'),
ows(),
token_p() >> to_lower()
>> &parameter_with_mandatory_value_t::first,
symbol('='),
alternatives(
token_p()
>> &parameter_with_mandatory_value_t::second,
quoted_string_p()
>> &parameter_with_mandatory_value_t::second
)
) >> to_container()
)
);
}
} /* namespace params_with_value_producer_details */
//
// params_with_value_producer_t
//
class params_with_value_producer_t
: public producer_tag< parameter_with_mandatory_value_container_t >
{
using actual_producer_t = std::decay_t<
decltype(params_with_value_producer_details::make_parser()) >;
actual_producer_t m_producer{
params_with_value_producer_details::make_parser() };
public :
params_with_value_producer_t() = default;
RESTINIO_NODISCARD
auto
try_parse( source_t & from )
{
return m_producer.try_parse( from );
}
};
} /* namespace impl */
//
// params_with_value_producer
//
RESTINIO_NODISCARD
inline impl::params_with_value_producer_t
params_with_value_p() { return {}; }
//
// parameter_with_optional_value_t
//
using parameter_with_optional_value_t =
std::pair< std::string, restinio::optional_t<std::string> >;
//
// parameter_with_optional_value_container_t
//
using parameter_with_optional_value_container_t =
std::vector< parameter_with_optional_value_t >;
//
// find_first
//
RESTINIO_NODISCARD
inline expected_t< restinio::optional_t<string_view_t>, not_found_t >
find_first(
const parameter_with_optional_value_container_t & where,
string_view_t what )
{
const auto it = std::find_if( where.begin(), where.end(),
[&what]( const auto & pair ) {
return restinio::impl::is_equal_caseless( pair.first, what );
} );
if( it != where.end() )
{
const auto opt = it->second;
if( opt )
return string_view_t{ *opt };
else
return restinio::optional_t< string_view_t >{ nullopt };
}
else
return make_unexpected( not_found_t{} );
}
namespace impl
{
namespace params_with_opt_value_producer_details
{
//
// make_parser
//
RESTINIO_NODISCARD
inline auto
make_parser()
{
return produce< parameter_with_optional_value_container_t >(
repeat( 0, N,
produce< parameter_with_optional_value_t >(
ows(),
symbol(';'),
ows(),
token_p() >> to_lower()
>> &parameter_with_optional_value_t::first,
maybe(
symbol('='),
alternatives(
token_p()
>> &parameter_with_optional_value_t::second,
quoted_string_p()
>> &parameter_with_optional_value_t::second
)
)
) >> to_container()
)
);
}
} /* namespace params_with_opt_value_producer_details */
//
// params_with_opt_value_producer_t
//
class params_with_opt_value_producer_t
: public producer_tag< parameter_with_optional_value_container_t >
{
using actual_producer_t = std::decay_t<
decltype(params_with_opt_value_producer_details::make_parser()) >;
actual_producer_t m_producer{
params_with_opt_value_producer_details::make_parser() };
public :
params_with_opt_value_producer_t() = default;
RESTINIO_NODISCARD
auto
try_parse( source_t & from )
{
return m_producer.try_parse( from );
}
};
} /* namespace impl */
//
// params_with_opt_value_producer
//
RESTINIO_NODISCARD
inline impl::params_with_opt_value_producer_t
params_with_opt_value_p() { return {}; }
} /* namespace http_field_parser */
} /* namespace restinio */
nonstd::optional_lite::optional
class optional
Definition: optional.hpp:919
restinio::easy_parser::impl::source_t::content_consumer_t
A helper class to automatically return acquired content back to the input stream.
Definition: easy_parser.hpp:851
restinio::easy_parser::impl::source_t
The class that implements "input stream".
Definition: easy_parser.hpp:740
restinio::easy_parser::impl::source_t::getch
RESTINIO_NODISCARD character_t getch() noexcept
Get the next character from the input stream.
Definition: easy_parser.hpp:765
restinio::easy_parser::impl::source_t::putback
void putback() noexcept
Return one character back to the input stream.
Definition: easy_parser.hpp:777
restinio::easy_parser::impl::source_t::current_position
RESTINIO_NODISCARD position_t current_position() const noexcept
Get the current position in the stream.
Definition: easy_parser.hpp:786
restinio::easy_parser::impl::symbol_producer_template_t
A template for producer of charachers that satisfy some predicate.
Definition: easy_parser.hpp:2133
restinio::easy_parser::parse_error_t
Information about parsing error.
Definition: easy_parser.hpp:93
restinio::exception_t
Exception class for all exceptions thrown by RESTinio.
Definition: exception.hpp:26
restinio::http_field_parsers::impl::comment_producer_t
A producer for comment.
Definition: basics.hpp:763
restinio::http_field_parsers::impl::comment_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const
Definition: basics.hpp:1127
restinio::http_field_parsers::impl::maybe_empty_comma_separated_list_producer_t
A template for a producer that handles possibly empty list of comma-separated values.
Definition: basics.hpp:1382
restinio::http_field_parsers::impl::maybe_empty_comma_separated_list_producer_t::m_element
Element_Producer m_element
Definition: basics.hpp:1384
restinio::http_field_parsers::impl::maybe_empty_comma_separated_list_producer_t::maybe_empty_comma_separated_list_producer_t
maybe_empty_comma_separated_list_producer_t(Element_Producer &&element)
Definition: basics.hpp:1391
restinio::http_field_parsers::impl::maybe_empty_comma_separated_list_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from)
Definition: basics.hpp:1398
restinio::http_field_parsers::impl::non_empty_comma_separated_list_producer_t
A template for a producer that handles non-empty list of comma-separated values.
Definition: basics.hpp:1318
restinio::http_field_parsers::impl::non_empty_comma_separated_list_producer_t::m_element
Element_Producer m_element
Definition: basics.hpp:1320
restinio::http_field_parsers::impl::non_empty_comma_separated_list_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from)
Definition: basics.hpp:1334
restinio::http_field_parsers::impl::non_empty_comma_separated_list_producer_t::non_empty_comma_separated_list_producer_t
non_empty_comma_separated_list_producer_t(Element_Producer &&element)
Definition: basics.hpp:1327
restinio::http_field_parsers::impl::ows_producer_t
A producer for OWS.
Definition: basics.hpp:482
restinio::http_field_parsers::impl::ows_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const noexcept
Definition: basics.hpp:486
restinio::http_field_parsers::impl::params_with_opt_value_producer_t
A type of producer that produces instances of parameter_with_optional_value_container.
Definition: basics.hpp:1812
restinio::http_field_parsers::impl::params_with_opt_value_producer_t::params_with_opt_value_producer_t
params_with_opt_value_producer_t()=default
restinio::http_field_parsers::impl::params_with_opt_value_producer_t::actual_producer_t
std::decay_t< decltype(params_with_opt_value_producer_details::make_parser()) > actual_producer_t
Definition: basics.hpp:1814
restinio::http_field_parsers::impl::params_with_opt_value_producer_t::m_producer
actual_producer_t m_producer
Definition: basics.hpp:1816
restinio::http_field_parsers::impl::params_with_opt_value_producer_t::try_parse
RESTINIO_NODISCARD auto try_parse(source_t &from)
Definition: basics.hpp:1824
restinio::http_field_parsers::impl::params_with_value_producer_t
A type of producer that produces instances of parameter_with_mandatory_value_container.
Definition: basics.hpp:1634
restinio::http_field_parsers::impl::params_with_value_producer_t::try_parse
RESTINIO_NODISCARD auto try_parse(source_t &from)
Definition: basics.hpp:1646
restinio::http_field_parsers::impl::params_with_value_producer_t::actual_producer_t
std::decay_t< decltype(params_with_value_producer_details::make_parser()) > actual_producer_t
Definition: basics.hpp:1636
restinio::http_field_parsers::impl::params_with_value_producer_t::m_producer
actual_producer_t m_producer
Definition: basics.hpp:1638
restinio::http_field_parsers::impl::params_with_value_producer_t::params_with_value_producer_t
params_with_value_producer_t()=default
restinio::http_field_parsers::impl::quoted_pair_producer_t
A producer for quoted_pair.
Definition: basics.hpp:702
restinio::http_field_parsers::impl::quoted_pair_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const
Definition: basics.hpp:706
restinio::http_field_parsers::impl::quoted_string_producer_t
A producer for quoted_string.
Definition: basics.hpp:593
restinio::http_field_parsers::impl::quoted_string_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const
Definition: basics.hpp:653
restinio::http_field_parsers::impl::quoted_string_producer_t::try_parse_value
static RESTINIO_NODISCARD optional_t< parse_error_t > try_parse_value(source_t &from, std::string &accumulator)
Definition: basics.hpp:596
restinio::http_field_parsers::impl::qvalue_producer_t::digit_consumer_t
A helper class to be used to accumulate actual integer while when the next digit is extracted from th...
Definition: basics.hpp:1174
restinio::http_field_parsers::impl::qvalue_producer_t::digit_consumer_t::consume
void consume(zero_initialized_unit_t &dest, char &&digit)
Definition: basics.hpp:1183
restinio::http_field_parsers::impl::qvalue_producer_t::digit_consumer_t::m_multiplier
const qvalue_t::underlying_uint_t m_multiplier
Definition: basics.hpp:1175
restinio::http_field_parsers::impl::qvalue_producer_t::digit_consumer_t::digit_consumer_t
constexpr digit_consumer_t(qvalue_t::underlying_uint_t m)
Definition: basics.hpp:1178
restinio::http_field_parsers::impl::qvalue_producer_t
An implementation of producer of qvalue.
Definition: basics.hpp:1164
restinio::http_field_parsers::impl::qvalue_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const noexcept
Definition: basics.hpp:1193
restinio::http_field_parsers::impl::token_producer_t
A producer for token.
Definition: basics.hpp:523
restinio::http_field_parsers::impl::token_producer_t::try_parse
RESTINIO_NODISCARD expected_t< result_type, parse_error_t > try_parse(source_t &from) const
Definition: basics.hpp:568
restinio::http_field_parsers::impl::token_producer_t::try_parse_value
static RESTINIO_NODISCARD optional_t< parse_error_t > try_parse_value(source_t &from, std::string &accumulator)
Definition: basics.hpp:526
restinio::http_field_parsers::impl::token_producer_t::is_token_char
static RESTINIO_NODISCARD constexpr bool is_token_char(const char ch) noexcept
Definition: basics.hpp:560
restinio::http_field_parsers::qvalue_details::trusted
A helper wrapper to indicate that value is already checked and shouldn't be checked again.
Definition: basics.hpp:51
restinio::http_field_parsers::qvalue_details::trusted::m_value
const underlying_uint_t m_value
Definition: basics.hpp:52
restinio::http_field_parsers::qvalue_details::trusted::trusted
constexpr trusted(underlying_uint_t value) noexcept
Definition: basics.hpp:56
restinio::http_field_parsers::qvalue_details::trusted::get
constexpr auto get() const noexcept
Definition: basics.hpp:58
restinio::http_field_parsers::qvalue_details::untrusted
A helper wrapper to indicate that value hasn't been checked yet and should be checked in the construc...
Definition: basics.hpp:64
restinio::http_field_parsers::qvalue_details::untrusted::get
auto get() const noexcept
Definition: basics.hpp:76
restinio::http_field_parsers::qvalue_details::untrusted::untrusted
untrusted(underlying_uint_t value)
Definition: basics.hpp:69
restinio::http_field_parsers::qvalue_details::untrusted::m_value
underlying_uint_t m_value
Definition: basics.hpp:65
restinio::http_field_parsers::qvalue_t
A class for holding the parsed value of qvalue from RFC7231.
Definition: basics.hpp:136
restinio::http_field_parsers::qvalue_t::qvalue_t
constexpr qvalue_t(qvalue_details::extremum_min_t) noexcept
Definition: basics.hpp:196
restinio::http_field_parsers::qvalue_t::as_uint
constexpr auto as_uint() const noexcept
Definition: basics.hpp:204
restinio::http_field_parsers::qvalue_t::underlying_char_array_t
std::array< char, 6 > underlying_char_array_t
Definition: basics.hpp:156
restinio::http_field_parsers::qvalue_t::make_char_array
underlying_char_array_t make_char_array() const noexcept
Definition: basics.hpp:161
restinio::http_field_parsers::qvalue_t::zero
static constexpr qvalue_details::extremum_min_t zero
The indicator that tells that new qvalue object should have the minimal allowed value.
Definition: basics.hpp:151
restinio::http_field_parsers::qvalue_t::qvalue_t
constexpr qvalue_t()=default
restinio::http_field_parsers::qvalue_t::qvalue_t
constexpr qvalue_t(trusted val) noexcept
Definition: basics.hpp:192
restinio::http_field_parsers::qvalue_t::as_string
auto as_string() const
Definition: basics.hpp:206
restinio::http_field_parsers::qvalue_t::m_value
underlying_uint_t m_value
Definition: basics.hpp:158
restinio::http_field_parsers::qvalue_t::underlying_uint_t
qvalue_details::underlying_uint_t underlying_uint_t
The type of underlying small integer.
Definition: basics.hpp:139
restinio::http_field_parsers::qvalue_t::qvalue_t
constexpr qvalue_t(qvalue_details::extremum_max_t) noexcept
Definition: basics.hpp:200
restinio::http_field_parsers::qvalue_t::qvalue_t
qvalue_t(untrusted val) noexcept
Definition: basics.hpp:188
restinio::http_field_parsers::qvalue_t::operator<<
friend std::ostream & operator<<(std::ostream &to, const qvalue_t &what)
Definition: basics.hpp:212
restinio::http_field_parsers::qvalue_t::maximum
static constexpr qvalue_details::extremum_max_t maximum
The indicator that tells that new qvalue object should have the maximal allowed value.
Definition: basics.hpp:147
RESTINIO_NODISCARD
#define RESTINIO_NODISCARD
Definition: compiler_features.hpp:33
easy_parser.hpp
An very small, simple and somewhat limited implementation of recursive-descent parser.
expected.hpp
nonstd::optional_lite::std11::move
T & move(T &t)
Definition: optional.hpp:465
nonstd::optional_lite::nullopt
const nullopt_t nullopt((nullopt_t::init()))
restinio::easy_parser::impl
Definition: easy_parser.hpp:280
restinio::easy_parser::impl::HTAB
constexpr char HTAB
A constant for Horizontal Tab value.
Definition: easy_parser.hpp:623
restinio::easy_parser::impl::is_space
RESTINIO_NODISCARD constexpr bool is_space(const char ch) noexcept
If a character a space character?
Definition: easy_parser.hpp:635
restinio::easy_parser::impl::SP
constexpr char SP
A constant for SPACE value.
Definition: easy_parser.hpp:617
restinio::easy_parser::impl::is_digit
RESTINIO_NODISCARD constexpr bool is_digit(const char ch) noexcept
Is a character a decimal digit?
Definition: easy_parser.hpp:669
restinio::easy_parser::impl::entity_type_t::consumer
@ consumer
Entity is a consumer of values. It requires a value on the input and doesn't produces anything.
restinio::easy_parser
Definition: easy_parser.hpp:39
restinio::easy_parser::maybe
RESTINIO_NODISCARD auto maybe(Clauses &&... clauses)
A factory function to create an optional clause.
Definition: easy_parser.hpp:3634
restinio::easy_parser::symbol
RESTINIO_NODISCARD auto symbol(char expected) noexcept
A factory function to create a clause that expects the speficied symbol, extracts it and then skips i...
Definition: easy_parser.hpp:4032
restinio::easy_parser::sequence
RESTINIO_NODISCARD auto sequence(Clauses &&... clauses)
A factory function to create a sequence of subclauses.
Definition: easy_parser.hpp:3758
restinio::easy_parser::error_reason_t
error_reason_t
Reason of parsing error.
Definition: easy_parser.hpp:52
restinio::easy_parser::digit
RESTINIO_NODISCARD auto digit() noexcept
A factory function to create a clause that expects a decimal digit, extracts it and then skips it.
Definition: easy_parser.hpp:4154
restinio::easy_parser::repeat
RESTINIO_NODISCARD auto repeat(std::size_t min_occurences, std::size_t max_occurences, Clauses &&... clauses)
A factory function to create repetitor of subclauses.
Definition: easy_parser.hpp:3876
restinio::easy_parser::skip
RESTINIO_NODISCARD auto skip() noexcept
A factory function to create a skip_consumer.
Definition: easy_parser.hpp:3922
restinio::easy_parser::custom_consumer
RESTINIO_NODISCARD auto custom_consumer(F consumer)
A factory function to create a custom_consumer.
Definition: easy_parser.hpp:4516
restinio::easy_parser::digit_p
RESTINIO_NODISCARD auto digit_p() noexcept
A factory function to create a digit_producer.
Definition: easy_parser.hpp:4133
restinio::easy_parser::exact_p
RESTINIO_NODISCARD auto exact_p(string_view_t fragment)
A factory function that creates an instance of exact_fragment_producer.
Definition: easy_parser.hpp:4768
restinio::easy_parser::caseless_symbol
RESTINIO_NODISCARD auto caseless_symbol(char expected) noexcept
A factory function to create a clause that expects the speficied symbol, extracts it and then skips i...
Definition: easy_parser.hpp:4055
restinio::easy_parser::as_result
RESTINIO_NODISCARD auto as_result() noexcept
A factory function to create a as_result_consumer.
Definition: easy_parser.hpp:4470
restinio::easy_parser::N
constexpr std::size_t N
A special marker that means infinite repetitions.
Definition: easy_parser.hpp:455
restinio::easy_parser::to_container
RESTINIO_NODISCARD auto to_container()
A factory function to create a to_container_consumer.
Definition: easy_parser.hpp:4583
restinio::easy_parser::symbol_p
RESTINIO_NODISCARD auto symbol_p(char expected) noexcept
A factory function to create a symbol_producer.
Definition: easy_parser.hpp:3955
restinio::easy_parser::not_clause
RESTINIO_NODISCARD auto not_clause(Clauses &&... clauses)
A factory function to create a not_clause.
Definition: easy_parser.hpp:3676
restinio::easy_parser::caseless_exact_p
RESTINIO_NODISCARD auto caseless_exact_p(string_view_t fragment)
A factory function that creates an instance of caseless_exact_fragment_producer.
Definition: easy_parser.hpp:4897
restinio::easy_parser::to_lower
RESTINIO_NODISCARD auto to_lower() noexcept
A factory function to create a to_lower_transformer.
Definition: easy_parser.hpp:4610
restinio::easy_parser::alternatives
RESTINIO_NODISCARD auto alternatives(Clauses &&... clauses)
A factory function to create an alternatives clause.
Definition: easy_parser.hpp:3595
restinio::http_field_parsers::impl::params_with_opt_value_producer_details::make_parser
RESTINIO_NODISCARD auto make_parser()
Helper function that creates an instance of producer of parameter_with_optional_value_container.
Definition: basics.hpp:1775
restinio::http_field_parsers::impl::params_with_value_producer_details::make_parser
RESTINIO_NODISCARD auto make_parser()
Helper function that creates an instance of producer of parameter_with_mandatory_value_container.
Definition: basics.hpp:1599
restinio::http_field_parsers::impl::is_vchar
RESTINIO_NODISCARD constexpr bool is_vchar(const char ch) noexcept
Is a character a VCHAR?
Definition: basics.hpp:319
restinio::http_field_parsers::impl::is_obs_text
RESTINIO_NODISCARD constexpr bool is_obs_text(const char ch) noexcept
Is a character an obs_text?
Definition: basics.hpp:355
restinio::http_field_parsers::impl::is_alpha
RESTINIO_NODISCARD constexpr bool is_alpha(const char ch) noexcept
Is a character an ALPHA?
Definition: basics.hpp:263
restinio::http_field_parsers::impl::is_ctext
RESTINIO_NODISCARD constexpr bool is_ctext(const char ch) noexcept
Is a character a ctext?
Definition: basics.hpp:400
restinio::http_field_parsers::impl::is_qdtext
RESTINIO_NODISCARD constexpr bool is_qdtext(const char ch) noexcept
Is a character a qdtext?
Definition: basics.hpp:378
restinio::http_field_parsers::qvalue_details::extremum_max_t
extremum_max_t
Definition: basics.hpp:46
restinio::http_field_parsers::qvalue_details::extremum_max_t::v
@ v
restinio::http_field_parsers::qvalue_details::zero
constexpr underlying_uint_t zero
The minimal allowed value for a qvalue.
Definition: basics.hpp:41
restinio::http_field_parsers::qvalue_details::underlying_uint_t
std::uint_least16_t underlying_uint_t
A type to hold a qvalue.
Definition: basics.hpp:36
restinio::http_field_parsers::qvalue_details::maximum
constexpr underlying_uint_t maximum
The maximal allowed value for a qvalue.
Definition: basics.hpp:39
restinio::http_field_parsers::qvalue_details::extremum_min_t
extremum_min_t
Definition: basics.hpp:45
restinio::http_field_parsers::qvalue_details::extremum_min_t::v
@ v
restinio::http_field_parsers::qvalue_p
RESTINIO_NODISCARD auto qvalue_p() noexcept
A factory function to create a qvalue_producer.
Definition: basics.hpp:1250
restinio::http_field_parsers::maybe_empty_comma_separated_list_p
RESTINIO_NODISCARD auto maybe_empty_comma_separated_list_p(Element_Producer element)
A factory for a producer that handles possibly empty list of comma-separated values.
Definition: basics.hpp:1503
restinio::http_field_parsers::non_empty_comma_separated_list_p
RESTINIO_NODISCARD auto non_empty_comma_separated_list_p(Element_Producer element)
A factory for a producer that handles non-empty list of comma-separated values.
Definition: basics.hpp:1457
restinio::http_field_parsers::comment_p
RESTINIO_NODISCARD auto comment_p()
A factory for producer of comment token.
Definition: basics.hpp:880
restinio::http_field_parsers::expected_token_p
RESTINIO_NODISCARD auto expected_token_p(string_view_t token)
A factory function to create a producer that expect a token with specific value.
Definition: basics.hpp:1073
restinio::http_field_parsers::find_first
RESTINIO_NODISCARD expected_t< string_view_t, not_found_t > find_first(const parameter_with_mandatory_value_container_t &where, string_view_t what)
A helper function to find the first occurence of a parameter with the specified value.
Definition: basics.hpp:1568
restinio::http_field_parsers::parameter_with_optional_value_t
std::pair< std::string, restinio::optional_t< std::string > > parameter_with_optional_value_t
A type that describes a parameter with optional value.
Definition: basics.hpp:1696
restinio::http_field_parsers::params_with_value_p
RESTINIO_NODISCARD impl::params_with_value_producer_t params_with_value_p()
A factory of producer of parameter_with_mandatory_value_container.
Definition: basics.hpp:1685
restinio::http_field_parsers::parameter_with_mandatory_value_container_t
std::vector< parameter_with_mandatory_value_t > parameter_with_mandatory_value_container_t
A type of container for parameters with mandatory values.
Definition: basics.hpp:1532
restinio::http_field_parsers::alphanum_symbol_p
RESTINIO_NODISCARD auto alphanum_symbol_p()
A factory for producer of symbol that an ALPHA or DIGIT.
Definition: basics.hpp:810
restinio::http_field_parsers::operator<
RESTINIO_NODISCARD bool operator<(const qvalue_t &a, const qvalue_t &b) noexcept
Definition: basics.hpp:234
restinio::http_field_parsers::vchar_symbol_p
RESTINIO_NODISCARD auto vchar_symbol_p()
A factory for producer of VCHAR symbols.
Definition: basics.hpp:832
restinio::http_field_parsers::alpha_symbol_p
RESTINIO_NODISCARD auto alpha_symbol_p()
A factory for producer of ALPHA symbols.
Definition: basics.hpp:788
restinio::http_field_parsers::operator==
RESTINIO_NODISCARD bool operator==(const qvalue_t &a, const qvalue_t &b) noexcept
Definition: basics.hpp:220
restinio::http_field_parsers::ows
RESTINIO_NODISCARD auto ows() noexcept
A factory function to create an OWS clause.
Definition: basics.hpp:939
restinio::http_field_parsers::token_p
RESTINIO_NODISCARD auto token_p() noexcept
A factory function to create a token_producer.
Definition: basics.hpp:985
restinio::http_field_parsers::params_with_opt_value_p
RESTINIO_NODISCARD impl::params_with_opt_value_producer_t params_with_opt_value_p()
A factory of producer of parameter_with_optional_value_container.
Definition: basics.hpp:1863
restinio::http_field_parsers::quoted_string_p
RESTINIO_NODISCARD auto quoted_string_p() noexcept
A factory function to create a quoted_string_producer.
Definition: basics.hpp:1012
restinio::http_field_parsers::operator!=
RESTINIO_NODISCARD bool operator!=(const qvalue_t &a, const qvalue_t &b) noexcept
Definition: basics.hpp:227
restinio::http_field_parsers::operator<=
RESTINIO_NODISCARD bool operator<=(const qvalue_t &a, const qvalue_t &b) noexcept
Definition: basics.hpp:241
restinio::http_field_parsers::expected_caseless_token_p
RESTINIO_NODISCARD auto expected_caseless_token_p(string_view_t token)
A factory function to create a producer that expect a token with specific value.
Definition: basics.hpp:1112
restinio::http_field_parsers::parameter_with_mandatory_value_t
std::pair< std::string, std::string > parameter_with_mandatory_value_t
A type that describes a parameter with mandatory value.
Definition: basics.hpp:1521
restinio::http_field_parsers::quoted_pair_p
RESTINIO_NODISCARD auto quoted_pair_p() noexcept
A factory function to create a quoted_pair_producer.
Definition: basics.hpp:1038
restinio::http_field_parsers::parameter_with_optional_value_container_t
std::vector< parameter_with_optional_value_t > parameter_with_optional_value_container_t
A type of container for parameters with optional values.
Definition: basics.hpp:1707
restinio::http_field_parsers::ctext_symbol_p
RESTINIO_NODISCARD auto ctext_symbol_p()
A factory for producer of ctext symbols.
Definition: basics.hpp:854
restinio::http_field_parsers::weight_p
RESTINIO_NODISCARD auto weight_p() noexcept
A factory function to create a producer for weight parameter.
Definition: basics.hpp:1277
restinio::http_field_parsers::token_symbol_p
RESTINIO_NODISCARD auto token_symbol_p() noexcept
A factory for producer of symbols than can be used in tokens.
Definition: basics.hpp:957
restinio::http_field_parsers::ows_p
RESTINIO_NODISCARD auto ows_p() noexcept
A factory function to create an ows_producer.
Definition: basics.hpp:909
restinio::utils::metaprogramming
Definition: metaprogramming.hpp:24
restinio
Definition: asio_include.hpp:21
restinio::string_view_t
nonstd::string_view string_view_t
Definition: string_view.hpp:19
restinio::expected_t
nonstd::expected< T, E > expected_t
Definition: expected.hpp:22
std
STL namespace.
string_caseless_compare.hpp
Helpers for caseless comparison of strings.
restinio::easy_parser::impl::character_t
One character extracted from the input stream.
Definition: easy_parser.hpp:593
restinio::easy_parser::impl::character_t::m_eof
bool m_eof
Definition: easy_parser.hpp:594
restinio::easy_parser::impl::character_t::m_ch
char m_ch
Definition: easy_parser.hpp:595
restinio::easy_parser::impl::consumer_tag
A special base class to be used with consumers.
Definition: easy_parser.hpp:1343
restinio::easy_parser::impl::producer_tag
A special base class to be used with producers.
Definition: easy_parser.hpp:945
restinio::http_field_parsers::impl::is_alpha_predicate_t
A preducate for symbol_producer_template that checks that a symbol is an alpha.
Definition: basics.hpp:279
restinio::http_field_parsers::impl::is_alpha_predicate_t::operator()
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
Definition: basics.hpp:282
restinio::http_field_parsers::impl::is_alphanum_predicate_t
A preducate for symbol_producer_template that checks that a symbol is an alpha or numeric.
Definition: basics.hpp:298
restinio::http_field_parsers::impl::is_alphanum_predicate_t::operator()
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
Definition: basics.hpp:301
restinio::http_field_parsers::impl::is_ctext_predicate_t
A preducate for symbol_producer_template that checks that a symbol is a ctext.
Definition: basics.hpp:420
restinio::http_field_parsers::impl::is_ctext_predicate_t::operator()
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
Definition: basics.hpp:423
restinio::http_field_parsers::impl::is_token_char_predicate_t
A predicate for symbol_producer_template that checks that a symbol can be used inside a token.
Definition: basics.hpp:437
restinio::http_field_parsers::impl::is_token_char_predicate_t::is_token_char
static RESTINIO_NODISCARD constexpr bool is_token_char(const char ch) noexcept
Definition: basics.hpp:440
restinio::http_field_parsers::impl::is_token_char_predicate_t::operator()
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
Definition: basics.hpp:462
restinio::http_field_parsers::impl::is_vchar_predicate_t
A preducate for symbol_producer_template that checks that a symbol is a VCHAR.
Definition: basics.hpp:334
restinio::http_field_parsers::impl::is_vchar_predicate_t::operator()
RESTINIO_NODISCARD bool operator()(const char actual) const noexcept
Definition: basics.hpp:337
restinio::http_field_parsers::impl::qvalue_producer_t::zero_initialized_unit_t
Definition: basics.hpp:1167
restinio::http_field_parsers::impl::qvalue_producer_t::zero_initialized_unit_t::m_value
qvalue_t::underlying_uint_t m_value
Definition: basics.hpp:1168
restinio::http_field_parsers::not_found_t
An empty type to be used as indicator of negative search result.
Definition: basics.hpp:1542
const
#define const
Definition: zconf.h:230