57template<
class StreamType>
94 void str(
const std::string&
s)
132 const std::string&
s,
184 #ifdef Foam_IOstream_extras
199 const std::string&
s,
204 IStringStream(
s, IOstreamOption(fmt, ver))
277 #ifdef Foam_IOstream_extras
Allocator for variants of a std stringstream.
StreamType stream_type
The stream type.
StringStreamAllocator()=default
Default construct.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
StringStreamAllocator(const std::string &s)
Copy construct from string.
void str(const std::string &s)
Set the string.
stream_type stream_
The input/output stream.
Representation of a major/minor version number.
The IOstreamOption is 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
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary)
static const versionNumber currentVersion
The current version number (2.0)
Generic input stream using a standard (STL) stream.
virtual const fileName & name() const
Return the name of the stream.
virtual void rewind()
Rewind the stream so that it may be read again.
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.
virtual void reset(const std::string &s)
Reset the input buffer and rewind the stream.
virtual void print(Ostream &os) const
Print stream description to Ostream.
IStringStream(const char *s, IOstreamOption streamOpt=IOstreamOption())
Construct from char*.
IStringStream(const IStringStream &str)
Copy construct, copies content and format.
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
Get the name of the stream.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
OStringStream(const OStringStream &str)
Copy construct, copies content and format.
virtual void print(Ostream &os) const
Print stream description to Ostream.
OStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
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,...
sha1buf * rdbuf()
This hides both signatures of std::basic_ios::rdbuf()
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))