RESTinio
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
basics.hpp File Reference

Utilities for parsing values of http-fields. More...

#include <restinio/impl/string_caseless_compare.hpp>
#include <restinio/helpers/easy_parser.hpp>
#include <restinio/expected.hpp>
#include <algorithm>

Go to the source code of this file.

Classes

class  restinio::http_field_parsers::qvalue_details::trusted
 A helper wrapper to indicate that value is already checked and shouldn't be checked again. More...
 
class  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 constructor of qvalue. More...
 
class  restinio::http_field_parsers::qvalue_t
 A class for holding the parsed value of qvalue from RFC7231. More...
 
struct  restinio::http_field_parsers::impl::is_alpha_predicate_t
 A preducate for symbol_producer_template that checks that a symbol is an alpha. More...
 
struct  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. More...
 
struct  restinio::http_field_parsers::impl::is_vchar_predicate_t
 A preducate for symbol_producer_template that checks that a symbol is a VCHAR. More...
 
struct  restinio::http_field_parsers::impl::is_ctext_predicate_t
 A preducate for symbol_producer_template that checks that a symbol is a ctext. More...
 
struct  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. More...
 
class  restinio::http_field_parsers::impl::ows_producer_t
 A producer for OWS. More...
 
class  restinio::http_field_parsers::impl::token_producer_t
 A producer for token. More...
 
class  restinio::http_field_parsers::impl::quoted_string_producer_t
 A producer for quoted_string. More...
 
class  restinio::http_field_parsers::impl::quoted_pair_producer_t
 A producer for quoted_pair. More...
 
class  restinio::http_field_parsers::impl::comment_producer_t
 A producer for comment. More...
 
class  restinio::http_field_parsers::impl::qvalue_producer_t
 An implementation of producer of qvalue. More...
 
struct  restinio::http_field_parsers::impl::qvalue_producer_t::zero_initialized_unit_t
 
class  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 the input stream. More...
 
class  restinio::http_field_parsers::impl::non_empty_comma_separated_list_producer_t< Container, Element_Producer >
 A template for a producer that handles non-empty list of comma-separated values. More...
 
class  restinio::http_field_parsers::impl::maybe_empty_comma_separated_list_producer_t< Container, Element_Producer >
 A template for a producer that handles possibly empty list of comma-separated values. More...
 
struct  restinio::http_field_parsers::not_found_t
 An empty type to be used as indicator of negative search result. More...
 
class  restinio::http_field_parsers::impl::params_with_value_producer_t
 A type of producer that produces instances of parameter_with_mandatory_value_container. More...
 
class  restinio::http_field_parsers::impl::params_with_opt_value_producer_t
 A type of producer that produces instances of parameter_with_optional_value_container. More...
 

Namespaces

namespace  restinio
 
namespace  restinio::http_field_parsers
 
namespace  restinio::http_field_parsers::qvalue_details
 
namespace  restinio::http_field_parsers::impl
 
namespace  restinio::http_field_parsers::impl::params_with_value_producer_details
 
namespace  restinio::http_field_parsers::impl::params_with_opt_value_producer_details
 

Typedefs

using restinio::http_field_parsers::qvalue_details::underlying_uint_t = std::uint_least16_t
 A type to hold a qvalue. More...
 
using restinio::http_field_parsers::parameter_with_mandatory_value_t = std::pair< std::string, std::string >
 A type that describes a parameter with mandatory value. More...
 
using restinio::http_field_parsers::parameter_with_mandatory_value_container_t = std::vector< parameter_with_mandatory_value_t >
 A type of container for parameters with mandatory values. More...
 
using restinio::http_field_parsers::parameter_with_optional_value_t = std::pair< std::string, restinio::optional_t< std::string > >
 A type that describes a parameter with optional value. More...
 
using restinio::http_field_parsers::parameter_with_optional_value_container_t = std::vector< parameter_with_optional_value_t >
 A type of container for parameters with optional values. More...
 

Enumerations

enum class  restinio::http_field_parsers::qvalue_details::extremum_min_t { restinio::http_field_parsers::qvalue_details::v }
 
enum class  restinio::http_field_parsers::qvalue_details::extremum_max_t { restinio::http_field_parsers::qvalue_details::v }
 

Functions

RESTINIO_NODISCARD bool restinio::http_field_parsers::operator== (const qvalue_t &a, const qvalue_t &b) noexcept
 
