www.cemf.ir
iOstream Class Referenceabstract
+ Inheritance diagram for iOstream:
+ Collaboration diagram for iOstream:

Public Member Functions

 iOstream ()
 Default. More...
 
 iOstream (writeFormat wF)
 Construct from writeFormat. More...
 
 iOstream (const iOstream &)=default
 Copy construct. More...
 
virtual ~iOstream ()=default
 Destructor. More...
 
virtual bool write (const token &tok)=0
 Write Functions. More...
 
virtual iOstreamwrite (const char c)=0
 Write character. More...
 
virtual iOstreamwrite (const char *str)=0
 Write character string. More...
 
virtual iOstreamwrite (const word &str)=0
 Write word. More...
 
virtual iOstreamwriteQuoted (const word &str, const bool quoted=true)=0
 Write std::string surrounded by quotes. More...
 
virtual iOstreamwrite (const int64 val)=0
 Write int64. More...
 
virtual iOstreamwrite (const int32 val)=0
 Write int32. More...
 
virtual iOstreamwrite (const label val)=0
 Write label. More...
 
virtual iOstreamwrite (const uint32 val)=0
 Write uint32. More...
 
virtual iOstreamwrite (const uint16 val)=0
 Write uint16. More...
 
virtual iOstreamwrite (const float val)=0
 Write float. More...
 
virtual iOstreamwrite (const double val)=0
 Write double. More...
 
virtual iOstreamwrite (const char *binaryData, std::streamsize count)=0
 Write a block of binray data. More...
 
virtual void indent ()=0
 Add indentation characters. 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...
 
virtual void flush ()=0
 Flush stream. More...
 
virtual void endl ()=0
 Add newline and flush stream. More...
 
virtual char fill () const =0
 Get padding character. More...
 
virtual char fill (const char fillch)=0
 Set padding character for formatted field up to field width. More...
 
virtual int width () const =0
 Get width of output field. More...
 
virtual int width (const int w)=0
 Set width of output field (and return old width) More...
 
virtual int precision () const =0
 Get precision of output field. More...
 
virtual int precision (const int p)=0
 Set precision of output field (and return old precision) 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...
 
virtual ios_base::fmtflags flags () const =0
 Return flags of stream. 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...
 
virtual ios_base::fmtflags flags (const ios_base::fmtflags f)=0
 Set flags of stream. 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

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...
 

Static Protected Attributes

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...
 

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...
 

Detailed Description

Definition at line 53 of file iOstream.hpp.

Constructor & Destructor Documentation

◆ iOstream() [1/3]

iOstream ( )
inlineexplicit

Default.

Definition at line 77 of file iOstream.hpp.

◆ iOstream() [2/3]

iOstream ( writeFormat  wF)
inlineexplicit

Construct from writeFormat.

Definition at line 81 of file iOstream.hpp.

◆ iOstream() [3/3]

iOstream ( const iOstream )
default

Copy construct.

◆ ~iOstream()

virtual ~iOstream ( )
virtualdefault

Destructor.

Member Function Documentation

◆ write() [1/12]

virtual bool write ( const token tok)
pure virtual

Write Functions.

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

Implemented in Ostream, and oTstream.

Referenced by pFlow::operator<<(), dictionary::writeDictionary(), and Vector< word, vecAllocator< word > >::writeVector().

+ Here is the caller graph for this function:

◆ write() [2/12]

virtual iOstream& write ( const char  c)
pure virtual

Write character.

Implemented in Ostream, and oTstream.

◆ write() [3/12]

virtual iOstream& write ( const char *  str)
pure virtual

Write character string.

Implemented in Ostream, and oTstream.

◆ write() [4/12]

virtual iOstream& write ( const word str)
pure virtual

Write word.

Implemented in Ostream, and oTstream.

◆ writeQuoted()

virtual iOstream& writeQuoted ( const word str,
const bool  quoted = true 
)
pure virtual

Write std::string surrounded by quotes.

Optional write without quotes.

Implemented in Ostream, and oTstream.

◆ write() [5/12]

virtual iOstream& write ( const int64  val)
pure virtual

Write int64.

Implemented in Ostream, and oTstream.

◆ write() [6/12]

virtual iOstream& write ( const int32  val)
pure virtual

