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

Public Member Functions

 Istream (std::istream &is, const word &streamName, writeFormat wf=ASCII)
 
virtual ~Istream ()=default
 
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 ios_base::fmtflags flags () const
 Return flags of stream. More...
 
Istreamget (char &c)
 
int peek ()
 
IstreamgetLine (word &str, char delim='\n')
 
std::streamsize getLine (std::nullptr_t, char delim='\n')
 
Istreamputback (const char c)
 
virtual iIstreamread (token &t) override
 
virtual iIstreamread (char &c) override
 
virtual iIstreamread (word &str) override
 
virtual iIstreamreadString (word &str) override
 
virtual iIstreamread (int64 &) override
 
virtual iIstreamread (int32 &) override
 
virtual iIstreamread (int16 &) override
 
virtual iIstreamread (int8 &) override
 
virtual iIstreamread (label &) override
 
virtual iIstreamread (uint32 &) override
 
virtual iIstreamread (uint16 &) override
 
virtual iIstreamread (float &val) override
 
virtual iIstreamread (double &val) override
 
iIstreamread (char *buffer, std::streamsize count) override
 
virtual void rewind ()
 
virtual ios_base::fmtflags flags (const ios_base::fmtflags flags)
 Set flags of stream. More...
 
virtual std::istream & stdStream ()
 
virtual const std::istream & stdStream () const
 
- Public Member Functions inherited from iIstream
 iIstream ()
 
 iIstream (writeFormat wf)
 
 iIstream (const iIstream &)=default
 
virtual ~iIstream ()=default
 
void putBack (const token &tok)
 
bool getBack (token &tok)
 
bool peekBack (token &tok)
 
void resetPutBack ()
 
virtual bool findToken (const word &w)
 
virtual bool findTokenResume (const word &w)
 search for all tokesn after the current file position and find the first word token tbat matchs w More...
 
virtual bool findTokenSilent (const word &w, int32 limitLine=100)
 
virtual bool findTokenResumeSilent (const word &w, int32 limitLine=100)
 search for all tokesn after the current file position and find the first word token tbat matchs w More...
 
virtual bool findTokenAndNext (const word &w, word &nextW, bool checkEndStatement=true)
 
virtual bool findTokenAndNextSilent (const word &w, word &nextW, int32 limitLine=100)
 
template<typename T >
bool findKeywordAndVal (const word &keyword, T &val, bool checkEndStatement=true)
 
template<typename T >
lookupData (const word &keyword)
 
template<typename T >
lookupDataOrSet (const word &keyword, const T &setVal)
 
template<typename T >
bool nextData (const word &keyword, T &data)
 
bool readBegin (const char *funcName)
 
bool readEnd (const char *funcName)
 
bool readBeginSquare (const char *funcName)
 
bool readEndSquare (const char *funcName)
 
char readBeginList (const char *funcName)
 
char readEndList (const char *funcName)
 
char readEndStatement (const char *funcName)
 
iIstreamoperator() () const
 
- 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 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...
 

Private Member Functions

char nextValid ()
 
void readWordToken (token &t)
 
IstreamreadVariable (word &str)
 
void operator= (const Istream &)=delete
 

Private Attributes

word name_
 
std::istream & is_
 

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...
 
- 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 inherited from IOstream
static word staticName_
 Name for any generic stream - normally treat as readonly. More...
 

Detailed Description

Definition at line 38 of file Istream.hpp.

Constructor & Destructor Documentation

◆ Istream()

Istream ( std::istream &  is,
const word streamName,
writeFormat  wf = ASCII 
)

Definition at line 308 of file Istream.cpp.

◆ ~Istream()

virtual ~Istream ( )
virtualdefault

Member Function Documentation

◆ nextValid()

char nextValid ( )
private

Definition at line 53 of file Istream.cpp.

References IOstream::bad(), Istream::get(), IOstream::good(), and Istream::putback().

+ Here is the call graph for this function:

◆ readWordToken()

void readWordToken ( token t)
private

Definition at line 131 of file Istream.cpp.

References token::setBad().

+ Here is the call graph for this function:

◆ readVariable()

pFlow::Istream & readVariable ( word str)
private

Definition at line 145 of file Istream.cpp.

References token::BEGIN_BLOCK, token::BEGIN_LIST, token::DOLLAR, token::END_BLOCK, token::END_LIST, pFlow::endl(), errLen, fatalExit, ioErrorInFile, pFlow::nl, and warningInFunction.

+ Here is the call graph for this function:

◆ operator=()

void operator= ( const Istream )
privatedelete

◆ name() [1/2]

virtual const word& name ( ) const
inlinevirtual

Return the name of the stream.

Reimplemented from IOstream.

Definition at line 77 of file Istream.hpp.

References Istream::name_.

Referenced by dictionary::dictionary(), property::property(), and stlFile::read().

+ Here is the caller graph for this function:

