53constexpr char tab =
'\t';
54constexpr char nl =
'\n';
140 const std::string& str,
141 const bool quoted=
true
163 std::streamsize count
175 virtual void indent() = 0;
184 unsigned short indentSize(
unsigned short val)
noexcept
198 unsigned short indentLevel(
unsigned short val)
noexcept
258 if (value1 != value2)
270 virtual void flush() = 0;
273 virtual void endl() = 0;
276 virtual char fill()
const = 0;
279 virtual char fill(
const char fillch) = 0;
282 virtual int width()
const = 0;
285 virtual int width(
const int w) = 0;
301 return const_cast<Ostream&
>(*this);
Representation of a major/minor version number.
The IOstreamOption is a simple container for options an IOstream can normally have.
streamFormat
Data format (ascii | binary)
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
@ UNCOMPRESSED
compression = false
static const versionNumber currentVersion
The current version number (2.0)
An IOstream is an abstract base class for all input/output systems; be they streams,...
virtual void endl()
Add newline and flush stream.
virtual void indent()
Add indentation characters.
virtual void flush()
Flush stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static constexpr const unsigned short entryIndentation_
Indentation of the entry from the start of the keyword.
virtual Ostream & endBlock()
Write end block group.
virtual char fill(const char fillch)=0
Set padding character for formatted field up to field width.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream(IOstreamOption streamOpt=IOstreamOption())
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.
unsigned short indentSize_
Number of spaces per indent level.
virtual Ostream & write(const doubleScalar val)=0
Write doubleScalar.
virtual char fill() const =0
Get padding character.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)=0
Write std::string surrounded by quotes.
virtual void flush()=0
Flush stream.
unsigned short & indentSize() noexcept
Access to indent size.
virtual Ostream & write(const char c)=0
Write character.
virtual bool endRawWrite()=0
Emit end marker for low-level raw binary output.
virtual void indent()=0
Add indentation characters.
Ostream(const Ostream &)=default
Copy construct.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
virtual int precision() const =0
Get precision of output field.
Ostream(IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
Construct with format, version (compression)
virtual Ostream & beginBlock()
Write begin block group without a name.
virtual void endl()=0
Add newline and flush stream.
virtual Ostream & writeRaw(const char *data, std::streamsize count)=0
Low-level raw binary output.
virtual bool beginRawWrite(std::streamsize count)=0
Emit begin marker for low-level raw binary output.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual Ostream & write(const int64_t val)=0
Write int64_t.
unsigned short & indentLevel() noexcept
Access to indent level.
virtual int width() const =0
Get width of output field.
Ostream & operator()() const
Return a non-const reference to const Ostream.
virtual int width(const int w)=0
Set width of output field (and return old width)
unsigned short indentLevel(unsigned short val) noexcept
Change the indent level, return old value.
virtual Ostream & write(const word &str)=0
Write word.
virtual Ostream & write(const int32_t val)=0
Write int32_t.
unsigned short indentLevel() const noexcept
Return the indent level.
virtual ~Ostream()=default
Destructor.
unsigned short indentSize(unsigned short val) noexcept
Change indent size (spaces per level), return old value.
unsigned short indentSize() const noexcept
Return indent size (spaces per level)
virtual Ostream & write(const char *str)=0
Write character string.
void decrIndent()
Decrement the indent level.
virtual int precision(const int p)=0
Set precision of output field (and return old precision)
virtual Ostream & write(const floatScalar val)=0
Write floatScalar.
void incrIndent() noexcept
Increment the indent level.
virtual Ostream & write(const char *data, std::streamsize count)=0
Write binary block.
virtual Ostream & write(const string &str)=0
Write string.
unsigned short indentLevel_
Current indent level.
virtual Ostream & endEntry()
Write end entry (';') followed by newline.
Database for solution data, solver performance and other reduced data.
A class for handling keywords in dictionaries.
A token holds an item read from Istream.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
Ostream & beginBlock(Ostream &os)
Write begin block group without a name.
double doubleScalar
A typedef for double.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream & indent(Ostream &os)
Indent stream.
float floatScalar
A typedef for float.
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Ostream &(* OstreamManip)(Ostream &)
An Ostream manipulator.
Ostream & flush(Ostream &os)
Flush stream.
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)
Ostream & endBlock(Ostream &os)
Write end block group.