41 #ifndef Foam_OTstream_H 42 #define Foam_OTstream_H 123 virtual bool write(
const token& tok)
override;
133 const bool quoted=
true 144 virtual Ostream&
write(
const std::string& str)
override;
162 std::streamsize
count 169 std::streamsize
count 184 virtual void indent()
override 191 virtual ios_base::fmtflags
flags()
const override 193 return ios_base::fmtflags(0);
197 std::ios_base::fmtflags
flags(
const ios_base::fmtflags)
override 199 return ios_base::fmtflags(0);
203 virtual void flush()
override 207 virtual void endl()
override 212 virtual char fill()
const override 218 virtual char fill(
const char)
override 224 virtual int width()
const override 231 virtual int width(
const int)
override 244 virtual int precision(
const int)
override 271 #ifdef Foam_IOstream_extras virtual void indent() override
Add indentation characters.
virtual void flush() override
Flush stream.
~OTstream()=default
Destructor.
A token holds an item read from Istream.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
virtual bool beginRawWrite(std::streamsize count) override
Begin marker for low-level raw binary output.
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
A simple container for options an IOstream can normally have.
virtual int width() const override
Get width of output field.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true)=0
Write character/string content, with/without surrounding quotes.
const DynamicList< token > & tokens() const noexcept
The tokens.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from Foam::string.
virtual bool write(const token &tok) override
Write token to stream or otherwise handle it.
virtual Ostream & writeRaw(const char *data, std::streamsize count) override
Low-level raw binary output.
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
virtual void endl() override
Add newline and flush stream.
OTstream(IOstreamOption streamOpt=IOstreamOption())
Default construct, set stream status.
virtual bool endRawWrite() override
End marker for low-level raw binary output.
virtual char fill() const override
Get the current padding character.
virtual ios_base::fmtflags flags() const override
Get flags of output stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual void rewind()
Rewind the output stream.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
const dimensionedScalar c
Speed of light in a vacuum.
void print(Ostream &os) const override
Print stream description to Ostream.
versionNumber version() const noexcept
Get the stream version.
streamFormat
Data format (ascii | binary)
void setOpened() noexcept
Set stream opened.
void setGood() noexcept
Set stream state to be good.
streamFormat format() const noexcept
Get the current stream format.
virtual int precision() const override
Get precision of output field.
void reset()
Reset the output buffer and rewind the stream.