www.cemf.ir
oTstream Class Reference
+ Inheritance diagram for oTstream:
+ Collaboration diagram for oTstream:

Public Member Functions

 oTstream (const word &nm)
 
 oTstream (const oTstream &src)
 
 oTstream (oTstream &&)=default
 
virtual ~oTstream ()=default
 
const tokenListtokens () const
 
tokenListtokens ()
 
virtual bool write (const token &tok)
 Write Functions. More...
 
virtual iOstreamwrite (const char c)
 Write character. More...
 
virtual iOstreamwrite (const char *str)
 Write character string. More...
 
virtual iOstreamwrite (const word &str)
 Write word. More...
 
virtual iOstreamwriteQuoted (const std::string &str, const bool quoted=true)
 Write std::string surrounded by quotes. More...
 
virtual iOstreamwrite (const int64 val) override
 Write int64. More...
 
virtual iOstreamwrite (const int32 val) override
 Write int32. More...
 
virtual iOstreamwrite (const label val) override
 Write label. More...
 
virtual iOstreamwrite (const uint32 val) override
 Write uint32. More...
 
virtual iOstreamwrite (const uint16 val) override
 Write uint16. More...
 
virtual iOstreamwrite (const float val) override
 Write float. More...
 
virtual iOstreamwrite (const double val) override
 Write double. More...
 
iOstreamwrite (const char *binaryData, std::streamsize count) override
 Write a block of binray data. More...
 
virtual void append (const token &tok)
 
virtual void append (const tokenList &tLisk)
 
void reset ()
 
virtual void rewind ()
 
virtual void indent ()
 Add indentation characters. More...
 
virtual void flush ()
 Flush stream. More...
 
virtual void endl ()
 Add newline and flush stream. More...
 
virtual char fill () const
 Get padding character. More...
 
virtual char fill (const char)
 Set padding character for formatted field up to field width. More...
 
virtual int width () const
 Get width of output field. More...
 
virtual int width (const int)
 Set width of output field (and return old width) More...
 
virtual int precision () const
 Get precision of output field. More...
 
virtual int precision (const int)
 Set precision of output field (and return old precision) More...
 
virtual ios_base::fmtflags flags () const
 Return flags of stream. More...
 
ios_base::fmtflags flags (const ios_base::fmtflags)
 Set flags of stream. More...
 
- Public Member Functions inherited from iOstream
 iOstream ()
 Default. More...
 
 iOstream (writeFormat wF)
 Construct from writeFormat. More...
 
 iOstream (const iOstream &)=default
 Copy construct. More...
 
virtual ~iOstream ()=default
 Destructor. More...
 
unsigned short indentSize () const
 Return indent level. More...
 
unsigned short & indentSize ()
 Access to indent size. More...
 
unsigned short indentLevel () const
 Return indent level. More...
 
unsigned short & indentLevel ()
 Access to indent level. More...
 
void incrIndent ()
 Increment the indent level. More...
 
void decrIndent ()
 Decrement the indent level. More...
 
virtual iOstreambeginBlock (const word &kw)
 Write begin block group with a name Increments indentation, adds newline. More...
 
virtual iOstreambeginBlock ()
 Write begin block group without a name Increments indentation, adds newline. More...
 
virtual iOstreamendBlock ()
 Write end block group Decrements indentation, adds newline. More...
 
virtual iOstreambeginList ()
 Write begin list "(". More...
 
virtual iOstreambeginList (const word &kw)
 Write begin list with keyword "kw (". More...
 
virtual iOstreamendList ()
 Write end list ")". More...
 
virtual iOstreambeginSquare ()
 Write begin list "[". More...
 
virtual iOstreambeginSquare (const word &kw)
 Write begin list with keyword "kw [". More...
 
virtual iOstreamendSquare ()
 Write end list "]". More...
 
virtual iOstreamendEntry ()
 Write end entry (';') followed by newline. More...
 
virtual iOstreamnewLine ()
 Write a newLine to stream. More...
 
virtual iOstreamspace (int32 n=1)
 Write space to stream. More...
 
virtual iOstreamwriteWordKeyword (const word &kw)
 Write the keyword followed by an appropriate indentation. More...
 
template<class T >
iOstreamwriteWordEntry (const word &key, const T &value)
 Write a keyword/value entry. More...
 
iOstreamoperator() () const
 Return a non-const reference to const iOstream Needed for write functions where the stream argument is temporary: e.g. More...
 
- Public Member Functions inherited from IOstream
 IOstream ()
 Default. More...
 
 IOstream (writeFormat wF)
 Construct and set write format. More...
 
 IOstream (const IOstream &)=default
 Copy. More...
 
virtual ~IOstream ()=default
 Destructor. More...
 
