RESTinio
|
The class that implements "input stream". More...
#include <easy_parser.hpp>
Classes | |
class | content_consumer_t |
A helper class to automatically return acquired content back to the input stream. More... |
Public Types | |
using | position_t = string_view_t::size_type |
Type to be used as the index inside the input stream. |
Public Member Functions | |
source_t (string_view_t data) noexcept | |
Initializing constructor. | |
character_t | getch () noexcept |
Get the next character from the input stream. | |
void | putback () noexcept |
Return one character back to the input stream. | |
position_t | current_position () const noexcept |
Get the current position in the stream. | |
void | backto (position_t pos) noexcept |
Return the current position in the input stream at the specified position. | |
bool | eof () const noexcept |
Is EOF has been reached? | |
string_view_t | fragment (string_view_t::size_type from, string_view_t::size_type length=string_view_t::npos) const noexcept |
Return a fragment from the input stream. |
Private Attributes | |
const string_view_t | m_data |
The content to be used as "input stream". | |
string_view_t::size_type | m_index {} |
The current position in the input stream. |
The class that implements "input stream".
It is expected that string_view passed to the constructor of source_t will outlive the instance of source_t.
Definition at line 740 of file easy_parser.hpp.
using restinio::easy_parser::impl::source_t::position_t = string_view_t::size_type |
Type to be used as the index inside the input stream.
Definition at line 754 of file easy_parser.hpp.
|
inlineexplicitnoexcept |
Initializing constructor.
Definition at line 757 of file easy_parser.hpp.
|
inlinenoexcept |
Return the current position in the input stream at the specified position.
Definition at line 795 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
Get the current position in the stream.
Definition at line 787 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
Is EOF has been reached?
Definition at line 804 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
Return a fragment from the input stream.
from | Starting position for the fragment required. |
length | Length of the fragment required. Value string_view_t::npos means the whole remaining content of the input stream starting from position from. |
Definition at line 817 of file easy_parser.hpp.
|
inlinenodiscardnoexcept |
Get the next character from the input stream.
EOF can be returned in the case if there is no more data in the input stream.
Definition at line 766 of file easy_parser.hpp.
|
inlinenoexcept |
Return one character back to the input stream.
Definition at line 778 of file easy_parser.hpp.
|
private |
The content to be used as "input stream".
Definition at line 743 of file easy_parser.hpp.
|
private |
The current position in the input stream.
Definition at line 750 of file easy_parser.hpp.