Write int32.

Implemented in Ostream, and oTstream.

◆ write() [7/12]

virtual iOstream& write ( const label  val)
pure virtual

Write label.

Implemented in Ostream, and oTstream.

◆ write() [8/12]

virtual iOstream& write ( const uint32  val)
pure virtual

Write uint32.

Implemented in Ostream, and oTstream.

◆ write() [9/12]

virtual iOstream& write ( const uint16  val)
pure virtual

Write uint16.

Implemented in Ostream, and oTstream.

◆ write() [10/12]

virtual iOstream& write ( const float  val)
pure virtual

Write float.

Implemented in Ostream, and oTstream.

◆ write() [11/12]

virtual iOstream& write ( const double  val)
pure virtual

Write double.

Implemented in Ostream, and oTstream.

◆ write() [12/12]

virtual iOstream& write ( const char *  binaryData,
std::streamsize  count 
)
pure virtual

Write a block of binray data.

Implemented in Ostream, and oTstream.

◆ indent()

virtual void indent ( )
pure virtual

Add indentation characters.

Implemented in Ostream, and oTstream.

Referenced by pFlow::indent().

+ Here is the caller graph for this function:

◆ indentSize() [1/2]

unsigned short indentSize ( ) const
inline

Return indent level.

Definition at line 146 of file iOstream.hpp.

References iOstream::indentSize_.

◆ indentSize() [2/2]

unsigned short& indentSize ( )
inline

Access to indent size.

Definition at line 152 of file iOstream.hpp.

References iOstream::indentSize_.

◆ indentLevel() [1/2]

unsigned short indentLevel ( ) const
inline

Return indent level.

Definition at line 158 of file iOstream.hpp.

References iOstream::indentLevel_.

◆ indentLevel() [2/2]

unsigned short& indentLevel ( )
inline

Access to indent level.

Definition at line 164 of file iOstream.hpp.

References iOstream::indentLevel_.

◆ incrIndent()

void incrIndent ( )
inline

Increment the indent level.

Definition at line 170 of file iOstream.hpp.

References iOstream::indentLevel_.

Referenced by pFlow::incrIndent(), and stlFile::writeFacet().

+ Here is the caller graph for this function:

◆ decrIndent()

void decrIndent ( )

Decrement the indent level.

Definition at line 27 of file iOstream.cpp.

References iOstream::indentLevel_.

Referenced by pFlow::decrIndent(), and stlFile::writeFacet().

+ Here is the caller graph for this function:

◆ beginBlock() [1/2]

pFlow::iOstream & beginBlock ( const word kw)
virtual

Write begin block group with a name Increments indentation, adds newline.

Definition at line 70 of file iOstream.cpp.

References pFlow::beginBlock(), and pFlow::indent().

Referenced by pFlow::beginBlock(), and dictionary::writeDictionary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginBlock() [2/2]

pFlow::iOstream & beginBlock ( )
virtual

Write begin block group without a name Increments indentation, adds newline.

Definition at line 79 of file iOstream.cpp.

References token::BEGIN_BLOCK, pFlow::incrIndent(), and pFlow::indent().

+ Here is the call graph for this function:

◆ endBlock()

pFlow::iOstream & endBlock ( )
virtual

Write end block group Decrements indentation, adds newline.

Definition at line 88 of file iOstream.cpp.

References pFlow::decrIndent(), token::END_BLOCK, and pFlow::indent().

Referenced by pFlow::endBlock(), and dictionary::writeDictionary().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ beginList() [1/2]

pFlow::iOstream & beginList ( )
virtual

Write begin list "(".

Definition at line 125 of file iOstream.cpp.

References token::BEGIN_LIST.

◆ beginList() [2/2]

pFlow::iOstream & beginList ( const word kw)
virtual

Write begin list with keyword "kw (".

Definition at line 134 of file iOstream.cpp.

◆ endList()

pFlow::iOstream & endList ( )
virtual

Write end list ")".

Definition at line 144 of file iOstream.cpp.

References token::END_LIST.

◆ beginSquare() [1/2]

pFlow::iOstream & beginSquare ( )
virtual

Write begin list "[".

Definition at line 153 of file iOstream.cpp.

References token::BEGIN_SQR.