◆ name() [2/2]

virtual word& name ( )
inlinevirtual

Return non-const access to the name of the stream.

Reimplemented from IOstream.

Definition at line 83 of file Istream.hpp.

References Istream::name_.

◆ flags() [1/2]

std::ios_base::fmtflags flags ( ) const
virtual

Return flags of stream.

Implements IOstream.

Definition at line 885 of file Istream.cpp.

◆ get()

pFlow::Istream & get ( char &  c)

Definition at line 329 of file Istream.cpp.

References Istream::get().

Referenced by Istream::get(), and Istream::nextValid().

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

◆ peek()

int peek ( )

Definition at line 343 of file Istream.cpp.

◆ getLine() [1/2]

pFlow::Istream & getLine ( word str,
char  delim = '\n' 
)

Definition at line 349 of file Istream.cpp.

◆ getLine() [2/2]

std::streamsize getLine ( std::nullptr_t  ,
char  delim = '\n' 
)

Definition at line 363 of file Istream.cpp.

References pFlow::count(), and pFlow::algorithms::KOKKOS::max().

+ Here is the call graph for this function:

◆ putback()

pFlow::Istream & putback ( const char  c)

Definition at line 379 of file Istream.cpp.

Referenced by Istream::nextValid().

+ Here is the caller graph for this function:

◆ read() [1/13]

◆ read() [2/13]

pFlow::iIstream & read ( char &  c)
overridevirtual

Implements iIstream.

Definition at line 595 of file Istream.cpp.

◆ read() [3/13]

pFlow::iIstream & read ( word str)
overridevirtual

Implements iIstream.

Definition at line 602 of file Istream.cpp.

References token::BEGIN_LIST, token::END_LIST, pFlow::endl(), errLen, fatalExit, ioErrorInFile, pFlow::nl, pFlow::validWord(), and warningInFunction.

+ Here is the call graph for this function:

◆ readString()

pFlow::iIstream & readString ( word str)
overridevirtual

Implements iIstream.

Definition at line 684 of file Istream.cpp.

References token::BEGIN_STRING, token::END_STRING, errLen, fatalExit, ioErrorInFile, and token::NL.

◆ read() [4/13]

pFlow::iIstream & read ( int64 val)
overridevirtual

Implements iIstream.

Definition at line 786 of file Istream.cpp.

◆ read() [5/13]

pFlow::iIstream & read ( int32 val)
overridevirtual

Implements iIstream.

Definition at line 793 of file Istream.cpp.

◆ read() [6/13]

pFlow::iIstream & read ( int16 val)
overridevirtual

Implements iIstream.

Definition at line 800 of file Istream.cpp.

◆ read() [7/13]

pFlow::iIstream & read ( int8 val)
overridevirtual

Implements iIstream.

Definition at line 807 of file Istream.cpp.

◆ read() [8/13]

pFlow::iIstream & read ( label val)
overridevirtual

Implements iIstream.

Definition at line 814 of file Istream.cpp.

◆ read() [9/13]

pFlow::iIstream & read ( uint32 val)
overridevirtual

Implements iIstream.

Definition at line 821 of file Istream.cpp.

◆ read() [10/13]

pFlow::iIstream & read ( uint16 val)
overridevirtual

Implements iIstream.

Definition at line 828 of file Istream.cpp.

◆ read() [11/13]

pFlow::iIstream & read ( float &  val)
overridevirtual

Implements iIstream.

Definition at line 835 of file Istream.cpp.

◆ read() [12/13]

pFlow::iIstream & read ( double &  val)
overridevirtual

Implements iIstream.

Definition at line 843 of file Istream.cpp.

◆ read() [13/13]

pFlow::iIstream & read ( char *  buffer,
std::streamsize  count 
)
overridevirtual

Implements iIstream.

Definition at line 851 of file Istream.cpp.

References pFlow::count(), fatalErrorInFunction, and fatalExit.

+ Here is the call graph for this function:

◆ rewind()

void rewind ( )
virtual

Implements iIstream.

Definition at line 871 of file Istream.cpp.

◆ flags() [2/2]

std::ios_base::fmtflags flags ( const ios_base::fmtflags  f)
virtual

Set flags of stream.

Implements IOstream.

Definition at line 891 of file Istream.cpp.

◆ stdStream() [1/2]

virtual std::istream& stdStream ( )
inlinevirtual

Definition at line 165 of file Istream.hpp.

References Istream::is_.

◆ stdStream() [2/2]

virtual const std::istream& stdStream ( ) const
inlinevirtual

Definition at line 171 of file Istream.hpp.

References Istream::is_.

Member Data Documentation

◆ name_

word name_
private

Definition at line 44 of file Istream.hpp.

Referenced by Istream::name().

◆ is_

std::istream& is_
private

Definition at line 46 of file Istream.hpp.

Referenced by Istream::stdStream().


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