37 #ifndef Foam_StringStream_H 38 #define Foam_StringStream_H 124 virtual void reset(
const std::string&
s)
146 #ifdef Foam_IOstream_extras 157 const std::string&
s,
239 stream_.rdbuf()->pubseekpos(0, std::ios_base::out);
247 #ifdef Foam_IOstream_extras void reset()
Reset the output buffer and rewind the stream.
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...
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.
Istream & operator()() const
Return a non-const reference to const Istream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
A simple container for options an IOstream can normally have.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
virtual void rewind()
Rewind the output stream.
Foam::string str() const
Get the string. As Foam::string instead of std::string (may change in future)
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
virtual void reset(const std::string &s)
Reset the input buffer and rewind the stream.
std::istringstream stream_
The std::stream.
OStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
virtual const fileName & name() const override
The name of the input serial stream. (eg, the name of the Fstream file name)
Foam::string str() const
Get the string. As Foam::string instead of std::string (may change in future)
virtual void print(Ostream &os) const override
Print stream description to Ostream.
std::streamsize count()
The number of bytes outputted.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Generic input stream using a standard (STL) stream.
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
IStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
virtual void print(Ostream &os) const override
Print stream description to Ostream.
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))
A class for handling character strings derived from std::string.
OSstream(const OSstream &)=default
Copy construct.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
streamFormat format() const noexcept
Get the current stream format.