39 #ifndef Foam_Ostream_H 40 #define Foam_Ostream_H 53 constexpr
char tab =
'\t';
54 constexpr
char nl =
'\n';
139 const std::string& str,
140 const bool quoted=
true 162 std::streamsize
count 174 virtual void indent() = 0;
257 if (value1 != value2)
269 virtual void flush() = 0;
272 virtual void endl() = 0;
275 virtual char fill()
const = 0;
278 virtual char fill(
const char fillch) = 0;
281 virtual int width()
const = 0;
284 virtual int width(
const int w) = 0;
300 return const_cast<Ostream&
>(*this);
325 typedef Ostream& (*OstreamManip)(Ostream&);
364 inline Ostream&
flush(Ostream&
os)
372 inline Ostream&
endl(Ostream&
os)
A class for handling keywords in dictionaries.
unsigned short indentLevel_
Current indent level.
Ostream & indent(Ostream &os)
Indent stream.
virtual void flush()=0
Flush stream.
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
virtual Ostream & writeRaw(const char *data, std::streamsize count)=0
Low-level raw binary output.
constexpr char nl
The newline '\n' character (0x0a)
virtual Ostream & beginBlock()
Write begin block group without a name.
A token holds an item read from Istream.
virtual void endl()
Add newline and flush stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ostream &(* OstreamManip)(Ostream &)
An Ostream manipulator.
virtual bool endRawWrite()=0
Emit end marker for low-level raw binary output.
virtual void indent()
Add indentation characters.
constexpr char tab
The tab '\t' character(0x09)
Ostream & operator()() const
Return a non-const reference to const Ostream.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
Ostream & endEntry(Ostream &os)
Write end entry (';') followed by newline.
A simple container for options an IOstream can normally have.
void decrIndent()
Decrement the indent level.
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 class for handling words, derived from Foam::string.
virtual void flush()
Flush stream.
virtual Ostream & endBlock()
Write end block group.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
virtual ~Ostream()=default
Destructor.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
virtual void endl()=0
Add newline and flush stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual int width() const =0
Get width of output field.
Ostream(IOstreamOption streamOpt=IOstreamOption())
Default construct (ASCII, uncompressed), construct with specified stream option.
virtual bool beginRawWrite(std::streamsize count)=0
Emit begin marker for low-level raw binary output.
OBJstream os(runTime.globalPath()/outputName)
Database for solution data, solver performance and other reduced data.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual char fill() const =0
Get padding character.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
An IOstream is an abstract base class for all input/output systems; be they streams, files, token lists etc.
Ostream & flush(Ostream &os)
Flush stream.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
const dimensionedScalar c
Speed of light in a vacuum.
Ostream & endBlock(Ostream &os)
Write end block group.
streamFormat
Data format (ascii | binary)
unsigned short indentSize() const noexcept
Return indent size (spaces per level)
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
virtual Ostream & writeQuoted(const std::string &str, const bool quoted=true)=0
Write std::string surrounded by quotes.
unsigned short indentLevel() const noexcept
Return the indent level.
Ostream & beginBlock(Ostream &os)
Write begin block group without a name.
unsigned short indentSize_
Number of spaces per indent level.
virtual Ostream & endEntry()
Write end entry (';') followed by newline.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Ostream(const Ostream &)=default
Copy construct.
static constexpr const unsigned short entryIndentation_
Indentation of the entry from the start of the keyword.
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
virtual void indent()=0
Add indentation characters.
void incrIndent() noexcept
Increment the indent level.
virtual int precision() const =0
Get precision of output field.
virtual Ostream & writeKeyword(const keyType &kw)
Write the keyword followed by an appropriate indentation.