44 #ifndef Foam_OCharStream_H 45 #define Foam_OCharStream_H 71 virtual public std::ios,
76 typedef std::ostream stream_type;
122 void reserve(
const std::streamsize
n)
130 buffer_type::pubseekpos(0, std::ios_base::out);
145 auto view() const -> decltype(buffer_type::
view())
152 std::string
str()
const 169 template<
int SizeMin>
200 class OCharStreamAllocator
259 template<
int SizeMin>
313 template<
int SizeMin>
314 void swap(DynamicList<char,SizeMin>& other)
Generic output stream using a standard (STL) stream.
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 tellp(), output_pos()
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...
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...
Foam::ocharstream stream_
The stream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
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.
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.
An allocator for holding Foam::ocharstream.
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.
OCharStreamAllocator()=default
Default construct - empty.
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.