Go to the documentation of this file.
37 #ifndef StringStream_H
38 #define StringStream_H
57 template<
class StreamType>
98 void str(
const std::string&
s)
233 stream_.rdbuf()->pubseekpos(0, std::ios_base::out);
OStringStream(const OStringStream &str)
Construct as copy of content.
virtual void print(Ostream &os) const
Print description to Ostream.
void str(const std::string &s)
Set the string.
ISstream(std::istream &is, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Construct as wrapper around std::istream.
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))
IStringStream(const IStringStream &str)
Construct as copy of content.
virtual void rewind()
Rewind the output stream.
virtual void print(Ostream &os) const
Print description to Ostream.
streamFormat format() const noexcept
Get the current stream format.
static const versionNumber currentVersion
The current version number.
Generic input stream using standard (STL) streams.
StreamType stream_type
The stream type.
A class for handling character strings derived from std::string.
virtual void rewind()
Rewind the stream so that it may be read again.
StringStreamAllocator()
Construct null.
Allocator for variants of a std stringstream.
OStringStream(streamFormat format=ASCII, versionNumber version=currentVersion)
Construct and set stream status.
Representation of a major/minor version number.
OSstream(std::ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
Construct as wrapper around std::ostream and set stream status.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual const fileName & name() const
Return the name of the stream.
Istream & operator()() const
Return a non-const reference to const Istream.
StringStreamAllocator(const std::string &buffer)
Copy construct from string.
virtual void reset(const std::string &s)
Reset the input buffer and rewind the stream.
virtual const fileName & name() const
Return the name of the stream.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
Input from string buffer, using a ISstream.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
IStringStream(const Foam::string &buffer, streamFormat format=ASCII, versionNumber version=currentVersion, const Foam::string &name="input")
Construct from string.
Output to string buffer, using a OSstream.
void reset()
Reset the output buffer and rewind the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
stream_type stream_
The input/output stream.