34#ifndef OScountStream_H
35#define 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)
77 else if (way == std::ios_base::end)
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,
169 std::streamsize
size()
const
177 this->pubseekpos(0, std::ios_base::out);
228 std::streamsize
size()
const
292 #ifdef Foam_IOstream_extras
An stream/stream-buffer allocator for counting.
void printBufInfo(Ostream &os) const
std::streamsize size() const
The number of bytes counted.
OCountStreamAllocator(std::streamsize precount=0)
Default construct, or with precount size.
void rewind()
Rewind the stream, reset the count.
countstreambuf buf_
The stream buffer.
stream_type stream_
The 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.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary)
static const versionNumber currentVersion
The current version number (2.0)
void setGood() noexcept
Set stream state to be good.
An output stream for calculating byte counts.
OCountStream(IOstreamOption streamOpt=IOstreamOption())
Default construct.
virtual void print(Ostream &os) const
Print stream description to Ostream.
OCountStream(const OCountStream &str)
Copy construct.
virtual void rewind()
Rewind the stream, reset the count, clearing any old errors.
Generic output stream using a standard (STL) stream.
virtual const fileName & name() const
Get the name of the stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A streambuf class for determining byte counts.
void printBufInfo(Ostream &os) const
Some information about the number of bytes counted.
std::streamsize tellp() const
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 int overflow(int c=EOF)
Handle output counting via overflow.
countstreambuf(std::streamsize precount=0)
Default construct, or with precount size.
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.
virtual std::streamsize xsputn(const char *s, std::streamsize n)
Put sequence of characters.
Trivial output stream for calculating byte counts.
std::streamsize size() const
ocountstream()
Default construct.
void rewind()
Rewind the stream, reset the count.
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))
dimensionedScalar pos(const dimensionedScalar &ds)