Go to the documentation of this file.
37 #ifndef StringStream_H
38 #define StringStream_H
57 template<
class StreamType>
94 void str(
const std::string&
s)
132 const std::string&
s,
184 #ifdef Foam_IOstream_extras
199 const std::string&
s,
269 stream_.rdbuf()->pubseekpos(0, std::ios_base::out);
277 #ifdef Foam_IOstream_extras
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
Print stream description to Ostream.
void str(const std::string &s)
Set the string.
StringStreamAllocator()=default
Default construct.
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)
Copy construct, copies content and format.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
virtual void rewind()
Rewind the output stream.
virtual void print(Ostream &os) const
Print stream description to Ostream.
streamFormat format() const noexcept
Get the current stream format.
StringStreamAllocator(const std::string &s)
Copy construct from string.
static const versionNumber currentVersion
The current version number (2.0)
Generic input stream using a standard (STL) stream.
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.
Allocator for variants of a std stringstream.
Representation of a major/minor version number.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual const fileName & name() const
Get the name of the stream.
Istream & operator()() const
Return a non-const reference to const Istream.
OSstream(const OSstream &)=default
Copy construct.
The IOstreamOption is a simple container for options an IOstream can normally have.
IStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
Generic output stream using a standard (STL) stream.
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)
OBJstream os(runTime.globalPath()/outputName)
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.
Foam::string str() const
Get the string - as Foam::string rather than std::string.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
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.