Input token stream. More...
#include <OpenFOAM/ITstream.H>
Inheritance diagram for ITstream:
Collaboration diagram for ITstream:Public Member Functions | |
| ITstream (const string &name, const tokenList &tokens, streamFormat format=ASCII, versionNumber version=currentVersion) | |
| Construct from components. | |
| ITstream (const ITstream &its) | |
| Construct as copy. | |
| virtual | ~ITstream () |
| const fileName & | name () const |
| Return the name of the stream. | |
| fileName & | name () |
| Return non-const access to the name of the stream. | |
| label | tokenIndex () const |
| Return the current token index. | |
| label & | tokenIndex () |
| Return non-const access to the current token index. | |
| label | nRemainingTokens () const |
| Return the number of remaining tokens. | |
| ios_base::fmtflags | flags () const |
| Return flags of output stream. | |
| virtual Istream & | read (token &) |
| Return next token from stream. | |
| virtual Istream & | read (char &) |
| Read a character. | |
| virtual Istream & | read (word &) |
| Read a word. | |
| virtual Istream & | read (string &) |
| virtual Istream & | read (label &) |
| Read a label. | |
| virtual Istream & | read (floatScalar &) |
| Read a floatScalar. | |
| virtual Istream & | read (doubleScalar &) |
| Read a doubleScalar. | |
| virtual Istream & | read (char *, std::streamsize) |
| Read binary block. | |
| virtual Istream & | rewind () |
| Rewind and return the stream so that it may be read again. | |
| ios_base::fmtflags | flags (const ios_base::fmtflags) |
| Set flags of stream. | |
| void | print (Ostream &) const |
| Print description of IOstream to Ostream. | |
Public Member Functions inherited from Istream | |
| Istream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED) | |
| Set stream status. | |
| virtual | ~Istream () |
| void | putBack (const token &) |
| Put back token. | |
| bool | getBack (token &) |
| Get the put back token. | |
| Istream & | readBegin (const char *funcName) |
| Istream & | readEnd (const char *funcName) |
| Istream & | readEndBegin (const char *funcName) |
| char | readBeginList (const char *funcName) |
| char | readEndList (const char *funcName) |
| Istream & | operator() () const |
| Return a non-const reference to const Istream. | |
Public Member Functions inherited from IOstream | |
| IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED) | |
| Construct setting format and version. | |
| virtual | ~IOstream () |
| virtual bool | check (const char *operation) const |
| Check IOstream status for given operation. | |
| void | fatalCheck (const char *operation) const |
| Check IOstream status for given operation. | |
| bool | opened () const |
| Return true if stream has been opened. | |
| bool | closed () const |
| Return true if stream is closed. | |
| bool | good () const |
| Return true if next operation might succeed. | |
| bool | eof () const |
| Return true if end of input seen. | |
| bool | fail () const |
| Return true if next operation will fail. | |
| bool | bad () const |
| Return true if stream is corrupted. | |
| operator void * () const | |
| Return non-zero if the stream has not failed. | |
| bool | operator! () const |
| Return true if the stream has failed. | |
| streamFormat | format () const |
| Return current stream format. | |
| streamFormat | format (const streamFormat fmt) |
| Set the stream format. | |
| streamFormat | format (const word &fmt) |
| Set the stream format from word. | |
| versionNumber | version () const |
| Return the stream version. | |
| versionNumber | version (const versionNumber ver) |
| Set the stream version. | |
| compressionType | compression () const |
| Return the stream compression. | |
| compressionType | compression (const compressionType cmp) |
| Set the stream compression. | |
| compressionType | compression (const word &cmp) |
| Set the stream compression from word. | |
| label | lineNumber () const |
| Return current stream line number. | |
| label & | lineNumber () |
| Return current stream line number. | |
| label | lineNumber (const label ln) |
| Set the stream line number. | |
| void | setEof () |
| Set stream to have reached eof. | |
| void | setFail () |
| Set stream to have failed. | |
| void | setBad () |
| Set stream to be bad. | |
| virtual ios::fmtflags | flags (const ios::fmtflags f)=0 |
| Set flags of stream. | |
| ios::fmtflags | setf (const ios::fmtflags f) |
| Set flags of stream. | |
| ios::fmtflags | setf (const ios::fmtflags f, const ios::fmtflags mask) |
| Set flags of given field of stream. | |
| void | unsetf (const ios::fmtflags uf) |
| Unset flags of stream. | |
| void | print (Ostream &, const int streamState) const |
| Check given stream state bits. | |
| InfoProxy< IOstream > | info () const |
| Return info proxy. | |
Public Member Functions inherited from List< T > | |
| List () | |
| Null constructor. | |
| List (const label) | |
| Construct with given size. | |
| List (const label, const T &) | |
| Construct with given size and value for all elements. | |
| List (const List< T > &) | |
| Copy constructor. | |
| List (const Xfer< List< T > > &) | |
| Construct by transferring the parameter contents. | |
| List (List< T > &, bool reUse) | |
| Construct as copy or re-use as specified. | |
| List (const UList< T > &, const unallocLabelList &mapAddressing) | |
| Construct as subset. | |
| template<class InputIterator > | |
| List (InputIterator first, InputIterator last) | |
| Construct given start and end iterators. | |
| template<unsigned Size> | |
| List (const FixedList< T, Size > &) | |
| Construct as copy of FixedList<T, Size> | |
| List (const PtrList< T > &) | |
| Construct as copy of PtrList<T> | |
| List (const SLList< T > &) | |
| Construct as copy of SLList<T> | |
| List (const IndirectList< T > &) | |
| Construct as copy of IndirectList<T> | |
| List (const UIndirectList< T > &) | |
| Construct as copy of UIndirectList<T> | |
| List (const BiIndirectList< T > &) | |
| Construct as copy of BiIndirectList<T> | |
| List (Istream &) | |
| Construct from Istream. | |
| autoPtr< List< T > > | clone () const |
| Clone. | |
| ~List () | |
| label | size () const |
| Return the number of elements in the UList. | |
| void | resize (const label) |
| Reset size of List. | |
| void | resize (const label, const T &) |
| Reset size of List and value for new elements. | |
| void | setSize (const label) |
| Reset size of List. | |
| void | setSize (const label, const T &) |
| Reset size of List and value for new elements. | |
| void | clear () |
| Clear the list, i.e. set size to zero. | |
| void | append (const UList< T > &) |
| Append a List at the end of this list. | |
| void | append (const UIndirectList< T > &) |
| Append a UIndirectList at the end of this list. | |
| void | transfer (List< T > &) |
| Transfer the contents of the argument List into this list. | |
| template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv> | |
| void | transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &) |
| Transfer the contents of the argument List into this list. | |
| void | transfer (SortableList< T > &) |
| Transfer the contents of the argument List into this list. | |
| Xfer< List< T > > | xfer () |
| Transfer contents to the Xfer container. | |
| T & | newElmt (const label) |
| Return subscript-checked element of UList. | |
| void | operator= (const UList< T > &) |
| Assignment from UList operator. Takes linear time. | |
| void | operator= (const List< T > &) |
| Assignment operator. Takes linear time. | |
| void | operator= (const SLList< T > &) |
| Assignment from SLList operator. Takes linear time. | |
| void | operator= (const IndirectList< T > &) |
| Assignment from IndirectList operator. Takes linear time. | |
| void | operator= (const UIndirectList< T > &) |
| Assignment from UIndirectList operator. Takes linear time. | |
| void | operator= (const BiIndirectList< T > &) |
| Assignment from BiIndirectList operator. Takes linear time. | |
| void | operator= (const T &) |
| Assignment of all entries to the given value. | |
Public Member Functions inherited from UList< T > | |
| UList () | |
| Null constructor. | |
| UList (T *__restrict__ v, label size) | |
| Construct from components. | |
| label | fcIndex (const label i) const |
| Return the forward circular index, i.e. the next index. | |
| label | rcIndex (const label i) const |
| Return the reverse circular index, i.e. the previous index. | |
| label | byteSize () const |
| Return the binary size in number of characters of the UList. | |
| const T * | cdata () const |
| Return a const pointer to the first data element,. | |
| T * | data () |
| Return a pointer to the first data element,. | |
| void | checkStart (const label start) const |
| Check start is within valid range (0 ... size-1). | |
| void | checkSize (const label size) const |
| Check size is within valid range (0 ... size). | |
| void | checkIndex (const label i) const |
| Check index i is within valid range (0 ... size-1). | |
| void | writeEntry (Ostream &) const |
| Write the UList as a dictionary entry. | |
| void | writeEntry (const word &keyword, Ostream &) const |
| Write the UList as a dictionary entry with keyword. | |
| void | assign (const UList< T > &) |
| Assign elements to those from UList. | |
| T & | operator[] (const label) |
| Return element of UList. | |
| const T & | operator[] (const label) const |
| Return element of constant UList. | |
| operator const Foam::List< T > & () const | |
| Allow cast to a const List<T>&. | |
| iterator | begin () |
| Return an iterator to begin traversing the UList. | |
| iterator | end () |
| Return an iterator to end traversing the UList. | |
| const_iterator | cbegin () const |
| Return const_iterator to begin traversing the constant UList. | |
| const_iterator | cend () const |
| Return const_iterator to end traversing the constant UList. | |
| const_iterator | begin () const |
| Return const_iterator to begin traversing the constant UList. | |
| const_iterator | end () const |
| Return const_iterator to end traversing the constant UList. | |
| reverse_iterator | rbegin () |
| Return reverse_iterator to begin reverse traversing the UList. | |
| reverse_iterator | rend () |
| Return reverse_iterator to end reverse traversing the UList. | |
| const_reverse_iterator | crbegin () const |
| Return const_reverse_iterator to begin reverse traversing the UList. | |
| const_reverse_iterator | crend () const |
| Return const_reverse_iterator to end reverse traversing the UList. | |
| const_reverse_iterator | rbegin () const |
| Return const_reverse_iterator to begin reverse traversing the UList. | |
| const_reverse_iterator | rend () const |
| Return const_reverse_iterator to end reverse traversing the UList. | |
| label | max_size () const |
| Return size of the largest possible UList. | |
| bool | empty () const |
| Return true if the UList is empty (ie, size() is zero). | |
| void | swap (UList< T > &) |
| Swap two ULists of the same type in constant time. | |
| bool | operator== (const UList< T > &) const |
| Equality operation on ULists of the same type. | |
| bool | operator!= (const UList< T > &) const |
| The opposite of the equality operation. Takes linear time. | |
| bool | operator< (const UList< T > &) const |
| Compare two ULists lexicographically. Takes linear time. | |
| bool | operator> (const UList< T > &) const |
| Compare two ULists lexicographically. Takes linear time. | |
| bool | operator<= (const UList< T > &) const |
| Return true if !(a > b). Takes linear time. | |
| bool | operator>= (const UList< T > &) const |
| Return true if !(a < b). Takes linear time. | |
| template<> | |
| const bool & | operator[] (const label i) const |
Additional Inherited Members | |
Public Types inherited from List< T > | |
| typedef SubList< T > | subList |
| Declare type of subList. | |
Public Types inherited from UList< T > | |
| typedef T | value_type |
| Type of values the UList contains. | |
| typedef T & | reference |
| Type that can be used for storing into. | |
| typedef const T & | const_reference |
| Type that can be used for storing into. | |
| typedef label | difference_type |
| The type that can represent the difference between any two. | |
| typedef label | size_type |
| The type that can represent the size of a UList. | |
| typedef T * | iterator |
| Random access iterator for traversing UList. | |
| typedef const T * | const_iterator |
| Random access iterator for traversing UList. | |
| typedef T * | reverse_iterator |
| Reverse iterator for reverse traversal of UList. | |
| typedef const T * | const_reverse_iterator |
| Reverse iterator for reverse traversal of constant UList. | |
Static Public Member Functions inherited from List< T > | |
| static const List< T > & | null () |
| Return a null List. | |
Protected Member Functions inherited from List< T > | |
| void | size (const label) |
| Override size to be inconsistent with allocated storage. | |
|
inline |
Construct from components.
Definition at line 70 of file ITstream.H.
References IOstream::setGood(), and IOstream::setOpened().
Construct as copy.
Definition at line 88 of file ITstream.H.
References IOstream::setGood(), and IOstream::setOpened().
|
inlinevirtual |
Definition at line 102 of file ITstream.H.
|
inlinevirtual |
Return the name of the stream.
Reimplemented from IOstream.
Reimplemented in primitiveEntry.
Definition at line 111 of file ITstream.H.
|
inlinevirtual |
Return non-const access to the name of the stream.
Reimplemented from IOstream.
Reimplemented in primitiveEntry.
Definition at line 117 of file ITstream.H.
|
inline |
Return the current token index.
Definition at line 123 of file ITstream.H.
|
inline |
Return non-const access to the current token index.
Definition at line 129 of file ITstream.H.
|
inline |
Return the number of remaining tokens.
Definition at line 135 of file ITstream.H.
References List< T >::size().
|
inlinevirtual |
|
virtual |
Return next token from stream.
Implements Istream.
Definition at line 56 of file ITstream.C.
References Foam::exit(), Foam::FatalIOError, FatalIOErrorIn, Istream::getBack(), token::lineNumber(), and token::undefinedToken.
|
virtual |
Read a character.
Implements Istream.
Definition at line 110 of file ITstream.C.
References notImplemented.
|
virtual |
Read a word.
Implements Istream.
Definition at line 117 of file ITstream.C.
References notImplemented.
|
virtual |
|
virtual |
Read a label.
Implements Istream.
Definition at line 131 of file ITstream.C.
References notImplemented.
|
virtual |
Read a floatScalar.
Implements Istream.
Definition at line 138 of file ITstream.C.
References notImplemented.
|
virtual |
Read a doubleScalar.
Implements Istream.
Definition at line 145 of file ITstream.C.
References notImplemented.
|
virtual |
Read binary block.
Implements Istream.
Definition at line 152 of file ITstream.C.
References notImplemented.
|
virtual |
Rewind and return the stream so that it may be read again.
Implements Istream.
Definition at line 160 of file ITstream.C.
References IOstream::lineNumber().
Referenced by primitiveEntry::stream().
|
inline |
Set flags of stream.
Definition at line 180 of file ITstream.H.
|
virtual |
Print description of IOstream to Ostream.
Reimplemented from IOstream.
Definition at line 31 of file ITstream.C.
References UList< T >::begin(), IOstream::lineNumber(), UList< T >::rbegin(), and List< T >::size().
Referenced by Foam::operator<<().