RESTinio
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
restinio::easy_parser::impl::source_t::content_consumer_t Class Reference

A helper class to automatically return acquired content back to the input stream. More...

#include <easy_parser.hpp>

Public Member Functions

 content_consumer_t ()=delete
 
 content_consumer_t (const content_consumer_t &)=delete
 
 content_consumer_t (content_consumer_t &&)=delete
 
 content_consumer_t (source_t &from) noexcept
 
 ~content_consumer_t () noexcept
 
position_t started_at () const noexcept
 
void commit () noexcept
 Consume all acquired content.
 

Private Attributes

source_tm_from
 
const position_t m_started_at
 
bool m_consumed { false }
 

Detailed Description

A helper class to automatically return acquired content back to the input stream.

Usage example:

for(auto ch = from.getch(); some_condition(ch); ch = from.getch())
{
... // do something with ch.
}
// All acquired content should be consumed.
// Otherwise all acquired content will be returned back to the input stream.
...
}
A helper class to automatically return acquired content back to the input stream.
void commit() noexcept
Consume all acquired content.
The class that implements "input stream".
@ consumer
Entity is a consumer of values. It requires a value on the input and doesn't produces anything.
expected_t< typename Producer::result_type, parse_error_t > try_parse(string_view_t from, Producer producer)
Perform the parsing of the specified content by using specified value producer.
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
nonstd::expected< T, E > expected_t
Definition expected.hpp:18
Since
v.0.6.1

Definition at line 851 of file easy_parser.hpp.

Constructor & Destructor Documentation

◆ content_consumer_t() [1/4]

restinio::easy_parser::impl::source_t::content_consumer_t::content_consumer_t ( )
delete

◆ content_consumer_t() [2/4]

restinio::easy_parser::impl::source_t::content_consumer_t::content_consumer_t ( const content_consumer_t & )
delete

◆ content_consumer_t() [3/4]

restinio::easy_parser::impl::source_t::content_consumer_t::content_consumer_t ( content_consumer_t && )
delete

◆ content_consumer_t() [4/4]

restinio::easy_parser::impl::source_t::content_consumer_t::content_consumer_t ( source_t & from)
inlinenoexcept

Definition at line 862 of file easy_parser.hpp.

◆ ~content_consumer_t()

restinio::easy_parser::impl::source_t::content_consumer_t::~content_consumer_t ( )
inlinenoexcept

Definition at line 867 of file easy_parser.hpp.

Member Function Documentation

◆ commit()

void restinio::easy_parser::impl::source_t::content_consumer_t::commit ( )
inlinenoexcept

Consume all acquired content.

Note
If that method is not called then all acquired content will be returned back.

Definition at line 886 of file easy_parser.hpp.

◆ started_at()

position_t restinio::easy_parser::impl::source_t::content_consumer_t::started_at ( ) const
inlinenoexcept

Definition at line 874 of file easy_parser.hpp.

Member Data Documentation

◆ m_consumed

bool restinio::easy_parser::impl::source_t::content_consumer_t::m_consumed { false }
private

Definition at line 855 of file easy_parser.hpp.

◆ m_from

source_t& restinio::easy_parser::impl::source_t::content_consumer_t::m_from
private

Definition at line 853 of file easy_parser.hpp.

◆ m_started_at

const position_t restinio::easy_parser::impl::source_t::content_consumer_t::m_started_at
private

Definition at line 854 of file easy_parser.hpp.


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