41 #ifndef Foam_OTstream_H 42 #define Foam_OTstream_H 117 virtual bool write(
const token& tok)
override;
127 const bool quoted=
true 138 virtual Ostream&
write(
const std::string& str)
override;
156 std::streamsize
count 163 std::streamsize
count 178 virtual void indent()
override 186 virtual std::ios_base::fmtflags
flags()
const override 188 return std::ios_base::fmtflags(0);
193 std::ios_base::fmtflags
flags(std::ios_base::fmtflags)
override 195 return std::ios_base::fmtflags(0);
199 virtual void flush()
override 203 virtual void endl()
override 208 virtual char fill()
const override 214 virtual char fill(
const char)
override 227 virtual int width(
const int)
override 240 virtual int precision(
const int)
override 267 #ifdef Foam_IOstream_extras virtual void indent() override
Add indentation characters.
virtual std::ios_base::fmtflags flags() const override
Return current stream flags. Dummy for token stream, returns 0.
void reset() noexcept
Rewind the output stream to position 0 (non-virtual!) and adjust the stream status (open/good/eof ...
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.
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 to position 0 and adjust the stream status (open/good/eof ...
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.