RESTinio
Public Types | Static Public Member Functions | List of all members
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
};
#define RESTINIO_NODISCARD
static void as_result(wrapped_type &to, result_type &&what)
static RESTINIO_NODISCARD result_type && unwrap_value(wrapped_type &v)

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
static void
to_container( wrapped_type & to, value_type && item );
};
RESTINIO_NODISCARD auto to_container()
A factory function to create a to_container_consumer.
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 
)
inlinestatic

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)
inlinestatic

Definition at line 192 of file easy_parser.hpp.


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