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;
162 std::streamsize count
169 std::streamsize count
184 virtual void indent()
override
192 virtual std::ios_base::fmtflags
flags()
const override
194 return std::ios_base::fmtflags(0);
199 std::ios_base::fmtflags
flags(std::ios_base::fmtflags)
override
201 return std::ios_base::fmtflags(0);
205 virtual void flush()
override
209 virtual void endl()
override
214 virtual char fill()
const override
220 virtual char fill(
const char)
override
226 virtual int width()
const override
233 virtual int width(
const int)
override
246 virtual int precision(
const int)
override
273 #ifdef Foam_IOstream_extras
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
constexpr DynamicList() noexcept
A simple container for options an IOstream can normally have.
versionNumber version() const noexcept
Get the stream version.
constexpr IOstreamOption(streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
streamFormat format() const noexcept
Get the current stream format.
streamFormat
Data format (ascii | binary | coherent).
void setGood() noexcept
Set stream state to be good.
void setOpened() noexcept
Set stream opened.
A simple output token stream that can be used to build token lists. Always UNCOMPRESSED.
virtual int precision() const override
Get precision of output field.
virtual std::ios_base::fmtflags flags() const override
Return current stream flags. Dummy for token stream, returns 0.
OTstream(IOstreamOption streamOpt=IOstreamOption())
Default construct, set stream status.
virtual int width(const int) override
Set width of output field.
std::ios_base::fmtflags flags(std::ios_base::fmtflags) override
Set stream flags, return old stream flags. Dummy for token stream, returns 0.
virtual void indent() override
Add indentation characters.
void reset() noexcept
Rewind the output stream to position 0 (non-virtual!) and adjust the stream status (open/good/eof ....
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true) override
Write character/string content, with/without surrounding quotes.
void print(Ostream &os) const override
Print stream description to Ostream.
virtual bool endRawWrite() override
End marker for low-level raw binary output.
DynamicList< token > & tokens() noexcept
The tokens.
virtual int width() const override
Get width of output field.
OTstream(const OTstream &os)
Copy construct.
const DynamicList< token > & tokens() const noexcept
The tokens.
virtual Ostream & writeRaw(const char *data, std::streamsize count) override
Low-level raw binary output.
virtual bool beginRawWrite(std::streamsize count) override
Begin marker for low-level raw binary output.
virtual char fill() const override
Get the current padding character.
~OTstream()=default
Destructor.
virtual int precision(const int) override
Set precision of output field.
virtual char fill(const char) override
Set padding character for formatted field up to field width.
OTstream(OTstream &&os)
Move construct.
virtual void rewind()
Rewind the output stream to position 0 and adjust the stream status (open/good/eof ....
virtual void flush() override
Flush stream.
virtual void endl() override
Add newline and flush stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & writeQuoted(const char *str, std::streamsize len, const bool quoted=true)=0
Write character/string content, with/without surrounding quotes.
Ostream(const Ostream &)=default
Copy construct.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)