Go to the documentation of this file.
20 #ifndef __iOstream_hpp__
21 #define __iOstream_hpp__
39 #define Red_Text(text) redColor<<text<<defaultColor
40 #define Yellow_Text(text) yellowColor<<text<<defaultColor
41 #define Blue_Text(text) blueColor<<text<<defaultColor
42 #define Green_Text(text) greenColor<<text<<defaultColor
43 #define Magenta_Text(text) magentaColor<<text<<defaultColor
44 #define Cyan_Text(text) cyanColor<<text<<defaultColor
45 #define Bold_Text(text) boldChar<<text<<defaultColor
118 const bool quoted=
true
154 virtual void seek(
size_t pos) = 0;
158 virtual void indent() = 0;
255 virtual void flush() = 0;
258 virtual void endl() = 0;
261 virtual char fill()
const = 0;
264 virtual char fill(
const char fillch) = 0;
267 virtual int width()
const = 0;
270 virtual int width(
const int w) = 0;
286 return const_cast<iOstream&
>(*this);
382 return os.
write(buf);
393 return os.
write(val);
398 return os.
write(val);
404 return os.
write(val);
409 return os.
write(val);
414 return os.
write(val);
419 return os.
write(val);
424 return os.
write(val);
430 return os.
write(val);
435 return os.
write(val);
439 constexpr
char tab =
'\t';
440 constexpr
char nl =
'\n';
virtual ~iOstream()=default
Destructor.
virtual iOstream & beginBlock(const word &kw)
Write begin block group with a name Increments indentation, adds newline.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
iOstream & endBlock(iOstream &os)
Write end block group.
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
virtual int precision() const =0
Get precision of output field.
virtual void endl()=0
Add newline and flush stream.
virtual iOstream & endBlock()
Write end block group Decrements indentation, adds newline.
virtual iOstream & newLine()
Write a newLine to stream.
iOstream & endEntry(iOstream &os)
Write end entry (';') followed by newline.
virtual void seek(size_t pos)=0
virtual void indent()=0
Add indentation characters.
virtual int width() const =0
Get width of output field.
iOstream & decrIndent(iOstream &os)
Decrement the indent level.
unsigned short & indentSize()
Access to indent size.
unsigned short indentLevel() const
Return indent level.
iOstream & flush(iOstream &os)
Flush stream.
iOstream & endl(iOstream &os)
Add newline and flush stream.
iOstream & operator()() const
Return a non-const reference to const iOstream Needed for write functions where the stream argument i...
iOstream & indent(iOstream &os)
Indent stream.
virtual void startOfBinaryStreaming()=0
Add a new line and flush stream.
unsigned short indentSize() const
Return indent level.
IOstream &(* IOstreamManip)(IOstream &)
An IOstream manipulator.
virtual void endOfBinaryStreaming()=0
Reach end of file add a new line and flush stream.
unsigned short & indentLevel()
Access to indent level.
void incrIndent()
Increment the indent level.
void decrIndent()
Decrement the indent level.
iOstream & incrIndent(iOstream &os)
Increment the indent level.
const char * defaultColor
char constants to alter output format and color
virtual void flush()=0
Flush stream.
virtual iOstream & beginSquare()
Write begin list "[".
virtual iOstream & endEntry()
Write end entry (';') followed by newline.
auto count(const Vector< T, Allocator > &vec, const T &val)
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
virtual iOstream & writeQuoted(const word &str, const bool quoted=true)=0
Write std::string surrounded by quotes.
iOstream(writeFormat wF)
Construct from writeFormat.
virtual iOstream & endSquare()
Write end list "]".
const char * magentaColor
unsigned short indentSize_
Number of spaces per indent level.
unsigned long long int uint64
virtual iOstream & endList()
Write end list ")".
iOstream & beginBlock(iOstream &os)
Write begin block group without a name.
virtual iOstream & beginList()
Write begin list "(".
virtual iOstream & writeBinaryBlockFlag()
Write the flag to indicate the start of a binary block.
static constexpr const unsigned short entryIndentation_
Indentation of the entry from the start of the keyword.
virtual char fill() const =0
Get padding character.
virtual iOstream & space(int32 n=1)
Write space to stream.
A base calss for input/output streams.
Interface class for any output stream.
virtual iOstream & writeWordKeyword(const word &kw)
Write the keyword followed by an appropriate indentation.
iOstream & writeWordEntry(const word &key, const T &value)
Write a keyword/value entry.
virtual iOstream & beginBlock()
Write begin block group without a name Increments indentation, adds newline.
iOstream &(* iOstreamManip)(iOstream &)
An iOstream manipulator.
unsigned short indentLevel_
Current indent level.