restinio::easy_parser::result_value_wrapper< T > Struct Template Reference

A template with specializations for different kind of result values and for type `nothing`. More...

`#include <easy_parser.hpp>`

## Public Types

using | result_type = T
using | wrapped_type = result_type

## Static Public Member Functions

static void | as_result (wrapped_type &to, result_type &&what)
static RESTINIO_NODISCARD result_type && | unwrap_value (wrapped_type &v)

## Detailed Description

template<typename T>
struct restinio::easy_parser::result_value_wrapper< T >

A template with specializations for different kind of result values and for type `nothing`.

Every specialization for a case when T is not a container should have the following content:

struct result_value_wrapper<...>
{
using result_type = ... // type of the result value.
using wrapped_type = ... // type to be created inside a producer
// to hold a temporary value during the parsing.
static void
as_result( wrapped_type & to, result_type && what );
RESTINIO_NODISCARD static result_type &&
unwrap_value( wrapped_type & from );
};
RESTINIO_NODISCARD
#define RESTINIO_NODISCARD
Definition: compiler_features.hpp:33
restinio::easy_parser::result_value_wrapper::as_result
static void as_result(wrapped_type &to, result_type &&what)
Definition: easy_parser.hpp:185
restinio::easy_parser::result_value_wrapper::unwrap_value
static RESTINIO_NODISCARD result_type && unwrap_value(wrapped_type &v)
Definition: easy_parser.hpp:192
restinio::easy_parser::result_value_wrapper::result_type
T result_type
Definition: easy_parser.hpp:181
restinio::easy_parser::result_value_wrapper::wrapped_type
result_type wrapped_type
Definition: easy_parser.hpp:182

Every specialization for a case when T is a container should have the following content:

struct result_value_wrapper<...>
{
using result_type = ... // type of the result value.
using value_type = ... // type of object to be placed into a container
// if result_type is a container.
using wrapped_type = ... // type to be created inside a producer
// to hold a temporary value during the parsing.
static void
as_result( wrapped_type & to, result_type && what );
static void
to_container( wrapped_type & to, value_type && item );
RESTINIO_NODISCARD static result_type &&
unwrap_value( wrapped_type & from );
};
restinio::easy_parser::to_container
RESTINIO_NODISCARD auto to_container()
A factory function to create a to_container_consumer.
Definition: easy_parser.hpp:4583

Since
  v.0.6.6

Definition at line 179 of file easy_parser.hpp.

## Member Typedef Documentation

## result_type

template<typename T >

using restinio::easy_parser::result_value_wrapper< T >::result_type = T

Definition at line 181 of file easy_parser.hpp.

## wrapped_type

template<typename T >

using restinio::easy_parser::result_value_wrapper< T >::wrapped_type = result_type

Definition at line 182 of file easy_parser.hpp.

## Member Function Documentation

## as_result()

template<typename T >

static void restinio::easy_parser::result_value_wrapper< T >::as_result | ( | wrapped_type & | to,
|  | result_type && | what
| ) |  |

inline static

Definition at line 185 of file easy_parser.hpp.

## unwrap_value()

template<typename T >

static RESTINIO_NODISCARD result_type && restinio::easy_parser::result_value_wrapper< T >::unwrap_value | ( | wrapped_type & | v | ) |

inline static

Definition at line 192 of file easy_parser.hpp.

The documentation for this struct was generated from the following file:

- restinio/helpers/easy_parser.hpp