virtual const wordname () const
 Return the name of the stream. More...
 
virtual wordname ()
 Return non-const access to the name of the stream. More...
 
virtual bool check (const char *operation) const
 Check IOstream status for given operation. More...
 
bool fatalCheck (const char *operation) const
 Check IOstream status for given operation. More...
 
bool opened () const
 Return true if stream has been opened. More...
 
bool closed () const
 Return true if stream is closed. More...
 
bool isBinary () const
 Return true if stream format is binray. More...
 
bool good () const
 Return true if next operation might succeed. More...
 
bool eof () const
 Return true if end of input seen. More...
 
bool fail () const
 Return true if next operation will fail. More...
 
bool bad () const
 Return true if stream is corrupted. More...
 
 operator bool () const
 Return true if the stream has not failed. More...
 
bool operator! () const
 Return true if the stream has failed. More...
 
int32 lineNumber () const
 Const access to the current stream line number. More...
 
int32lineNumber ()
 Non-const access to the current stream line number. More...
 
int32 lineNumber (const int32 num)
 Set the stream line number return the previous value. More...
 
void setEof ()
 Set stream to have reached eof. More...
 
void setFail ()
 Set stream to have failed. More...
 
void setBad ()
 Set stream to be bad. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f)
 Set flags of stream. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f, const ios_base::fmtflags mask)
 Set flags of given field of stream. More...
 
void unsetf (const ios_base::fmtflags f)
 Unset flags of stream. More...
 

Protected Attributes

word name_
 
tokenList tokenList_
 
- Protected Attributes inherited from iOstream
unsigned short indentSize_ = 4
 Number of spaces per indent level. More...
 
unsigned short indentLevel_ = 0
 Current indent level. More...
 
- Protected Attributes inherited from IOstream
streamAccess openClosed_
 Is stream open or closed. More...
 
writeFormat writeFormat_ = ASCII
 write format More...
 
ios_base::iostate ioState_
 state More...
 
int32 lineNumber_
 The file line. More...
 

Additional Inherited Members

- Public Types inherited from IOstream
enum  streamAccess : char { CLOSED = 0, OPENED }
 
enum  writeFormat : char { ASCII = 0, BINARY }
 
- Static Public Member Functions inherited from IOstream
static unsigned int defaultPrecision ()
 Return the default precision. More...
 
static unsigned int defaultPrecision (unsigned int prec)
 Reset the default precision return the previous value. More...
 
- Static Public Attributes inherited from IOstream
static unsigned int precision_ = 6
 Default precision, only works for ASCII. More...
 
- Protected Member Functions inherited from IOstream
void setOpened ()
 Set stream opened. More...
 
void setClosed ()
 Set stream closed. More...
 
void setState (ios_base::iostate state)
 Set stream state. More...
 
void setWriteFormat (writeFormat wF)
 
void setGood ()
 Set stream to be good. More...
 
- Static Protected Attributes inherited from iOstream
static constexpr const unsigned short entryIndentation_ = 16
 Indentation of the entry from the start of the keyword. More...
 
- Static Protected Attributes inherited from IOstream
static word staticName_
 Name for any generic stream - normally treat as readonly. More...
 

Detailed Description

Definition at line 23 of file oTstream.hpp.

Constructor & Destructor Documentation

◆ oTstream() [1/3]

oTstream ( const word nm)

Definition at line 6 of file oTstream.cpp.

◆ oTstream() [2/3]

oTstream ( const oTstream src)

Definition at line 19 of file oTstream.cpp.

◆ oTstream() [3/3]

oTstream ( oTstream &&  )
default

◆ ~oTstream()

virtual ~oTstream ( )
virtualdefault

Member Function Documentation

◆ tokens() [1/2]

pFlow::tokenList & tokens ( ) const

Definition at line 32 of file oTstream.cpp.

References oTstream::tokenList_.

Referenced by dataEntry::dataEntry().

+ Here is the caller graph for this function:

◆ tokens() [2/2]

tokenList& tokens ( )

◆ write() [1/12]

bool write ( const token tok)
virtual

Write Functions.

Write token to stream or otherwise handle it. return false if the token type was not handled by this method

Implements iOstream.

Definition at line 44 of file oTstream.cpp.

References token::good().

+ Here is the call graph for this function:

◆ write() [2/12]

pFlow::iOstream & write ( const char  c)
virtual

Write character.

Implements iOstream.

Definition at line 56 of file oTstream.cpp.

◆ write() [3/12]

pFlow::iOstream & write ( const char *  str)
virtual

Write character string.

Implements iOstream.

Definition at line 68 of file oTstream.cpp.

◆ write() [4/12]

pFlow::iOstream & write ( const word str)
virtual