RESTINIO_NODISCARD bool restinio::http_field_parsers::operator!= (const qvalue_t &a, const qvalue_t &b) noexcept
 
RESTINIO_NODISCARD bool restinio::http_field_parsers::operator< (const qvalue_t &a, const qvalue_t &b) noexcept
 
RESTINIO_NODISCARD bool restinio::http_field_parsers::operator<= (const qvalue_t &a, const qvalue_t &b) noexcept
 
RESTINIO_NODISCARD constexpr bool restinio::http_field_parsers::impl::is_alpha (const char ch) noexcept
 Is a character an ALPHA? More...
 
RESTINIO_NODISCARD constexpr bool restinio::http_field_parsers::impl::is_vchar (const char ch) noexcept
 Is a character a VCHAR? More...
 
RESTINIO_NODISCARD constexpr bool restinio::http_field_parsers::impl::is_obs_text (const char ch) noexcept
 Is a character an obs_text? More...
 
RESTINIO_NODISCARD constexpr bool restinio::http_field_parsers::impl::is_qdtext (const char ch) noexcept
 Is a character a qdtext? More...
 
RESTINIO_NODISCARD constexpr bool restinio::http_field_parsers::impl::is_ctext (const char ch) noexcept
 Is a character a ctext? More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::alpha_symbol_p ()
 A factory for producer of ALPHA symbols. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::alphanum_symbol_p ()
 A factory for producer of symbol that an ALPHA or DIGIT. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::vchar_symbol_p ()
 A factory for producer of VCHAR symbols. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::ctext_symbol_p ()
 A factory for producer of ctext symbols. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::comment_p ()
 A factory for producer of comment token. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::ows_p () noexcept
 A factory function to create an ows_producer. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::ows () noexcept
 A factory function to create an OWS clause. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::token_symbol_p () noexcept
 A factory for producer of symbols than can be used in tokens. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::token_p () noexcept
 A factory function to create a token_producer. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::quoted_string_p () noexcept
 A factory function to create a quoted_string_producer. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::quoted_pair_p () noexcept
 A factory function to create a quoted_pair_producer. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::expected_token_p (string_view_t token)
 A factory function to create a producer that expect a token with specific value. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::expected_caseless_token_p (string_view_t token)
 A factory function to create a producer that expect a token with specific value. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::qvalue_p () noexcept
 A factory function to create a qvalue_producer. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::weight_p () noexcept
 A factory function to create a producer for weight parameter. More...
 
template<typename Container , typename Element_Producer >
RESTINIO_NODISCARD auto restinio::http_field_parsers::non_empty_comma_separated_list_p (Element_Producer element)
 A factory for a producer that handles non-empty list of comma-separated values. More...
 
template<typename Container , typename Element_Producer >
RESTINIO_NODISCARD auto restinio::http_field_parsers::maybe_empty_comma_separated_list_p (Element_Producer element)
 A factory for a producer that handles possibly empty list of comma-separated values. More...
 
RESTINIO_NODISCARD expected_t< string_view_t, not_found_t > restinio::http_field_parsers::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. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::impl::params_with_value_producer_details::make_parser ()
 Helper function that creates an instance of producer of parameter_with_mandatory_value_container. More...
 
RESTINIO_NODISCARD impl::params_with_value_producer_t restinio::http_field_parsers::params_with_value_p ()
 A factory of producer of parameter_with_mandatory_value_container. More...
 
RESTINIO_NODISCARD expected_t< restinio::optional_t< string_view_t >, not_found_t > restinio::http_field_parsers::find_first (const parameter_with_optional_value_container_t &where, string_view_t what)
 A helper function to find the first occurence of a parameter with the specified value. More...
 
RESTINIO_NODISCARD auto restinio::http_field_parsers::impl::params_with_opt_value_producer_details::make_parser ()
 Helper function that creates an instance of producer of parameter_with_optional_value_container. More...
 
RESTINIO_NODISCARD impl::params_with_opt_value_producer_t restinio::http_field_parsers::params_with_opt_value_p ()
 A factory of producer of parameter_with_optional_value_container. More...
 

Variables

constexpr underlying_uint_t restinio::http_field_parsers::qvalue_details::maximum = 1000u
 The maximal allowed value for a qvalue. More...
 
constexpr underlying_uint_t restinio::http_field_parsers::qvalue_details::zero = 0u
 The minimal allowed value for a qvalue. More...
 

Detailed Description

Utilities for parsing values of http-fields.

Since
v.0.6.1

Definition in file basics.hpp.