34 #ifndef Foam_OScountStream_H 35 #define Foam_OScountStream_H 55 std::streamsize size_;
63 std::ios_base::seekdir way,
64 std::ios_base::openmode which = std::ios_base::in|std::ios_base::out
67 if (which & std::ios_base::out)
69 if (way == std::ios_base::beg)
73 else if (way == std::ios_base::cur)
94 std::ios_base::openmode which = std::ios_base::in|std::ios_base::out
97 return seekoff(
pos, std::ios_base::beg, which);
113 virtual std::streamsize
xsputn(
const char*
s, std::streamsize
n)
129 std::streamsize
tellp()
const 137 os <<
"count=" << size_;
151 virtual public std::ios,
161 std::ostream(static_cast<countstreambuf*>(
this))
169 std::streamsize
size()
const 177 this->pubseekpos(0, std::ios_base::out);
191 class OCountStreamAllocator
228 std::streamsize
size()
const 273 allocator_type(str.
size()),
292 #ifdef Foam_IOstream_extras virtual std::streampos seekpos(std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
Set position pointer to absolute position.
virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
Generic output stream using a standard (STL) stream.
An output stream for calculating byte counts.
virtual int overflow(int c=EOF)
Handle output counting via overflow.
virtual void print(Ostream &os) const
Print stream description to Ostream.
An stream/stream-buffer allocator for counting.
Trivial output stream for calculating byte counts.
virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
Set position pointer to relative position.
countstreambuf buf_
The stream buffer.
countstreambuf(std::streamsize precount=0)
Default construct, or with precount size.
OCountStream(IOstreamOption streamOpt=IOstreamOption())
Default construct.
A simple container for options an IOstream can normally have.
virtual void rewind()
Rewind the stream, reset the count, clearing any old errors.
A streambuf class for determining byte counts.
void rewind()
Rewind the stream, reset the count.
virtual std::streamsize xsputn(const char *s, std::streamsize n)
Put sequence of characters.
stream_type stream_
The output stream.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
dimensionedScalar pos(const dimensionedScalar &ds)
OCountStreamAllocator(std::streamsize precount=0)
Default construct, or with precount size.
std::streamsize tellp() const
std::streamsize size() const
The number of bytes counted.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
std::streamsize size() const
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
OBJstream os(runTime.globalPath()/outputName)
void printBufInfo(Ostream &os) const
ocountstream()
Default construct.
const dimensionedScalar c
Speed of light in a vacuum.
versionNumber version() const noexcept
Get the stream version.
void printBufInfo(Ostream &os) const
Some information about the number of bytes counted.
streamFormat
Data format (ascii | binary)
void setGood() noexcept
Set stream state to be good.
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))
streamFormat format() const noexcept
Get the current stream format.
void rewind()
Rewind the stream, reset the count.