Similar to std::istringstream, but with the ability to swap character content. Has some similarity to std::ispanstream (C++23) More...
Public Member Functions | |
icharstream () | |
Default construct - empty. More... | |
icharstream (const char *buffer, size_t nbytes) | |
Copy construct from content. More... | |
icharstream (List< char > &&buffer) | |
Move construct from List. More... | |
template<int SizeMin> | |
icharstream (DynamicList< char, SizeMin > &&buffer) | |
Move construct from DynamicList. More... | |
std::streampos | input_pos () const |
The current get position within the buffer (tellg) More... | |
std::streamsize | capacity () const |
The get buffer capacity. More... | |
std::streamsize | remaining () const |
The number of characters remaining in the get area. Same as (capacity() - input_pos()) More... | |
UList< char > | list () const |
Span of the input characters (is modifiable!) More... | |
auto | view () const -> decltype(buffer_type::view()) |
A string_view (c++17) or span view (older c++) of buffer contents. More... | |
std::string | str () const |
For istringstream compatibility, return the buffer as string copy. More... | |
void | rewind () |
Rewind the stream, clearing any old errors. More... | |
void | reset (const char *buffer, size_t nbytes) |
Reset stream content (copy), reset positions. More... | |
void | swap (List< char > &other) |
Exchange stream content and parameter contents, reset positions. More... | |
template<int SizeMin> | |
void | swap (DynamicList< char, SizeMin > &other) |
Exchange stream content and parameter contents, reset positions. More... | |
DynamicList< char > | release () |
Reset stream and return contents as a List. More... | |
void | debug_info (Ostream &os) const |
Some information about the input buffer position/capacity. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from memorybuf::in_dynamic | |
in_dynamic ()=default | |
Default construct - empty. More... | |
in_dynamic (const char *s, std::streamsize n) | |
Copy construct from content. More... | |
in_dynamic (::Foam::List< char > &&buffer) | |
Move construct from List. More... | |
template<int SizeMin> | |
in_dynamic (::Foam::DynamicList< char, SizeMin > &&buffer) | |
Move construct from DynamicList (added length only) More... | |
void | sync_gbuffer () |
Sync get buffer pointers to agree with list dimensions. More... | |
void | reset (const char *s, std::streamsize n) |
Reset content (copy) More... | |
void | swap (List< char > &other) |
Exchange buffer content and parameter contents, reset positions. More... | |
template<int SizeMin> | |
void | swap (DynamicList< char, SizeMin > &other) |
Exchange buffer content and parameter contents, reset positions. More... | |
DynamicList< char > | release () |
Reset buffer and return contents. More... | |
Protected Member Functions inherited from memorybuf::in_base | |
virtual std::streamsize | xsgetn (char *s, std::streamsize n) |
Get sequence of characters from a fixed region. More... | |
in_base ()=default | |
Default construct. More... | |
in_base (char *s, std::streamsize n) | |
Construct for character array (can be nullptr) and number of bytes. More... | |
void | resetg (char *s, std::streamsize n) |
Reset get buffer with character data (can be nullptr) and count. More... | |
std::streamsize | span_tellg () const |
The current buffer get position. More... | |
std::streamsize | span_capacity () const |
The get buffer capacity. More... | |
std::streamsize | span_remaining () const |
The number of characters remaining in the get area. More... | |
char * | data_bytes () const |
The span data (start of input characters) More... | |
std::streamsize | size_bytes () const |
The span size (number of input characters) More... | |
stdFoam::span< const char > | view () const |
void | info (Ostream &os) const |
Some information about the input buffer position/capacity. More... | |
Protected Member Functions inherited from memorybuf | |
virtual std::streampos | seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) |
Set position pointer to relative position. More... | |
virtual std::streampos | seekpos (std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) |
Set position pointer to absolute position. More... | |
Similar to std::istringstream, but with the ability to swap character content. Has some similarity to std::ispanstream (C++23)
Definition at line 62 of file ICharStream.H.
|
inline |
Default construct - empty.
Definition at line 78 of file ICharStream.H.
|
inline |
Copy construct from content.
Definition at line 87 of file ICharStream.H.
References icharstream::reset().
|
inline |
Move construct from List.
Definition at line 97 of file ICharStream.H.
References icharstream::swap().
|
inline |
Move construct from DynamicList.
Definition at line 108 of file ICharStream.H.
References icharstream::swap().
|
inline |
The current get position within the buffer (tellg)
Definition at line 121 of file ICharStream.H.
References memorybuf::in_base::span_tellg().
Referenced by icharstream::debug_info(), ICharStream::input_pos(), and ICharStream::tellg().
|
inline |
The get buffer capacity.
Definition at line 129 of file ICharStream.H.
References memorybuf::in_base::span_capacity().
Referenced by ICharStream::capacity(), icharstream::debug_info(), and ICharStream::size().
|
inline |
The number of characters remaining in the get area. Same as (capacity() - input_pos())
Definition at line 138 of file ICharStream.H.
References memorybuf::in_base::span_remaining().
Referenced by ICharStream::remaining().
|
inline |
Span of the input characters (is modifiable!)
Definition at line 146 of file ICharStream.H.
References memorybuf::in_base::data_bytes(), and memorybuf::in_base::size_bytes().
Referenced by ICharStream::list().
|
inline |
A string_view (c++17) or span view (older c++) of buffer contents.
Definition at line 158 of file ICharStream.H.
References memorybuf::in_base::view().
Referenced by ICharStream::view().
|
inline |
For istringstream compatibility, return the buffer as string copy.
Use sparingly - it creates a full copy!!
Definition at line 168 of file ICharStream.H.
References memorybuf::in_base::data_bytes(), and memorybuf::in_base::size_bytes().
Referenced by ICharStream::str().
|
inline |
Rewind the stream, clearing any old errors.
Definition at line 180 of file ICharStream.H.
References clear().
Referenced by ICharStream::rewind().
|
inline |
Reset stream content (copy), reset positions.
Definition at line 189 of file ICharStream.H.
References clear(), and memorybuf::in_dynamic::reset().
Referenced by icharstream::icharstream(), ICharStream::ICharStream(), and ICharStream::reset().
|
inline |
Exchange stream content and parameter contents, reset positions.
Definition at line 198 of file ICharStream.H.
References clear(), and memorybuf::in_dynamic::swap().
Referenced by icharstream::icharstream(), ICharStream::ICharStream(), and ICharStream::swap().
|
inline |
Exchange stream content and parameter contents, reset positions.
Definition at line 208 of file ICharStream.H.
References clear(), and memorybuf::in_dynamic::swap().
|
inline |
Reset stream and return contents as a List.
Definition at line 217 of file ICharStream.H.
References clear(), and memorybuf::in_dynamic::release().
Referenced by ICharStream::release().
|
inline |
Some information about the input buffer position/capacity.
Definition at line 227 of file ICharStream.H.
References icharstream::capacity(), icharstream::input_pos(), and os().