37 #ifndef Foam_StringStream_H 38 #define Foam_StringStream_H 57 template<
class StreamType>
94 void str(
const std::string&
s)
132 const std::string&
s,
154 allocator_type(
str.
str()),
162 virtual void reset(
const std::string&
s)
184 #ifdef Foam_IOstream_extras 195 const std::string&
s,
223 public Detail::StringStreamAllocator<std::ostringstream>,
226 typedef Detail::StringStreamAllocator<std::ostringstream> allocator_type;
245 allocator_type(
str.
str()),
263 stream_.rdbuf()->pubseekpos(0, std::ios_base::out);
271 #ifdef Foam_IOstream_extras virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
void reset()
Reset the output buffer and rewind the stream.
virtual const fileName & name() const
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 rather than std::string.
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 void rewind()
Rewind the output stream.
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.
virtual void print(Ostream &os) const
Print stream description to Ostream.
Allocator for variants of a std stringstream.
StreamType stream_type
The stream type.
OStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual void print(Ostream &os) const
Print stream description to Ostream.
stream_type stream_
The input/output stream.
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.
virtual void rewind()
Rewind the stream so that it may be read again.
streamFormat
Data format (ascii | binary)
IStringStream(IOstreamOption streamOpt=IOstreamOption())
Default construct or with specified stream option.
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.
Ostream(const Ostream &)=default
Copy construct.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
streamFormat format() const noexcept
Get the current stream format.
StringStreamAllocator()=default
Default construct.