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. More... | |
Public Member Functions | |
source_t (string_view_t data) noexcept | |
Initializing constructor. More... | |
RESTINIO_NODISCARD character_t | getch () noexcept |
Get the next character from the input stream. More... | |
void | putback () noexcept |
Return one character back to the input stream. More... | |
RESTINIO_NODISCARD position_t | current_position () const noexcept |
Get the current position in the stream. More... | |
void | backto (position_t pos) noexcept |
Return the current position in the input stream at the specified position. More... | |
RESTINIO_NODISCARD bool | eof () const noexcept |
Is EOF has been reached? More... | |
RESTINIO_NODISCARD 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. More... | |
Private Attributes | |
const string_view_t | m_data |
The content to be used as "input stream". More... | |
string_view_t::size_type | m_index {} |
The current position in the input stream. More... | |
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 739 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 753 of file easy_parser.hpp.
|
inlineexplicitnoexcept |
Initializing constructor.
Definition at line 756 of file easy_parser.hpp.
|
inlinenoexcept |
Return the current position in the input stream at the specified position.
Definition at line 794 of file easy_parser.hpp.
|
inlinenoexcept |
Get the current position in the stream.
Definition at line 786 of file easy_parser.hpp.
|
inlinenoexcept |
Is EOF has been reached?
Definition at line 803 of file easy_parser.hpp.
|
inlinenoexcept |
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 816 of file easy_parser.hpp.
|
inlinenoexcept |
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 765 of file easy_parser.hpp.
|
inlinenoexcept |
Return one character back to the input stream.
Definition at line 777 of file easy_parser.hpp.
|
private |
The content to be used as "input stream".
Definition at line 742 of file easy_parser.hpp.
|
private |
The current position in the input stream.
Definition at line 749 of file easy_parser.hpp.