34#ifndef Foam_StringStream_H
35#define Foam_StringStream_H
121 virtual void reset(
const std::string&
s)
130 os <<
"istringstream : buffer =\n" << this->
str() <<
'\n';
148 #ifdef Foam_IOstream_extras
159 const std::string&
s,
187 public Foam::Detail::StreamAllocator<std::ostringstream>,
188 public Foam::OSstream
191 Foam::Detail::StreamAllocator<std::ostringstream>
238 stream_.rdbuf()->pubseekpos(0, std::ios_base::out);
244 os <<
"ostringstream : buffer =\n" << this->
str() <<
'\n';
251 #ifdef Foam_IOstream_extras
A wrapper to hold a std::stream type for OpenFOAM wrapped streams. This is necessary since the OpenFO...
std::istringstream stream_
A simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary | coherent).
virtual void print(Ostream &os) const
Print stream description to Ostream.
Generic input stream using a standard (STL) stream.
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name).
virtual void rewind() override
Rewind the stream so that it may be read again.
ISstream(std::istream &is, const string &streamName, IOstreamOption streamOpt=IOstreamOption())
Construct wrapper around std::istream, set stream status.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
Istream & operator()() const
Return a non-const reference to const Istream.
IStringStream(const std::string &s, IOstreamOption streamOpt=IOstreamOption())
Construct from std::string.
Foam::string str() const
Get the string. As Foam::string instead of std::string (may change in future).
virtual void reset(const std::string &s)
Reset the input buffer and rewind the stream.
void str(const std::string &s)
Set the string.
IStringStream(const char *s, IOstreamOption streamOpt=IOstreamOption())
Construct from char*.
IStringStream(const IStringStream &str)
Copy construct, copies content and format.
virtual void print(Ostream &os) const override
Print stream description.
IStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Generic output stream using a standard (STL) stream.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name).
OSstream(const OSstream &)=default
Copy construct.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Foam::string str() const
Get the string. As Foam::string instead of std::string (may change in future).
void str(const std::string &s)
Set the string.
OStringStream(const OStringStream &str)
Copy construct, copies content and format.
OStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
virtual void print(Ostream &os) const override
Print stream description.
void reset()
Reset the output buffer and rewind the stream.
virtual void rewind()
Rewind the output stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A class for handling character strings derived from std::string.
OBJstream os(runTime.globalPath()/outputName)
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))
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.