82 #ifndef Foam_OSpanStream_H 83 #define Foam_OSpanStream_H 109 virtual public std::ios,
114 typedef std::ostream stream_type;
144 std::streamsize
count()
const 166 auto view() const -> decltype(buffer_type::
view())
173 std::string
str()
const 185 buffer_type::pubseekpos(0, std::ios_base::out);
190 void reset(
char* buffer,
size_t nbytes)
199 s.resize(
s.capacity());
275 template<
int SizeMin>
322 void reset(
char* buffer,
size_t nbytes)
329 void reset(std::string&
s)
label size() const
The current output size. Same as count(), output_pos(), tellp().
auto str() const -> decltype(stream_.str())
For OStringStream compatibility, return buffer as string copy.
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.
void syncState()
Set stream state to match that of the std::ostream.
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content...
std::streampos output_pos() const
The current output position within the buffer (tellp)
std::streamsize capacity() const
The put buffer capacity.
A simple container for options an IOstream can normally have.
char * data_bytes() const
The span data (start of output characters)
std::string str() const
For ostringstream compatibility, return the buffer as string copy.
void rewind()
Rewind the stream, clearing any old errors.
virtual void rewind()
Rewind the stream, clearing any old errors.
label capacity() const noexcept
Size of the underlying storage.
std::streamsize capacity() const
The put buffer capacity.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
void reset(char *buffer, size_t nbytes)
Reset the put buffer area.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Foam::ospanstream stream_
The std::stream.
UList< char > list() const
Span of the current output characters (is modifiable!)
std::streampos tellp() const
Position of the put buffer.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists...
void debug_info(Ostream &os) const
Some information about the output buffer position/capacity.
void reset(char *buffer, size_t nbytes)
Reset the put area.
OBJstream os(runTime.globalPath()/outputName)
std::streamsize span_tellp() const
The current buffer put position.
void resetp(char *s, std::streamsize n)
Reset put buffer with character data (can be nullptr) and count.
std::streamsize count() const
The number of bytes outputted.
UList< char > list() const
Span of the current output characters (is modifiable!)
std::streampos output_pos() const
The current output position within the buffer (tellp)
auto view() const -> decltype(buffer_type::view())
A string_view (c++17) or span view (older c++) of buffer contents.
OSpanStream(IOstreamOption streamOpt=IOstreamOption())
Default construct (empty output)
versionNumber version() const noexcept
Get the stream version.
stdFoam::span< const char > view() const
std::streamsize size_bytes() const
The span size (size of output buffer)
An output streambuf for memory access.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Similar to std::ostringstream, but with an externally managed output buffer which makes it most simil...
Similar to OStringStream but using an externally managed buffer for its output.
streamFormat format() const noexcept
Get the current stream format.
virtual void print(Ostream &os) const override
Print stream description to Ostream.
std::streamsize count() const
The number of bytes outputted.
ospanstream()
Default construct - empty.
auto view() const -> decltype(stream_.view())
A string_view (c++17) or span view (older c++) of buffer contents.