Public Member Functions | Static Public Member Functions | List of all members
ITstream Class Reference

An input stream of tokens. More...

Inheritance diagram for ITstream:
Inheritance graph
[legend]
Collaboration diagram for ITstream:
Collaboration graph
[legend]

Public Member Functions

 ITstream (const ITstream &is)
 
 ITstream (ITstream &&is)
 
 ITstream (IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 
 ITstream (const Foam::zero, const string &name="input", IOstreamOption streamOpt=IOstreamOption())
 
 ITstream (const string &name, const UList< token > &tokens, IOstreamOption streamOpt=IOstreamOption())
 
 ITstream (const string &name, List< token > &&tokens, IOstreamOption streamOpt=IOstreamOption())
 
 ITstream (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 
 ITstream (const std::string &input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 
 ITstream (const char *input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 
virtual ~ITstream ()=default
 
bool hasPutback () const noexcept
 
const tokenpeekFirst () const
 
const tokenpeekLast () const
 
const tokenpeek () const
 
label tokenIndex () const noexcept
 
label & tokenIndex () noexcept
 
label nRemainingTokens () const noexcept
 
void seek (label pos)
 
void skip (label n=1)
 
virtual const fileNamename () const
 
virtual fileNamename ()
 
void append (const token &t, const bool lazy)
 
void append (token &&t, const bool lazy)
 
void append (const UList< token > &newTokens, const bool lazy)
 
void append (List< token > &&newTokens, const bool lazy)
 
virtual ios_base::fmtflags flags () const
 
ios_base::fmtflags flags (const ios_base::fmtflags)
 
virtual Istreamread (token &tok)
 
virtual Istreamread (char &)
 
virtual Istreamread (word &)
 
virtual Istreamread (string &)
 
virtual Istreamread (label &)
 
virtual Istreamread (floatScalar &)
 
virtual Istreamread (doubleScalar &)
 
virtual Istreamread (char *data, std::streamsize)
 
virtual IstreamreadRaw (char *data, std::streamsize count)
 
virtual bool beginRawRead ()
 
virtual bool endRawRead ()
 
virtual void rewind ()
 
void print (Ostream &os) const
 
std::string toString () const
 
void operator= (const ITstream &is)
 
void operator= (const UList< token > &toks)
 
void operator= (List< token > &&toks)
 
- Public Member Functions inherited from Istream
 Istream (const Istream &)=default
 
virtual ~Istream ()=default
 
 Istream (IOstreamOption streamOpt=IOstreamOption())
 
 Istream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
 
const tokenpeekBack () const noexcept
 
bool peekBack (token &tok)
 
void putBack (const token &tok)
 
bool getBack (token &tok)
 
bool readBegin (const char *funcName)
 
bool readEnd (const char *funcName)
 
char readBeginList (const char *funcName)
 
char readEndList (const char *funcName)
 
Istreamoperator() () const
 
- Public Member Functions inherited from IOstream
 IOstream (const IOstream &)=default
 
virtual ~IOstream ()=default
 
 IOstream (IOstreamOption streamOpt=IOstreamOption())
 
 IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
 
fileName relativeName () const
 
virtual bool check (const char *operation) const
 
bool fatalCheck (const char *operation) const
 
bool opened () const noexcept
 
bool closed () const noexcept
 
bool good () const noexcept
 
bool eof () const noexcept
 
bool fail () const noexcept
 
bool bad () const noexcept
 
 operator bool () const noexcept
 
bool operator! () const noexcept
 
unsigned labelByteSize () const noexcept
 
unsigned scalarByteSize () const noexcept
 
void setLabelByteSize (unsigned nbytes) noexcept
 
void setScalarByteSize (unsigned nbytes) noexcept
 
template<class T = label>
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize () const noexcept
 
template<class T = scalar>
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize () const noexcept
 
label lineNumber () const noexcept
 
label & lineNumber () noexcept
 
label lineNumber (const label num) noexcept
 
void setEof () noexcept
 
void setFail () noexcept
 
void setBad ()
 
ios_base::fmtflags setf (const ios_base::fmtflags f)
 
ios_base::fmtflags setf (const ios_base::fmtflags f, const ios_base::fmtflags mask)
 
void unsetf (const ios_base::fmtflags f)
 
void print (Ostream &os, const int streamState) const
 
InfoProxy< IOstreaminfo () const
 
- Public Member Functions inherited from IOstreamOption
constexpr IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 
constexpr IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept
 
constexpr IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 
 IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept
 
streamFormat format () const noexcept
 
streamFormat format (const streamFormat fmt) noexcept
 
streamFormat format (const word &formatName)
 
compressionType compression () const noexcept
 
compressionType compression (const compressionType comp) noexcept
 
compressionType compression (const word &compName)
 
versionNumber version () const noexcept
 
versionNumber version (const versionNumber ver) noexcept
 
versionNumber version (const token &tok)
 
- Public Member Functions inherited from List
constexpr List () noexcept
 
 List (const label len)
 
 List (const label len, const T &val)
 
 List (const label len, const Foam::zero)
 
 List (const Foam::one, const T &val)
 
 List (const Foam::one, T &&val)
 
 List (const Foam::one, const Foam::zero)
 
 List (const List< T > &a)
 
 List (const UList< T > &a)
 
 List (List< T > &a, bool reuse)
 
 List (const UList< T > &list, const labelUList &indices)
 
template<unsigned N>
 List (const UList< T > &list, const FixedList< label, N > &indices)
 
template<unsigned N>
 List (const FixedList< T, N > &list)
 
 List (const PtrList< T > &list)
 
 List (const SLList< T > &list)
 
template<class Addr >
 List (const IndirectListBase< T, Addr > &list)
 
 List (std::initializer_list< T > list)
 
 List (List< T > &&list)
 
template<int SizeMin>
 List (DynamicList< T, SizeMin > &&list)
 
 List (SortableList< T > &&list)
 
 List (SLList< T > &&list)
 
 List (Istream &is)
 
autoPtr< List< T > > clone () const
 
 ~List ()
 
void clear ()
 
void resize (const label len)
 
void resize (const label len, const T &val)
 
void resize_nocopy (const label len)
 
void setSize (const label n)
 
void setSize (const label n, const T &val)
 
void append (const T &val)
 
void append (T &&val)
 
void append (const UList< T > &list)
 
template<class Addr >
void append (const IndirectListBase< T, Addr > &list)
 
label appendUniq (const T &val)
 
void transfer (List< T > &list)
 
template<int SizeMin>
void transfer (DynamicList< T, SizeMin > &list)
 
void transfer (SortableList< T > &list)
 
TnewElmt (const label i)
 
void operator= (const UList< T > &a)
 
void operator= (const List< T > &list)
 
void operator= (const SLList< T > &list)
 
template<class Addr >
void operator= (const IndirectListBase< T, Addr > &list)
 
template<unsigned N>
void operator= (const FixedList< T, N > &list)
 
void operator= (std::initializer_list< T > list)
 
void operator= (const T &val)
 
void operator= (const Foam::zero)
 
void operator= (List< T > &&list)
 
template<int SizeMin>
void operator= (DynamicList< T, SizeMin > &&list)
 
void operator= (SortableList< T > &&list)
 
void operator= (SLList< T > &&list)
 
IstreamreadList (Istream &is)
 
void shallowCopy (const UList< T > &)=delete
 
template<class TypeT = T>
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set (const label i, bool val=true)
 
template<class T >
 List (const label len)
 
template<class T >
 List (const label len, const T &val)
 
template<class T >
 List (const label len, const Foam::zero)
 
template<class T >
 List (const Foam::one, const T &val)
 
template<class T >
 List (const Foam::one, T &&val)
 
template<class T >
 List (const Foam::one, const Foam::zero)
 
template<class T >
 List (const UList< T > &a)
 
template<class T >
 List (const List< T > &a)
 
template<class T >
 List (List< T > &a, bool reuse)
 
template<class T >
 List (const UList< T > &list, const labelUList &indices)
 
template<class T >
 List (const PtrList< T > &list)
 
template<class T >
 List (const SLList< T > &list)
 
template<class T >
 List (std::initializer_list< T > list)
 
template<class T >
 List (List< T > &&list)
 
template<class T >
 List (SortableList< T > &&list)
 
template<class T >
 List (SLList< T > &&list)
 
template<class T >
void transfer (List< T > &list)
 
template<class T >
void transfer (SortableList< T > &list)
 
template<class T >
void operator= (const UList< T > &a)
 
template<class T >
void operator= (const List< T > &list)
 
template<class T >
void operator= (const SLList< T > &list)
 
template<class T >
void operator= (std::initializer_list< T > list)
 
template<class T >
void operator= (List< T > &&list)
 
template<class T >
void operator= (SortableList< T > &&list)
 
template<class T >
void operator= (SLList< T > &&list)
 
IstreamreadList (Istream &is)
 
template<class T >
constexpr List () noexcept
 
void resize (const label newLen)
 
template<class T >
void append (const T &val)
 
template<class T >
void append (T &&val)
 
template<class T >
void append (const UList< T > &list)
 
template<class T >
void operator= (const T &val)
 
template<class T >
void operator= (const Foam::zero)
 
template<class T >
 List (Istream &is)
 
IstreamreadList (Istream &is)
 

Static Public Member Functions

static tokenList parse (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
 
static tokenList parse (const std::string &input, IOstreamOption streamOpt=IOstreamOption())
 
static tokenList parse (const char *input, IOstreamOption streamOpt=IOstreamOption())
 
- Static Public Member Functions inherited from IOstream
static unsigned int defaultPrecision () noexcept
 
static unsigned int defaultPrecision (unsigned int prec) noexcept
 
- Static Public Member Functions inherited from IOstreamOption
static streamFormat formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII)
 
static streamFormat formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII)
 
static compressionType compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
 
static compressionType compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED)
 
- Static Public Member Functions inherited from List
static const List< T > & null ()
 

Additional Inherited Members

- Public Types inherited from IOstream
enum  streamAccess : char { CLOSED = 0, OPENED }
 
- Public Types inherited from IOstreamOption
enum  streamFormat : char { ASCII = 0, BINARY }
 
enum  compressionType : char { UNCOMPRESSED = 0, COMPRESSED }
 
- Public Types inherited from List
typedef SubList< TsubList
 
- Static Public Attributes inherited from IOstream
static unsigned int precision_
 
- Static Public Attributes inherited from IOstreamOption
static const Enum< streamFormatformatNames
 
static const versionNumber currentVersion
 
- Protected Member Functions inherited from Istream
bool hasPutback () const noexcept
 
- Protected Member Functions inherited from IOstream
void setOpened () noexcept
 
void setClosed () noexcept
 
void setState (std::ios_base::iostate state) noexcept
 
void setGood () noexcept
 
- Protected Attributes inherited from IOstream
std::ios_base::iostate ioState_
 
streamAccess openClosed_
 
unsigned char sizeofLabel_
 
unsigned char sizeofScalar_
 
label lineNumber_
 
- Static Protected Attributes inherited from IOstream
static fileName staticName_
 

Detailed Description

An input stream of tokens.

Source files

Definition at line 48 of file ITstream.H.

Constructor & Destructor Documentation

◆ ITstream() [1/9]

ITstream ( const ITstream is)

Definition at line 153 of file ITstream.C.

References IOstream::setGood(), and IOstream::setOpened().

Here is the call graph for this function:

◆ ITstream() [2/9]

ITstream ( ITstream &&  is)

Definition at line 165 of file ITstream.C.

References IOstream::setGood(), and IOstream::setOpened().

Here is the call graph for this function:

◆ ITstream() [3/9]

ITstream ( IOstreamOption  streamOpt = IOstreamOption(),
const string name = "input" 
)
explicit

Definition at line 178 of file ITstream.C.

◆ ITstream() [4/9]

ITstream ( const Foam::zero  ,
const string name = "input",
IOstreamOption  streamOpt = IOstreamOption() 
)
explicit

Definition at line 194 of file ITstream.C.

◆ ITstream() [5/9]

ITstream ( const string name,
const UList< token > &  tokens,
IOstreamOption  streamOpt = IOstreamOption() 
)

Definition at line 205 of file ITstream.C.

◆ ITstream() [6/9]

ITstream ( const string name,
List< token > &&  tokens,
IOstreamOption  streamOpt = IOstreamOption() 
)

Definition at line 222 of file ITstream.C.

◆ ITstream() [7/9]

ITstream ( const UList< char > &  input,
IOstreamOption  streamOpt = IOstreamOption(),
const string name = "input" 
)
explicit

Definition at line 239 of file ITstream.C.

References Foam::input(), Foam::parseStream(), and ITstream::rewind().

Here is the call graph for this function:

◆ ITstream() [8/9]

ITstream ( const std::string &  input,
IOstreamOption  streamOpt = IOstreamOption(),
const string name = "input" 
)
explicit

Definition at line 255 of file ITstream.C.

References Foam::input(), Foam::parseStream(), and ITstream::rewind().

Here is the call graph for this function:

◆ ITstream() [9/9]

ITstream ( const char *  input,
IOstreamOption  streamOpt = IOstreamOption(),
const string name = "input" 
)
explicit

Definition at line 271 of file ITstream.C.

References Foam::input(), Foam::parseStream(), and ITstream::rewind().

Here is the call graph for this function:

◆ ~ITstream()

virtual ~ITstream ( )
virtualdefault

Member Function Documentation

◆ parse() [1/3]

Foam::tokenList parse ( const UList< char > &  input,
IOstreamOption  streamOpt = IOstreamOption() 
)
static

Definition at line 75 of file ITstream.C.

References Foam::input(), and Foam::parseStream().

Referenced by dictionary::tokens().

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

◆ parse() [2/3]

Foam::tokenList parse ( const std::string &  input,
IOstreamOption  streamOpt = IOstreamOption() 
)
static

Definition at line 89 of file ITstream.C.

References Foam::input(), and Foam::parseStream().

Here is the call graph for this function:

◆ parse() [3/3]

Foam::tokenList parse ( const char *  input,
IOstreamOption  streamOpt = IOstreamOption() 
)
static

Definition at line 103 of file ITstream.C.

References Foam::input(), and Foam::parseStream().

Here is the call graph for this function:

◆ hasPutback()

bool hasPutback ( ) const
inlinenoexcept

Definition at line 179 of file ITstream.H.

References Istream::hasPutback().

Here is the call graph for this function:

◆ peekFirst()

const Foam::token & peekFirst ( ) const

Definition at line 333 of file ITstream.C.

References Foam::peekTokenAt().

Here is the call graph for this function:

◆ peekLast()

const Foam::token & peekLast ( ) const

Definition at line 339 of file ITstream.C.

References Foam::peekTokenAt().

Here is the call graph for this function:

◆ peek()

const Foam::token & peek ( ) const

Definition at line 345 of file ITstream.C.

References Istream::hasPutback(), Istream::peekBack(), and Foam::peekTokenAt().

Referenced by Constant< Type >::Constant(), Polynomial< Type >::Polynomial(), Foam::readScaling(), and Table< Type >::Table().

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

◆ tokenIndex() [1/2]

label tokenIndex ( ) const
inlinenoexcept

Definition at line 198 of file ITstream.H.

◆ tokenIndex() [2/2]

label& tokenIndex ( )
inlinenoexcept

Definition at line 204 of file ITstream.H.

◆ nRemainingTokens()

label nRemainingTokens ( ) const
inlinenoexcept

Definition at line 210 of file ITstream.H.

Referenced by entry::checkITstream(), and dictionary::checkITstream().

Here is the caller graph for this function:

◆ seek()

void seek ( label  pos)

Definition at line 357 of file ITstream.C.

References Foam::pos().

Here is the call graph for this function:

◆ skip()

void skip ( label  n = 1)

Definition at line 404 of file ITstream.C.

References n.

Referenced by Constant< Type >::Constant(), Polynomial< Type >::Polynomial(), and Table< Type >::Table().

Here is the caller graph for this function:

◆ name() [1/2]

virtual const fileName& name ( ) const
inlinevirtual

Reimplemented from IOstream.

Reimplemented in primitiveEntry.

Definition at line 231 of file ITstream.H.

Referenced by primitiveEntry::name(), and primitiveEntry::primitiveEntry().

Here is the caller graph for this function:

◆ name() [2/2]

virtual fileName& name ( )
inlinevirtual

Reimplemented from IOstream.

Reimplemented in primitiveEntry.

Definition at line 237 of file ITstream.H.

◆ append() [1/4]

void append ( const token t,
const bool  lazy 
)

Definition at line 560 of file ITstream.C.

◆ append() [2/4]

void append ( token &&  t,
const bool  lazy 
)

Definition at line 570 of file ITstream.C.

◆ append() [3/4]

void append ( const UList< token > &  newTokens,
const bool  lazy 
)

Definition at line 580 of file ITstream.C.

References UList::size().

Here is the call graph for this function:

◆ append() [4/4]

void append ( List< token > &&  newTokens,
const bool  lazy 
)

Definition at line 593 of file ITstream.C.

◆ flags() [1/2]

virtual ios_base::fmtflags flags ( ) const
inlinevirtual

Implements IOstream.

Definition at line 273 of file ITstream.H.

◆ flags() [2/2]

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

Implements IOstream.

Definition at line 279 of file ITstream.H.

◆ read() [1/8]

Foam::Istream & read ( token tok)
virtual

Implements Istream.

Definition at line 446 of file ITstream.C.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Istream::getBack(), token::lineNumber(), and token::reset().

Here is the call graph for this function:

◆ read() [2/8]

Foam::Istream & read ( char &  )
virtual

Implements Istream.

Definition at line 498 of file ITstream.C.

References NotImplemented.

◆ read() [3/8]

Foam::Istream & read ( word )
virtual

Implements Istream.

Definition at line 505 of file ITstream.C.

References NotImplemented.

◆ read() [4/8]

Foam::Istream & read ( string )
virtual

Implements Istream.

Definition at line 512 of file ITstream.C.

References NotImplemented.

◆ read() [5/8]

Foam::Istream & read ( label &  )
virtual

Implements Istream.

Definition at line 519 of file ITstream.C.

References NotImplemented.

◆ read() [6/8]

Foam::Istream & read ( floatScalar )
virtual

Implements Istream.

Definition at line 526 of file ITstream.C.

References NotImplemented.

◆ read() [7/8]

Foam::Istream & read ( doubleScalar )
virtual

Implements Istream.

Definition at line 533 of file ITstream.C.

References NotImplemented.

◆ read() [8/8]

Foam::Istream & read ( char *  data,
std::streamsize   
)
virtual

Implements Istream.

Definition at line 547 of file ITstream.C.

References NotImplemented.

◆ readRaw()

Foam::Istream & readRaw ( char *  data,
std::streamsize  count 
)
virtual

Implements Istream.

Definition at line 540 of file ITstream.C.

References NotImplemented.

◆ beginRawRead()

virtual bool beginRawRead ( )
inlinevirtual

Implements Istream.

Definition at line 317 of file ITstream.H.

◆ endRawRead()

virtual bool endRawRead ( )
inlinevirtual

Implements Istream.

Definition at line 323 of file ITstream.H.

◆ rewind()

void rewind ( )
virtual

Implements Istream.

Definition at line 554 of file ITstream.C.

Referenced by Foam::exprTools::getList(), ITstream::ITstream(), simpleObjectRegistry::setNamedValue(), and primitiveEntry::stream().

Here is the caller graph for this function:

◆ print()

void print ( Ostream os) const
virtual

Reimplemented from IOstream.

Definition at line 288 of file ITstream.C.

References os(), and IOstream::print().

Here is the call graph for this function:

◆ toString()

std::string toString ( ) const

Definition at line 313 of file ITstream.C.

References StringStreamAllocator< StreamType >::str().

Referenced by expressionEntry::inplaceExpand().

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

◆ operator=() [1/3]

void operator= ( const ITstream is)

Definition at line 610 of file ITstream.C.

References List::operator=().

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( const UList< token > &  toks)

Definition at line 623 of file ITstream.C.

References List::operator=().

Here is the call graph for this function:

◆ operator=() [3/3]

void operator= ( List< token > &&  toks)

Definition at line 630 of file ITstream.C.

References List::operator=().

Here is the call graph for this function:

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