41 #ifndef Foam_ICharStream_H 42 #define Foam_ICharStream_H 69 virtual public std::ios,
74 typedef std::istream stream_type;
92 reset(buffer, nbytes);
104 template<
int SizeMin>
145 auto view() const -> decltype(buffer_type::
view())
152 std::string
str()
const 164 buffer_type::pubseekpos(0, std::ios_base::in);
169 void reset(
const char* buffer,
size_t nbytes)
183 template<
int SizeMin>
237 const std::string& buffer,
259 template<
int SizeMin>
307 void reset(
const char* buffer,
size_t nbytes)
314 void swap(List<char>& other)
321 template<
int SizeMin>
337 virtual void rewind()
override std::streamsize remaining() const
The number of characters remaining in the get area. Same as (capacity() - input_pos()) ...
DynamicList< char > release()
Reset stream and return contents as a List.
label size() const
The input list size. Same as capacity()
DynamicList< char > release()
Reset buffer and return contents.
A wrapper to hold a std::stream type for OpenFOAM wrapped streams. This is necessary since the OpenFO...
auto str() const -> decltype(stream_.str())
For IStringStream compatibility, return the buffer as string copy.
UList< char > list() const
Span of the input characters (is modifiable!)
virtual void rewind() override
Rewind the stream, clearing any old errors.
void rewind()
Rewind the stream, clearing any old errors.
std::streamsize span_capacity() const
The get buffer capacity.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void syncState()
Set stream state to match that of the std::istream.
Similar to std::istringstream, but with the ability to swap character content. Has some similarity to...
A simple container for options an IOstream can normally have.
std::streamsize capacity() const
The get buffer capacity.
auto view() const -> decltype(stream_.view())
A string_view (c++17) or span view (older c++) of buffer contents.
void debug_info(Ostream &os) const
Some information about the input buffer position/capacity.
UList< char > list() const
Span of the input characters (is modifiable!)
std::streampos tellg() const
Position of the get buffer.
void reset(const char *buffer, size_t nbytes)
Reset stream content (copy), reset positions.
void swap(List< char > &other)
Exchange buffer content and parameter contents, reset positions.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
std::streampos input_pos() const
The current get position within the buffer (tellg)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Foam::icharstream stream_
The std::stream.
void reset(const char *buffer, size_t nbytes)
Reset content (copy)
void swap(List< char > &other)
Exchange stream content and parameter contents, reset positions.
An OSstream with internal List storage.
std::streamsize span_remaining() const
The number of characters remaining in the get area.
ICharStream(IOstreamOption streamOpt=IOstreamOption())
Default construct (empty), optionally with specified stream option.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
std::streamsize capacity() const
The get buffer capacity.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
icharstream()
Default construct - empty.
OBJstream os(runTime.globalPath()/outputName)
std::streamsize remaining() const
The number of characters remaining in the get area. Same as (capacity() - input_pos()) ...
void swap(List< char > &other)
Exchange stream content and parameter contents, reset positions.
void reset(const char *s, std::streamsize n)
Reset content (copy)
Generic input stream using a standard (STL) stream.
An ISstream with internal List storage. Always UNCOMPRESSED.
versionNumber version() const noexcept
Get the stream version.
Istream & operator()() const
A non-const reference to const Istream.
std::streamsize size_bytes() const
The span size (number of input characters)
stdFoam::span< const char > view() const
DynamicList< char > release()
Reset stream and return contents as a List.
An output streambuf for memory access.
std::streampos input_pos() const
The current get position within the buffer (tellg)
std::string str() const
For istringstream compatibility, return the buffer as string copy.
streamFormat format() const noexcept
Get the current stream format.
char * data_bytes() const
The span data (start of input characters)
auto view() const -> decltype(buffer_type::view())
A string_view (c++17) or span view (older c++) of buffer contents.
std::streamsize span_tellg() const
The current buffer get position.
virtual void print(Ostream &os) const override
Print stream description to Ostream.