◆ beginSquare() [2/2]

pFlow::iOstream & beginSquare ( const word kw)
virtual

Write begin list with keyword "kw [".

Definition at line 162 of file iOstream.cpp.

◆ endSquare()

pFlow::iOstream & endSquare ( )
virtual

Write end list "]".

Definition at line 172 of file iOstream.cpp.

References token::END_SQR.

◆ endEntry()

pFlow::iOstream & endEntry ( )
virtual

Write end entry (';') followed by newline.

Definition at line 97 of file iOstream.cpp.

References token::END_STATEMENT.

Referenced by pFlow::endEntry(), dataEntry::writeDataEntry(), Field< VectorDual, int8 >::writeField(), and iOstream::writeWordEntry().

+ Here is the caller graph for this function:

◆ newLine()

pFlow::iOstream & newLine ( )
virtual

Write a newLine to stream.

Definition at line 105 of file iOstream.cpp.

References token::NL.

◆ space()

pFlow::iOstream & space ( int32  n = 1)
virtual

Write space to stream.

Definition at line 112 of file iOstream.cpp.

References n, and token::SPACE.

◆ writeWordKeyword()

pFlow::iOstream & writeWordKeyword ( const word kw)
virtual

Write the keyword followed by an appropriate indentation.

Definition at line 41 of file iOstream.cpp.

References pFlow::indent(), and token::SPACE.

Referenced by Field< VectorDual, int8 >::writeField(), iEntry< Key, T * >::writeKeyword(), and iOstream::writeWordEntry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeWordEntry()

iOstream& writeWordEntry ( const word key,
const T &  value 
)
inline

Write a keyword/value entry.

Definition at line 224 of file iOstream.hpp.

References iOstream::endEntry(), and iOstream::writeWordKeyword().

Referenced by timeInterval::write(), iBox< intType >::write(), box::write(), sphere::write(), line::write(), rotatingAxis::write(), vibrating::write(), cylinder::write(), IOfileHeader::writeHeader(), and pointStructure::writePointStructure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flush()

virtual void flush ( )
pure virtual

Flush stream.

Implemented in Ostream, and oTstream.

Referenced by pFlow::flush().

+ Here is the caller graph for this function:

◆ endl()

virtual void endl ( )
pure virtual

Add newline and flush stream.

Implemented in Ostream, and oTstream.

Referenced by pFlow::endl().

+ Here is the caller graph for this function:

◆ fill() [1/2]

virtual char fill ( ) const
pure virtual

Get padding character.

Implemented in Ostream, and oTstream.

◆ fill() [2/2]

virtual char fill ( const char  fillch)
pure virtual

Set padding character for formatted field up to field width.

Implemented in oTstream, and Ostream.

◆ width() [1/2]

virtual int width ( ) const
pure virtual

Get width of output field.

Implemented in Ostream, and oTstream.

◆ width() [2/2]

virtual int width ( const int  w)
pure virtual

Set width of output field (and return old width)

Implemented in oTstream, and Ostream.

◆ precision() [1/2]

virtual int precision ( ) const
pure virtual

Get precision of output field.

Implemented in Ostream, and oTstream.

◆ precision() [2/2]

virtual int precision ( const int  p)
pure virtual

Set precision of output field (and return old precision)

Implemented in oTstream, and Ostream.

◆ operator()()

iOstream& operator() ( ) const
inline

Return a non-const reference to const iOstream Needed for write functions where the stream argument is temporary: e.g.

thing thisThing(OFstream("thingFileName")());

Definition at line 263 of file iOstream.hpp.

Member Data Documentation

◆ entryIndentation_

constexpr const unsigned short entryIndentation_ = 16
staticconstexprprotected

Indentation of the entry from the start of the keyword.

Definition at line 62 of file iOstream.hpp.

◆ indentSize_

unsigned short indentSize_ = 4
protected

Number of spaces per indent level.

Definition at line 65 of file iOstream.hpp.

Referenced by iOstream::indentSize().

◆ indentLevel_

unsigned short indentLevel_ = 0
protected

Current indent level.

Definition at line 68 of file iOstream.hpp.

Referenced by iOstream::decrIndent(), iOstream::incrIndent(), and iOstream::indentLevel().


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