Write word.

Implements iOstream.

Definition at line 77 of file oTstream.cpp.

◆ writeQuoted()

pFlow::iOstream & writeQuoted ( const std::string &  str,
const bool  quoted = true 
)
virtual

Write std::string surrounded by quotes.

Optional write without quotes.

Implements iOstream.

Definition at line 86 of file oTstream.cpp.

◆ write() [5/12]

pFlow::iOstream & write ( const int64  val)
overridevirtual

Write int64.

Implements iOstream.

Definition at line 97 of file oTstream.cpp.

◆ write() [6/12]

pFlow::iOstream & write ( const int32  val)
overridevirtual

Write int32.

Implements iOstream.

Definition at line 104 of file oTstream.cpp.

◆ write() [7/12]

pFlow::iOstream & write ( const label  val)
overridevirtual

Write label.

Implements iOstream.

Definition at line 114 of file oTstream.cpp.

◆ write() [8/12]

pFlow::iOstream & write ( const uint32  val)
overridevirtual

Write uint32.

Implements iOstream.

Definition at line 121 of file oTstream.cpp.

◆ write() [9/12]

pFlow::iOstream & write ( const uint16  val)
overridevirtual

Write uint16.

Implements iOstream.

Definition at line 128 of file oTstream.cpp.

◆ write() [10/12]

pFlow::iOstream & write ( const float  val)
overridevirtual

Write float.

Implements iOstream.

Definition at line 136 of file oTstream.cpp.

◆ write() [11/12]

pFlow::iOstream & write ( const double  val)
overridevirtual

Write double.

Implements iOstream.

Definition at line 144 of file oTstream.cpp.

◆ write() [12/12]

pFlow::iOstream & write ( const char *  binaryData,
std::streamsize  count 
)
overridevirtual

Write a block of binray data.

Implements iOstream.

Definition at line 152 of file oTstream.cpp.

References notImplementedFunction.

◆ append() [1/2]

void append ( const token tok)
virtual

Definition at line 162 of file oTstream.cpp.

References pFlow::validTokenForStream().

+ Here is the call graph for this function:

◆ append() [2/2]

void append ( const tokenList tLisk)
virtual

Definition at line 169 of file oTstream.cpp.

◆ reset()

void reset ( )

Definition at line 177 of file oTstream.cpp.

◆ rewind()

void rewind ( )
virtual

Definition at line 183 of file oTstream.cpp.

◆ indent()

virtual void indent ( )
inlinevirtual

Add indentation characters.

Implements iOstream.

Definition at line 127 of file oTstream.hpp.

◆ flush()

virtual void flush ( )
inlinevirtual

Flush stream.

Implements iOstream.

Definition at line 131 of file oTstream.hpp.

◆ endl()

virtual void endl ( )
inlinevirtual

Add newline and flush stream.

Implements iOstream.

Definition at line 135 of file oTstream.hpp.

◆ fill() [1/2]

virtual char fill ( ) const
inlinevirtual

Get padding character.

Implements iOstream.

Definition at line 140 of file oTstream.hpp.

◆ fill() [2/2]

virtual char fill ( const char  fillch)
inlinevirtual

Set padding character for formatted field up to field width.

Implements iOstream.

Definition at line 146 of file oTstream.hpp.

◆ width() [1/2]

virtual int width ( ) const
inlinevirtual

Get width of output field.

Implements iOstream.

Definition at line 152 of file oTstream.hpp.

◆ width() [2/2]

virtual int width ( const int  w)
inlinevirtual

Set width of output field (and return old width)

Implements iOstream.

Definition at line 159 of file oTstream.hpp.

◆ precision() [1/2]

virtual int precision ( ) const
inlinevirtual

Get precision of output field.

Implements iOstream.

Definition at line 165 of file oTstream.hpp.

◆ precision() [2/2]

virtual int precision ( const int  p)
inlinevirtual

Set precision of output field (and return old precision)

Implements iOstream.

Definition at line 172 of file oTstream.hpp.

◆ flags() [1/2]

virtual ios_base::fmtflags flags ( ) const
inlinevirtual

Return flags of stream.

Implements IOstream.

Definition at line 178 of file oTstream.hpp.

◆ flags() [2/2]

ios_base::fmtflags flags ( const ios_base::fmtflags  f)
inlinevirtual

Set flags of stream.

Implements IOstream.

Definition at line 184 of file oTstream.hpp.

Member Data Documentation

◆ name_

word name_
protected

Definition at line 31 of file oTstream.hpp.

◆ tokenList_

tokenList tokenList_
protected

Definition at line 34 of file oTstream.hpp.

Referenced by oTstream::tokens().


The documentation for this class was generated from the following files: