44 #ifndef Foam_OCharStream_H 45 #define Foam_OCharStream_H 71 virtual public std::ios,
76 typedef std::ostream stream_type;
116 std::streamsize
count()
const 128 void reserve(
const std::streamsize
n)
136 buffer_type::pubseekpos(0, std::ios_base::out);
151 auto view() const -> decltype(buffer_type::
view())
158 std::string
str()
const 175 template<
int SizeMin>
240 template<
int SizeMin>
290 void swap(List<char>& other)
297 template<
int SizeMin>
Generic output stream using a standard (STL) stream.
A wrapper to hold a std::stream type for OpenFOAM wrapped streams. This is necessary since the OpenFO...
std::streamsize span_capacity() const
The put buffer capacity.
auto str() const -> decltype(stream_.str())
For OStringStream compatibility, return the buffer as string copy.
label size() const
The current output size. Same as count(), output_pos(), tellp().
OCharStream(IOstreamOption streamOpt=IOstreamOption())
Default construct (empty output)
void rewind()
Rewind the stream, clearing any old errors.
UList< char > list() const
Span of the current output characters (is modifiable!)
void syncState()
Set stream state to match that of the std::ostream.
ocharstream()
Default construct - empty.
Similar to std::ostringstream, but with the ability to swap character content. Has some similarity to...
std::streamsize count() const
The number of bytes outputted.
A simple container for options an IOstream can normally have.
char * data_bytes() const
The span data (start of output characters)
void debug_info(Ostream &os) const
Some information about the output buffer position/capacity.
std::streamsize capacity() const
The put buffer capacity.
auto view() const -> decltype(stream_.view())
A string_view (c++17) or span view (older c++) of buffer contents.
UList< char > list() const
Span of the current output characters (is modifiable!)
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Foam::ocharstream stream_
The std::stream.
std::streampos output_pos() const
The current output position within the buffer (tellp)
void swap(List< char > &other)
Exchange stream content and parameter contents, reset positions.
std::streamsize count() const
The number of bytes outputted.
An OSstream with internal List storage.
void reserve(const std::streamsize n)
Reserve output space for at least this amount.
An output streambuf for memory access.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void swap(List< char > &other)
Exchange buffer content and parameter contents, reset positions.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
std::streamsize capacity() const
The put buffer capacity.
OBJstream os(runTime.globalPath()/outputName)
void reserve(const std::streamsize len)
Increment capacity (if needed) and adjust buffer pointers.
void setBlockSize(int n)
Block size was used in OpenFOAM-v2306 and earlier.
DynamicList< char > release()
Reset buffer and return contents as a DynamicList. The list size corresponds to the region of output...
void reserve(const std::streamsize n)
Reserve output space for at least this amount.
virtual void rewind()
Rewind the stream, clearing any old errors.
std::streamsize span_tellp() const
The current buffer put position.
void swap(List< char > &other)
Exchange stream content and parameter contents, reset positions.
std::streampos tellp() const
Position of the put buffer.
versionNumber version() const noexcept
Get the stream version.
stdFoam::span< const char > view() const
DynamicList< char > release()
Reset buffer and return contents.
std::streamsize size_bytes() const
The span size (size of output buffer)
std::string str() const
For ostringstream compatibility, return the buffer as string copy.
streamFormat format() const noexcept
Get the current stream format.
auto view() const -> decltype(buffer_type::view())
A string_view (c++17) or span view (older c++) of buffer contents.
std::streampos output_pos() const
The current output position within the buffer (tellp)
virtual void print(Ostream &os) const override
Print stream description to Ostream.
DynamicList< char > release()
Reset buffer and return contents.