Go to the documentation of this file.
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)
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
std::streamsize tellp() const
OCountStreamAllocator(std::streamsize precount=0)
Default construct, or with precount size.
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))
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
streamFormat format() const noexcept
Get the current stream format.
static const versionNumber currentVersion
The current version number (2.0)
virtual void print(Ostream &os) const
Print stream description to Ostream.
A streambuf class for determining byte counts.
void setGood() noexcept
Set stream state to be good.
stream_type stream_
The output stream.
void printBufInfo(Ostream &os) const
Some information about the number of bytes counted.
Representation of a major/minor version number.
ocountstream()
Default construct.
virtual const fileName & name() const
Get the name of the stream.
OSstream(const OSstream &)=default
Copy construct.
The IOstreamOption is a simple container for options an IOstream can normally have.
Generic output stream using a standard (STL) stream.
versionNumber version() const noexcept
Get the stream version.
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.
streamFormat
Data format (ascii | binary)
OBJstream os(runTime.globalPath()/outputName)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
virtual int overflow(int c=EOF)
Handle output counting via overflow.
An output stream for calculating byte counts.
countstreambuf(std::streamsize precount=0)
Default construct, or with precount size.
void printBufInfo(Ostream &os) const
Trivial output stream for calculating byte counts.
std::streamsize size() const
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 void rewind()
Rewind the stream, reset the count, clearing any old errors.
OCountStream(const OCountStream &str)
Copy construct.
std::streamsize size() const
The number of bytes counted.
void rewind()
Rewind the stream, reset the count.
virtual std::streamsize xsputn(const char *s, std::streamsize n)
Put sequence of characters.
OCountStream(IOstreamOption streamOpt=IOstreamOption())
Default construct.
const dimensionedScalar c
Speed of light in a vacuum.
void rewind()
Rewind the stream, reset the count.
An stream/stream-buffer allocator for counting.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
countstreambuf buf_
The stream buffer.
dimensionedScalar pos(const dimensionedScalar &ds)