Loading...
Searching...
No Matches
ITstream Class Reference

An input stream of tokens. More...

#include <ITstream.H>

Inheritance diagram for ITstream:
Collaboration diagram for ITstream:

Public Member Functions

 ITstream (const ITstream &is)
 Copy construct.
 ITstream (ITstream &&is)
 Move construct.
 ITstream (IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Default construct. Empty stream, optionally with given name.
 ITstream (Foam::zero, const string &name="input", IOstreamOption streamOpt=IOstreamOption())
 Construct empty, optionally with given name.
 ITstream (const UList< token > &tokens, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Copy construct from tokens, optionally with given name.
 ITstream (List< token > &&tokens, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Move construct from tokens, optionally with given name.
 ITstream (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Construct token list by parsing the input character sequence.
 ITstream (const char *input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Construct token list by parsing the input character sequence.
 ITstream (std::string_view s, IOstreamOption streamOpt=IOstreamOption(), const string &name="input")
 Construct token list by parsing the input character sequence.
 ITstream (const string &name, const UList< token > &tokens, IOstreamOption streamOpt=IOstreamOption())
 Copy construct from tokens, with given name.
 ITstream (const string &name, List< token > &&tokens, IOstreamOption streamOpt=IOstreamOption())
 Move construct from tokens, with given name.
virtual ~ITstream ()=default
 Destructor.
virtual const fileNamename () const override
 The name of the input token stream.
virtual fileNamename ()
 The name of the input token stream, for modification.
label startLineNumber () const
 The line number of the first token in stream.
label endLineNumber () const
 The line number of the last token in stream.
const tokenListtokens () const noexcept
 The token contents (read-only access).
tokenListtokens () noexcept
 The token contents (read/write access).
bool hasPutback () const noexcept
 True if putback token is in use.
const tokenfront () const noexcept
 Failsafe peek at the token at the front of the tokenList.
const tokenback () const noexcept
 Failsafe peek at the token at the back of the tokenList.
const tokenpeek () const noexcept
 Failsafe peek at what the next read would return, including handling of any putback.
const tokencurrentToken () const noexcept
 Read access to the token at the current tokenIndex.
tokencurrentToken ()
 Write access to the token at the current tokenIndex. Fatal if not in range.
const tokenpeekToken (const label i) const
 Failsafe read access to token at given position in the tokenList.
label tokenIndex () const noexcept
 The current token index when reading, or the insertion point.
label & tokenIndex () noexcept
 Non-const access to the current token index.
label tokenIndex (label num) noexcept
 Set the token index (no checks).
label nRemainingTokens () const noexcept
 Number of tokens remaining.
void seek (label pos) noexcept
 Move tokenIndex to the specified position and adjust the stream status (open/good/eof ...).
bool skip (label n=1) noexcept
 Move tokenIndex relative to the current position.
labelRange find (const token::punctuationToken delimOpen, const token::punctuationToken delimClose, label pos=0) const
 Find range containing matching delimiter pair, starting at the specified position. The position -1 indicates to continue from the present tokenIndex() position.
template<class Type>
const Type * findCompound (label pos=0) const
 Find compoundToken of specified Type, starting at the specified position. The position -1 indicates to continue from the present tokenIndex() position.
ITstream extract (const labelRange &range)
 Remove a (start,size) subset from the list and move remaining elements down.
label remove (const labelRange &range)
 Remove a (start,size) subset from the list and move remaining elements down.
void add_tokens (const token &tok)
 Copy append a token at the current tokenIndex, incrementing the index.
void add_tokens (token &&tok)
 Move append a token at the current tokenIndex, incrementing the index.
void add_tokens (const UList< token > &toks)
 Copy append a list of tokens at the current tokenIndex, incrementing the index.
void add_tokens (List< token > &&toks)
 Move append a list of tokens at the current tokenIndex, incrementing the index.
virtual std::ios_base::fmtflags flags () const override
 Return current stream flags. Dummy for token stream, returns 0.
std::ios_base::fmtflags flags (std::ios_base::fmtflags) override
 Set stream flags, return old stream flags. Dummy for token stream, returns 0.
virtual Istreamread (token &tok) override
 Return next token from stream.
virtual Istreamread (char &) override
 Read a character : triggers not implemented error.
virtual Istreamread (word &) override
 Read a word : triggers not implemented error.
virtual Istreamread (string &) override
 Read a string (including enclosing double-quotes) : triggers not implemented error.
virtual Istreamread (int32_t &) override
 Read int32_t : triggers not implemented error.
virtual Istreamread (int64_t &) override
 Read int64_t : triggers not implemented error.
virtual Istreamread (uint32_t &) override
 Read uint32_t : triggers not implemented error.
virtual Istreamread (uint64_t &) override
 Read uint64_t : triggers not implemented error.
virtual Istreamread (float &) override
 Read a float : triggers not implemented error.
virtual Istreamread (double &) override
 Read a double : triggers not implemented error.
virtual Istreamread (char *data, std::streamsize) override
 Read binary block : triggers not implemented error.
virtual IstreamreadRaw (char *data, std::streamsize count) override
 Low-level raw binary read : triggers not implemented error.
virtual bool beginRawRead () override
 Start of low-level raw binary read : no-op.
virtual bool endRawRead () override
 End of low-level raw binary read : no-op.
virtual void rewind () override
 Rewind the stream so that it may be read again. Same as seek(0).
void print (Ostream &os) const override
 Print stream description to Ostream.
std::string toString () const
 Concatenate tokens into a space-separated std::string. The resulting string may contain quote characters.
void operator= (const ITstream &is)
 Copy assignment, with rewind().
void operator= (const UList< token > &toks)
 Copy assignment of tokens, with rewind().
void operator= (List< token > &&toks)
 Move assignment of tokens, with rewind().
const tokenpeekFirst () const
 Same as front().
void append (const token &t, bool)
void append (token &&t, bool)
void append (const UList< token > &t, bool)
void append (List< token > &&t, bool)
void push_back (const token &t, bool)
void push_back (token &&t, bool)
void push_back (const UList< token > &t, bool)
void push_back (List< token > &&t, bool)
Istreamoperator() () const
 Return a non-const reference to const Istream.
Public Member Functions inherited from Istream
 Istream (const Istream &)=default
 Copy construct.
virtual ~Istream ()=default
 Destructor.
 Istream (IOstreamOption streamOpt=IOstreamOption())
 Default construct (ASCII, uncompressed), construct with specified stream option.
 Istream (IOstreamOption::streamFormat fmt, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
 Construct with format (uncompressed).
const tokenpeekBack () const noexcept
 Examine putback token without removing it.
void putBackClear ()
 Drop the putback token.
void putBack (const token &tok)
 Put back a token (copy). Only a single put back is permitted.
void putBack (token &&tok)
 Put back a token (move). Only a single put back is permitted.
bool getBack (token &tok)
 Retrieve the put-back token if there is one.
bool readBegin (const char *funcName)
 Begin read of data chunk, starts with '('.
bool readEnd (const char *funcName)
 End read of data chunk, ends with ')'.
char readBeginList (const char *funcName)
 Begin read of list data, starts with '(' or '{'.
char readEndList (const char *funcName)
 End read of list data, ends with ')' or '}'.
Istreamoperator() () const
 Return a non-const reference to const Istream.
Public Member Functions inherited from IOstream
 IOstream (const IOstream &)=default
 Copy construct.
virtual ~IOstream ()=default
 Destructor.
 IOstream (IOstreamOption streamOpt=IOstreamOption())
 Default construct (ASCII, uncompressed), construct with specified stream option.
 IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED)
 Construct with format, version (compression).
fileName relativeName () const
 Return the name of the stream relative to the current case.
virtual bool check (const char *operation) const
 Check IOstream status for given operation.
bool fatalCheck (const char *operation) const
 Check IOstream status for given operation.
bool opened () const noexcept
 True if stream has been opened.
bool closed () const noexcept
 True if stream is closed.
bool good () const noexcept
 True if next operation might succeed.
bool eof () const noexcept
 True if end of input seen.
bool fail () const noexcept
 True if next operation will fail.
bool bad () const noexcept
 True if stream is corrupted.
 operator bool () const noexcept
 True if the stream has not failed.
bool operator! () const noexcept
 True if the stream has failed.
unsigned labelByteSize () const noexcept
 The sizeof (label) in bytes associated with the stream.
unsigned scalarByteSize () const noexcept
 The sizeof (scalar) in bytes associated with the stream.
void setLabelByteSize (unsigned nbytes) noexcept
 Set the sizeof (label) in bytes associated with the stream.
void setScalarByteSize (unsigned nbytes) noexcept
 Set the sizeof (scalar) in bytes associated with the stream.
template<class T, class = std::enable_if_t<std::is_integral_v<T>>>
bool checkLabelSize () const noexcept
 Test if the label byte-size associated with the stream is the same as the given type.
template<class T, class = std::enable_if_t<std::is_floating_point_v<T>>>
bool checkScalarSize () const noexcept
 Test if the scalar byte-size associated with the stream is the same as the given type.
bool checkNativeSizes () const noexcept
 Test if the label/scalar byte-size associated with the stream are the native label/scalar sizes.
bool fatalCheckNativeSizes (const char *operation) const
 Assert that the label/scalar byte-size associated with the stream are the native label/scalar sizes.
label lineNumber () const noexcept
 Const access to the current stream line number.
label & lineNumber () noexcept
 Non-const access to the current stream line number.
label lineNumber (const label num) noexcept
 Set the stream line number.
void setEof () noexcept
 Set stream state as reached 'eof'.
void setFail () noexcept
 Set stream state as 'failed'.
void setBad () noexcept
 Set stream state to be 'bad'.
std::ios_base::fmtflags setf (std::ios_base::fmtflags f)
 Set stream flag(s), return old stream flags.
std::ios_base::fmtflags setf (const std::ios_base::fmtflags f, const std::ios_base::fmtflags mask)
 Set stream flag(s) with mask, return old stream flags.
std::ios_base::fmtflags unsetf (std::ios_base::fmtflags f)
 Unset stream flags, return old stream flags.
void print (Ostream &os, const int streamState) const
 Print information about the stream state bits.
InfoProxy< IOstreaminfo () const noexcept
 Return info proxy, used to print IOstream information to a stream.
Public Member Functions inherited from IOstreamOption
constexpr IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 Default construct (ASCII, UNCOMPRESSED, currentVersion) or construct with format, compression.
constexpr IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept
 Construct from components (format, compression, version).
constexpr IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 Construct from components (format, version, compression).
 IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept
 Copy construct with change of format.
streamFormat format () const noexcept
 Get the current stream format.
streamFormat format (const streamFormat fmt) noexcept
 Set the stream format.
streamFormat format (const word &formatName)
 Set the stream format from string value.
compressionType compression () const noexcept
 Get the stream compression.
compressionType compression (const compressionType comp) noexcept
 Set the stream compression.
compressionType compression (const word &compName)
 Set the stream compression from string value.
versionNumber version () const noexcept
 Get the stream version.
versionNumber version (const versionNumber ver) noexcept
 Set the stream version.
versionNumber version (const token &tok)
 Set the stream version from token.
Public Member Functions inherited from List< token >
constexpr List () noexcept
 Default construct.
 List (const label len)
 Construct with given size.
 List (const label len, const token &val)
 Construct with given size and value for all elements.
 List (const label len, Foam::zero)
 Construct with given size initializing all elements to zero.
 List (Foam::one, const token &val)
 Construct with length=1, copying the value as the only content.
 List (Foam::one, token &&val)
 Construct with length=1, moving the value as the only content.
 List (Foam::one, Foam::zero)
 Construct with length=1, initializing content to zero.
 List (const List< token > &list)
 Copy construct from list.
 List (const UList< token > &list)
 Copy construct contents from list.
 List (List< token > &list, bool reuse)
 Construct as copy or re-use as specified.
 List (const UList< token > &list, const labelUList &indices)
 Copy construct subset of list.
 List (const UList< token > &list, const FixedList< label, N > &indices)
 Copy construct subset of list.
 List (const FixedList< token, N > &list)
 Construct as copy of FixedList<T, N>.
 List (const UPtrList< token > &list)
 Construct as copy of UPtrList<T> content.
 List (const IndirectListBase< token, Addr > &list)
 Construct as copy of IndirectList contents.
 List (std::initializer_list< token > list)
 Construct from an initializer list.
 List (List< token > &&list) noexcept
 Move construct from List.
 List (DynamicList< token, SizeMin > &&list)
 Move construct from DynamicList.
 List (Istream &is)
 Construct from Istream.
autoPtr< List< token > > clone () const
 Clone.
 ~List ()
 Destructor.
void clear ()
 Clear the list, i.e. set size to zero.
void resize (const label len)
 Adjust allocated size of list.
void resize (const label len, const token &val)
 Adjust allocated size of list and set val for new elements.
void resize_copy (label count, const label len)
 Change allocated size of list, retaining the first count elements.
void resize_fill (const label len, const token &val)
 Adjust allocated size of list and set val for all elements.
void resize_nocopy (const label len)
 Adjust allocated size of list without necessarily.
void transfer (List< token > &list)
 Transfer the contents of the argument List into this list and annul the argument list.
void transfer (DynamicList< token, SizeMin > &list)
 Transfer the contents of the argument List into this list and annul the argument list.
tokennewElmt (const label i)
 Return subscript-checked element of UList and resizing the list if required.
tokenemplace_back (Args &&... args)
 Construct an element at the end of the list, return reference to the new list element.
void push_back (const token &val)
 Append an element at the end of the list.
void push_back (token &&val)
 Move append an element at the end of the list.
void push_back (const UList< token > &list)
 Append a List to the end of this list.
void push_back (const IndirectListBase< token, Addr > &list)
 Append IndirectList contents at the end of this list.
label push_uniq (const token &val)
 Append an element if not already in the list.
void pop_back (label n=1)
 Reduce size by 1 or more elements. Can be called on an empty list.
void operator= (const UList< token > &list)
 Assignment to UList operator. Takes linear time.
void operator= (const List< token > &list)
 Assignment operator. Takes linear time.
void operator= (const IndirectListBase< token, Addr > &list)
 Assignment from IndirectList. Takes linear time.
void operator= (const FixedList< token, N > &list)
 Copy assignment from FixedList.
void operator= (std::initializer_list< token > list)
 Assignment to an initializer list.
void operator= (const token &val)
 Assignment of all entries to the given value.
void operator= (Foam::zero)
 Assignment of all entries to zero.
void operator= (List< token > &&list)
 Move assignment. Takes constant time.
void operator= (DynamicList< token, SizeMin > &&list)
 Move assignment. Takes constant time.
IstreamreadList (Istream &is)
 Read List from Istream, discarding contents of existing List.
void shallowCopy (const UList< token > &)=delete
 No shallowCopy permitted.
bool set (const label i, bool val=true)
 A bitSet::set() method for a list of bool.
void append (const token &val)
 Append an element at the end of the list.
void append (token &&val)
 Move append an element at the end of the list.
void append (const UList< token > &list)
 Append a List to the end of this list.
void append (const IndirectListBase< token, Addr > &list)
 Append IndirectList contents at the end of this list.
label appendUniq (const token &val)
 Same as push_uniq().
void setSize (label n)
 Alias for resize().
void setSize (label n, const token &val)
 Alias for resize().
 List (const Expression::ListExpression< E > &expr)
 Construct from value expression.
void operator= (const Expression::ListExpression< E > &expr)
 Assign values from expression.
void resize (const label len)
Public Member Functions inherited from UList< T >
 UList (const UList< T > &) noexcept=default
 Copy construct, shallow copy.
 UList (UList< T > &&) noexcept=default
 Move construct, shallow copy.
UList< T > & operator= (const UList< T > &)=delete
 No copy assignment (default: shallow copy).
UList< T > & operator= (UList< T > &&) noexcept=default
 Move assignment, shallow copy.
constexpr UList () noexcept
 Default construct, zero-sized and nullptr.
 UList (T *__restrict__ ptr, const label len) noexcept
 Construct from components.
 UList (SubList< T > &&) noexcept
 Move construct from a SubList, shallow copy.
label fcIndex (const label i) const noexcept
 The forward circular index. The next index in the list which returns to the first at the end of the list.
label rcIndex (const label i) const noexcept
 The reverse circular index. The previous index in the list which returns to the last at the beginning of the list.
const TfcValue (const label i) const
 Return forward circular value (ie, next value in the list).
TfcValue (const label i)
 Return forward circular value (ie, next value in the list).
const TrcValue (const label i) const
 Return reverse circular value (ie, previous value in the list).
TrcValue (const label i)
 Return reverse circular value (ie, previous value in the list).
const Tcdata () const noexcept
 Return pointer to the underlying array serving as data storage.
Tdata () noexcept
 Return pointer to the underlying array serving as data storage.
const char * cdata_bytes () const noexcept
 Return pointer to the underlying array serving as data storage,.
char * data_bytes () noexcept
 Return pointer to the underlying array serving as data storage,.
Tfront ()
 Access first element of the list, position [0].
const Tfront () const
 Access first element of the list.
Tback ()
 Access last element of the list, position [size()-1].
const Tback () const
 Access last element of the list, position [size()-1].
std::streamsize size_bytes () const noexcept
 Number of contiguous bytes for the List data.
std::streamsize byteSize () const
 Number of contiguous bytes for the List data, runtime FatalError if type is not contiguous.
void checkStart (const label start) const
 Check start is within valid range [0,size).
void checkSize (const label size) const
 Check size is within valid range [0,size].
void checkRange (const label start, const label len) const
 Check that start and length define a valid range.
void checkIndex (const label i) const
 Check index is within valid range [0,size).
bool uniform () const
 True if all entries have identical values, and list is non-empty.
bool contains (const T &val) const
 True if the value is contained in the list.
bool contains (const T &val, label pos, label len=-1) const
 Is the value contained in the list?
label find (const T &val) const
 Find index of the first occurrence of the value.
label find (const T &val, label pos, label len=-1) const
 Find index of the first occurrence of the value.
label rfind (const T &val, label pos=-1) const
 Find index of the last occurrence of the value.
void moveFirst (const label i)
 Move element to the first position.
void moveLast (const label i)
 Move element to the last position.
void swapFirst (const label i)
 Swap element with the first element. Fatal on an empty list.
void swapLast (const label i)
 Swap element with the last element. Fatal on an empty list.
void shallowCopy (T *__restrict__ ptr, const label len) noexcept
 Copy the pointer and size.
void shallowCopy (std::nullptr_t) noexcept
 Copy nullptr and zero size.
void shallowCopy (const UList< T > &list) noexcept
 Copy the pointer and size held by the given UList.
void deepCopy (const UList< T > &list)
 Copy elements of the given UList. Sizes must match!
template<class Addr>
void deepCopy (const IndirectListBase< T, Addr > &list)
 Copy elements of the given indirect list. Sizes must match!
SubList< Tslice (const label pos, label len=-1)
 Return SubList slice (non-const access) - no range checking.
const SubList< Tslice (const label pos, label len=-1) const
 Return SubList slice (const access) - no range checking.
SubList< Tslice (const labelRange &range)
 Return SubList slice (non-const access) - with range checking.
const SubList< Tslice (const labelRange &range) const
 Return SubList slice (const access) - with range checking.
Toperator[] (const label i)
 Return element of UList.
const Toperator[] (const label i) const
 Return element of constant UList.
 operator const Foam::List< T > & () const
 Allow cast to a const List<T>&.
void operator= (const T &val)
 Assignment of all entries to the given value.
void operator= (Foam::zero)
 Assignment of all entries to zero.
iterator begin () noexcept
 Return an iterator to begin traversing the UList.
iterator end () noexcept
 Return an iterator to end traversing the UList.
iterator begin (const label i) noexcept
 Return iterator at offset i from begin, clamped to [0,size] range.
const_iterator cbegin () const noexcept
 Return const_iterator to begin traversing the constant UList.
const_iterator cend () const noexcept
 Return const_iterator to end traversing the constant UList.
const_iterator begin () const noexcept
 Return const_iterator to begin traversing the constant UList.
const_iterator end () const noexcept
 Return const_iterator to end traversing the constant UList.
const_iterator cbegin (const label i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,size] range.
const_iterator begin (const label i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,size] range.
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.
bool empty () const noexcept
 True if List is empty (ie, size() is zero).
label size () const noexcept
 The number of elements in the container.
label capacity () const noexcept
 Size of the underlying storage.
void swap (UList< T > &list) noexcept
 Swap content with another UList of the same type in constant time.
bool operator== (const UList< T > &list) const
 Equality operation on ULists of the same type.
bool operator!= (const UList< T > &list) const
 The opposite of the equality operation. Takes linear time.
bool operator< (const UList< T > &list) const
 Compare two ULists lexicographically. Takes linear time.
bool operator> (const UList< T > &list) const
 Compare two ULists lexicographically. Takes linear time.
bool operator<= (const UList< T > &list) const
 Return true if !(a > b). Takes linear time.
bool operator>= (const UList< T > &list) const
 Return true if !(a < b). Takes linear time.
IstreamreadList (Istream &is)
 Read List contents from Istream.
void writeEntry (const word &keyword, Ostream &os) const
 Write the List as a dictionary entry with keyword.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write List, with line-breaks in ASCII when length exceeds shortLen.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool all () const
 True if all entries are 'true' or if the list is empty.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool any () const
 True if any entries are 'true'.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool none () const
 True if no entries are 'true'.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool test (const label i) const
 Test bool value at specified position, always false for out-of-range access.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool get (const label i) const
 Return bool value at specified position, always false for out-of-range access.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_bool_v<TypeT>>>
bool unset (const label i)
 Unset the bool entry at specified position, always false for out-of-range access.
template<class TypeT = T, class = std::enable_if_t<stdFoam::is_char_v<TypeT>>>
std::string_view view () const
 Return a string_view of the charList. Content is non-modifiable.
Tfirst ()
 Access first element of the list, position [0].
const Tfirst () const
 Access first element of the list.
Tlast ()
 Access last element of the list, position [size()-1].
const Tlast () const
 Access last element of the list, position [size()-1].
bool found (const T &val, label pos=0) const
 Same as contains().
auto expr () const
 Wrap value as expression.
template<typename E>
void operator= (const Expression::ListExpression< E > &expr)
 Assign values from expression.

Static Public Member Functions

static ITstreamempty_stream ()
 Return reference to an empty ITstream, for functions needing to return an ITstream reference but which don't have anything valid of their own. The stream shall be considered read-only..
static tokenList parse (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
 Create token list by parsing the input character sequence until no good tokens remain.
static tokenList parse (const char *input, IOstreamOption streamOpt=IOstreamOption())
 Create token list by parsing the input character sequence until no good tokens remain.
static tokenList parse (std::string_view s, IOstreamOption streamOpt=IOstreamOption())
 Create token list by parsing the input character sequence until no good tokens remain.
Static Public Member Functions inherited from IOstream
static unsigned int defaultPrecision () noexcept
 Return the default precision.
static unsigned int defaultPrecision (unsigned int prec) noexcept
 Reset the default precision.
static unsigned int minPrecision (unsigned int prec) noexcept
 Set the minimum default precision.
Static Public Member Functions inherited from IOstreamOption
static floatFormat floatFormatEnum (const word &fmtName, const floatFormat deflt=floatFormat::general)
 Lookup floatFormat enum corresponding to the string (general | fixed | scientific).
static floatFormat floatFormatEnum (const word &key, const dictionary &dict, const floatFormat deflt=floatFormat::general)
 getOrDefault floatFormat from dictionary, warn only on bad enumeration.
static streamFormat formatEnum (const word &fmtName, const streamFormat deflt=streamFormat::ASCII)
 Lookup streamFormat enum corresponding to the string (ascii | binary).
static streamFormat formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII)
 getOrDefault streamFormat from dictionary, warn only on bad enumeration.
static compressionType compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
 The compression enum corresponding to the string.
static compressionType compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED)
 getOrDefault compressionType from dictionary, warn only on bad enumeration.
Static Public Member Functions inherited from List< token >
static const List< token > & null () noexcept
 Return a null List (reference to a nullObject). Behaves like an empty List.
Static Public Member Functions inherited from UList< T >
static const UList< T > & null () noexcept
 Return a null UList (reference to a nullObject). Behaves like an empty UList.
static constexpr label max_size () noexcept
 The size of the largest possible UList.

Additional Inherited Members

Public Types inherited from IOstream
enum  streamAccess : char { CLOSED = 0 , OPENED }
 Enumeration for stream open/closed state. More...
Public Types inherited from IOstreamOption
enum  streamFormat : char { ASCII = 0 , BINARY , COHERENT , UNKNOWN_FORMAT }
 Data format (ascii | binary | coherent). More...
enum  compressionType : char { UNCOMPRESSED = 0 , COMPRESSED }
 Compression treatment (UNCOMPRESSED | COMPRESSED). More...
enum  appendType : char {
  NO_APPEND = 0 , APPEND_APP , APPEND_ATE , NON_APPEND = NO_APPEND ,
  APPEND = APPEND_APP
}
 File appending (NO_APPEND | APPEND_APP | APPEND_ATE). More...
enum  atomicType : char { NON_ATOMIC = 0 , ATOMIC }
 Atomic operations (output). More...
enum class  floatFormat : unsigned { general = unsigned(0) , fixed = unsigned(std::ios_base::fixed) , scientific = unsigned(std::ios_base::scientific) }
 Float formats (eg, time directory name formats). More...
Public Types inherited from List< token >
typedef SubList< tokensubList
 Declare type of subList.
Public Types inherited from UList< T >
typedef T value_type
 The value type the list contains.
typedef Tpointer
 The pointer type for non-const access to value_type items.
typedef const Tconst_pointer
 The pointer type for const access to value_type items.
typedef Treference
 The type used for storing into value_type objects.
typedef const Tconst_reference
 The type used for reading from constant value_type objects.
typedef Titerator
 Random access iterator for traversing a UList.
typedef const Tconst_iterator
 Random access iterator for traversing a UList.
typedef label size_type
 The type to represent the size of a UList.
typedef label difference_type
 The difference between iterator objects.
typedef std::reverse_iterator< iteratorreverse_iterator
 Reverse iterator (non-const access).
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Reverse iterator (const access).
using is_List = void
 Have unique tag.
Static Public Attributes inherited from IOstream
static unsigned int precision_
 Default precision.
Static Public Attributes inherited from IOstreamOption
static const Enum< floatFormatfloatFormatNames
 Names for float formats (general, fixed, scientific).
static const Enum< streamFormatformatNames
 Stream format names (ascii, binary).
static const versionNumber currentVersion
 The current version number (2.0).
Protected Member Functions inherited from Istream
bool hasPutback () const noexcept
 True if putback token is in use.
Protected Member Functions inherited from IOstream
void setOpened () noexcept
 Set stream opened.
void setClosed () noexcept
 Set stream closed.
void setState (std::ios_base::iostate state) noexcept
 Set stream state.
void setGood () noexcept
 Set stream state to be good.
Protected Member Functions inherited from UList< T >
void setAddressableSize (const label n) noexcept
 Set addressed size to be inconsistent with allocated storage.
void size (const label n)
 Older name for setAddressableSize.
void writeEntry (Ostream &os) const
 Write the UList with its compound type.
labelRange validateRange (const labelRange &requestedRange) const
 Return a validated (start,size) subset range, which means that it always addresses a valid section of the list.
void fill_uniform (const T &val)
 Assign all entries to the given value.
void fill_uniform (Foam::zero)
 Assign all entries to zero.
Protected Attributes inherited from IOstream
std::ios_base::iostate ioState_
 Mirror of internal stream io state.
streamAccess openClosed_
 The stream open/closed state.
unsigned char sizeofLabel_
 The sizeof (label), possibly read from the header.
unsigned char sizeofScalar_
 The sizeof (scalar), possibly read from the header.
label lineNumber_
 The file line.
Static Protected Attributes inherited from IOstream
static fileName staticName_
 Name for any generic stream - normally treat as readonly.

Detailed Description

An input stream of tokens.

Although ITstream is principally meant to be used as a read-only input stream, it also provides additional methods to help when composing its contents (eg, when parsing).

Source files

Definition at line 52 of file ITstream.H.

Constructor & Destructor Documentation

◆ ITstream() [1/11]

◆ ITstream() [2/11]

ITstream ( ITstream && is)

Move construct.

Definition at line 160 of file ITstream.C.

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

Here is the call graph for this function:

◆ ITstream() [3/11]

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

Default construct. Empty stream, optionally with given name.

Definition at line 172 of file ITstream.C.

References IOstreamOption::format(), Istream::Istream(), name(), IOstream::setGood(), IOstream::setOpened(), and IOstreamOption::version().

Here is the call graph for this function:

◆ ITstream() [4/11]

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

Construct empty, optionally with given name.

Definition at line 188 of file ITstream.C.

References ITstream(), and name().

Here is the call graph for this function:

◆ ITstream() [5/11]

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

Copy construct from tokens, optionally with given name.

Definition at line 199 of file ITstream.C.

References IOstreamOption::format(), Istream::Istream(), name(), IOstream::setGood(), IOstream::setOpened(), tokens(), and IOstreamOption::version().

Here is the call graph for this function:

◆ ITstream() [6/11]

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

Move construct from tokens, optionally with given name.

Definition at line 216 of file ITstream.C.

References IOstreamOption::format(), Istream::Istream(), name(), IOstream::setGood(), IOstream::setOpened(), tokens(), and IOstreamOption::version().

Here is the call graph for this function:

◆ ITstream() [7/11]

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

Construct token list by parsing the input character sequence.

Uses static parse function internally.

Definition at line 233 of file ITstream.C.

References UList< T >::cdata(), ITstream(), name(), and UList< T >::size_bytes().

Here is the call graph for this function:

◆ ITstream() [8/11]

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

Construct token list by parsing the input character sequence.

Uses static parse function internally.

Definition at line 246 of file ITstream.C.

References ITstream(), and name().

Here is the call graph for this function:

◆ ITstream() [9/11]

ITstream ( std::string_view s,
IOstreamOption streamOpt = IOstreamOption(),
const string & name = "input" )
inlineexplicit

Construct token list by parsing the input character sequence.

Uses static parse function internally.

Definition at line 199 of file ITstream.H.

References ITstream(), name(), and s().

Here is the call graph for this function:

◆ ITstream() [10/11]

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

Copy construct from tokens, with given name.

Definition at line 217 of file ITstream.H.

References ITstream(), name(), and tokens().

Here is the call graph for this function:

◆ ITstream() [11/11]

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

Move construct from tokens, with given name.

Definition at line 230 of file ITstream.H.

References ITstream(), name(), and tokens().

Here is the call graph for this function:

◆ ~ITstream()

virtual ~ITstream ( )
virtualdefault

Destructor.

References ITstream().

Here is the call graph for this function:

Member Function Documentation

◆ empty_stream()

Foam::ITstream & empty_stream ( )
static

Return reference to an empty ITstream, for functions needing to return an ITstream reference but which don't have anything valid of their own. The stream shall be considered read-only..

The returned stream has no tokens and has a 'bad' state, to indicate that it is invalid for reading.

\caution the caller is still able to modify its contents, but they should not do that!

Definition at line 63 of file ITstream.C.

References IOstream::setBad().

Referenced by meshRefinement::lookup(), and dictionaryEntry::stream().

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

◆ parse() [1/3]

tokenList parse ( const UList< char > & input,
IOstreamOption streamOpt = IOstreamOption() )
inlinestatic

Create token list by parsing the input character sequence until no good tokens remain.

Definition at line 267 of file ITstream.H.

References UList< T >::cdata(), and UList< T >::size().

Referenced by dictionary::tokens().

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

◆ parse() [2/3]

tokenList parse ( const char * input,
IOstreamOption streamOpt = IOstreamOption() )
inlinestatic

Create token list by parsing the input character sequence until no good tokens remain.

Definition at line 280 of file ITstream.H.

◆ parse() [3/3]

tokenList parse ( std::string_view s,
IOstreamOption streamOpt = IOstreamOption() )
inlinestatic

Create token list by parsing the input character sequence until no good tokens remain.

Definition at line 300 of file ITstream.H.

References s().

Here is the call graph for this function:

◆ name() [1/2]

virtual const fileName & name ( ) const
inlineoverridevirtual

The name of the input token stream.

Reimplemented from IOstream.

Reimplemented in primitiveEntry.

Definition at line 317 of file ITstream.H.

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

Here is the caller graph for this function:

◆ name() [2/2]

virtual fileName & name ( )
inlinevirtual

The name of the input token stream, for modification.

Reimplemented in primitiveEntry.

Definition at line 322 of file ITstream.H.

◆ startLineNumber()

label startLineNumber ( ) const
inline

The line number of the first token in stream.

Definition at line 327 of file ITstream.H.

References UList< T >::empty(), UList< T >::front(), and IOstream::lineNumber().

Referenced by primitiveEntry::startLineNumber().

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

◆ endLineNumber()

label endLineNumber ( ) const
inline

The line number of the last token in stream.

Definition at line 335 of file ITstream.H.

References UList< T >::back(), UList< T >::empty(), and IOstream::lineNumber().

Referenced by primitiveEntry::endLineNumber().

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

◆ tokens() [1/2]

const tokenList & tokens ( ) const
inlinenoexcept

The token contents (read-only access).

Definition at line 346 of file ITstream.H.

References Foam::noexcept.

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

Here is the caller graph for this function:

◆ tokens() [2/2]

tokenList & tokens ( )
inlinenoexcept

The token contents (read/write access).

Definition at line 351 of file ITstream.H.

References Foam::noexcept.

◆ hasPutback()

bool hasPutback ( ) const
inlinenoexcept

True if putback token is in use.

Definition at line 357 of file ITstream.H.

References Istream::hasPutback(), and Foam::noexcept.

Referenced by exprValue::peekType().

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

◆ front()

const token & front ( ) const
inlinenoexcept

Failsafe peek at the token at the front of the tokenList.

Returns
undefinedToken if the list is empty.

Definition at line 364 of file ITstream.H.

References Foam::noexcept.

Referenced by peekFirst().

Here is the caller graph for this function:

◆ back()

const token & back ( ) const
inlinenoexcept

Failsafe peek at the token at the back of the tokenList.

Returns
undefinedToken if the list is empty.

Definition at line 374 of file ITstream.H.

References Foam::noexcept, and UList< T >::size().

Here is the call graph for this function:

◆ peek()

const Foam::token & peek ( ) const
noexcept

Failsafe peek at what the next read would return, including handling of any putback.

Returns
undefinedToken if list is exhausted

Definition at line 327 of file ITstream.C.

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

Referenced by exprValue::peekType(), Foam::readScaling(), and exprValue::readTokens().

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

◆ currentToken() [1/2]

const token & currentToken ( ) const
inlinenoexcept

Read access to the token at the current tokenIndex.

Returns
undefinedToken if list is exhausted

Definition at line 391 of file ITstream.H.

References currentToken(), and Foam::noexcept.

Referenced by currentToken().

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

◆ currentToken() [2/2]

Foam::token & currentToken ( )

Write access to the token at the current tokenIndex. Fatal if not in range.

Definition at line 339 of file ITstream.C.

References Foam::abort(), Foam::FatalIOError, FatalIOErrorInFunction, UList< T >::operator[](), UList< T >::size(), and UList< T >::size().

Here is the call graph for this function:

◆ peekToken()

const token & peekToken ( const label i) const
inline

Failsafe read access to token at given position in the tokenList.

Returns
undefinedToken for out-of-range

Definition at line 407 of file ITstream.H.

◆ tokenIndex() [1/3]

label tokenIndex ( ) const
inlinenoexcept

The current token index when reading, or the insertion point.

Definition at line 412 of file ITstream.H.

References Foam::noexcept.

Referenced by exprValue::peekType(), and exprValue::read().

Here is the caller graph for this function:

◆ tokenIndex() [2/3]

label & tokenIndex ( )
inlinenoexcept

Non-const access to the current token index.

Definition at line 417 of file ITstream.H.

References Foam::noexcept.

◆ tokenIndex() [3/3]

label tokenIndex ( label num)
inlinenoexcept

Set the token index (no checks).

Returns
the previous value

Definition at line 422 of file ITstream.H.

◆ nRemainingTokens()

label nRemainingTokens ( ) const
inlinenoexcept

Number of tokens remaining.

Definition at line 432 of file ITstream.H.

References Foam::noexcept, and UList< T >::size().

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

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

◆ seek()

void seek ( label pos)
noexcept

Move tokenIndex to the specified position and adjust the stream status (open/good/eof ...).

Using seek(0) is identical to rewind(). Using seek(-1) moves to the end.

Definition at line 353 of file ITstream.C.

References UList< T >::cdata(), UList< T >::empty(), IOstream::lineNumber_, Foam::pos(), IOstream::setEof(), IOstream::setGood(), IOstream::setOpened(), UList< T >::size(), and UList< T >::size().

Referenced by extract(), operator=(), operator=(), operator=(), exprValue::read(), primitiveEntry::read(), rewind(), primitiveEntry::stream(), and primitiveEntry::streamPtr().

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

◆ skip()

bool skip ( label n = 1)
noexcept

Move tokenIndex relative to the current position.

Will not overrun the beginning (0) or one-past end positions.

Use skip(2) to move forward two tokens. Use skip(-2) to move backward two tokens.

Returns
True if the indexing completed without underflow/overflow

Definition at line 385 of file ITstream.C.

References UList< T >::cdata(), UList< T >::empty(), IOstream::lineNumber_, n, IOstream::setEof(), IOstream::setGood(), IOstream::setOpened(), UList< T >::size(), and UList< T >::size().

Referenced by primitiveEntry::read(), primitiveEntry::read(), and exprValue::readTokens().

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

◆ find()

Foam::labelRange find ( const token::punctuationToken delimOpen,
const token::punctuationToken delimClose,
label pos = 0 ) const

Find range containing matching delimiter pair, starting at the specified position. The position -1 indicates to continue from the present tokenIndex() position.

Definition at line 484 of file ITstream.C.

References token::isPunctuation(), UList< T >::operator[](), Foam::pos(), UList< T >::size(), and UList< T >::slice().

Here is the call graph for this function:

◆ findCompound()

template<class Type>
const Type * findCompound ( label pos = 0) const

Find compoundToken of specified Type, starting at the specified position. The position -1 indicates to continue from the present tokenIndex() position.

Returns
nullptr if not found

Definition at line 22 of file ITstreamI.H.

References UList< T >::operator[](), Foam::pos(), and UList< T >::size().

Here is the call graph for this function:

◆ extract()

Foam::ITstream extract ( const labelRange & range)

Remove a (start,size) subset from the list and move remaining elements down.

If the tokenIndex() is within or to the right of the removed region, it will be adjusted to remain valid. However, this may not correspond to the expected parsing point so external bookkeeping is likely necessary.

Note
The range is subsetted with the list size itself to ensure the result always addresses a valid section of the list.

Definition at line 538 of file ITstream.C.

References UList< T >::begin(), UList< T >::first(), ITstream(), IOstream::labelByteSize(), UList< T >::last(), name, range, List< T >::resize(), IOstream::scalarByteSize(), seek(), IOstream::setLabelByteSize(), IOstream::setScalarByteSize(), UList< T >::size(), and UList< T >::slice().

Here is the call graph for this function:

◆ remove()

Foam::label remove ( const labelRange & range)

Remove a (start,size) subset from the list and move remaining elements down.

If the tokenIndex() is within or to the right of the removed region, it will be adjusted to remain valid. However, this may not correspond to the expected parsing point so external bookkeeping is likely necessary.

Note
The range is subsetted with the list size itself to ensure the result always addresses a valid section of the list.

Definition at line 573 of file ITstream.C.

References range, UList< T >::size(), and UList< T >::slice().

Referenced by primitiveEntry::read().

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

◆ add_tokens() [1/4]

void add_tokens ( const token & tok)

Copy append a token at the current tokenIndex, incrementing the index.

Definition at line 709 of file ITstream.C.

References UList< T >::operator[]().

Referenced by append(), append(), append(), append(), push_back(), push_back(), push_back(), push_back(), and exprValue::read().

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

◆ add_tokens() [2/4]

void add_tokens ( token && tok)

Move append a token at the current tokenIndex, incrementing the index.

Definition at line 718 of file ITstream.C.

References UList< T >::operator[]().

Here is the call graph for this function:

◆ add_tokens() [3/4]

void add_tokens ( const UList< token > & toks)

Copy append a list of tokens at the current tokenIndex, incrementing the index.

Definition at line 727 of file ITstream.C.

References UList< T >::begin(), and UList< T >::size().

Here is the call graph for this function:

◆ add_tokens() [4/4]

void add_tokens ( List< token > && toks)

Move append a list of tokens at the current tokenIndex, incrementing the index.

Definition at line 737 of file ITstream.C.

References UList< T >::begin().

Here is the call graph for this function:

◆ flags() [1/2]

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

Return current stream flags. Dummy for token stream, returns 0.

Implements IOstream.

Definition at line 547 of file ITstream.H.

References flags().

Referenced by flags().

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

◆ flags() [2/2]

std::ios_base::fmtflags flags ( std::ios_base::fmtflags )
inlineoverridevirtual

Set stream flags, return old stream flags. Dummy for token stream, returns 0.

Implements IOstream.

Definition at line 556 of file ITstream.H.

◆ read() [1/11]

Foam::Istream & read ( token & tok)
overridevirtual

◆ read() [2/11]

Foam::Istream & read ( char & )
overridevirtual

Read a character : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 632 of file ITstream.C.

References NotImplemented.

◆ read() [3/11]

Foam::Istream & read ( word & )
overridevirtual

Read a word : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 639 of file ITstream.C.

References NotImplemented.

◆ read() [4/11]

Foam::Istream & read ( string & )
overridevirtual

Read a string (including enclosing double-quotes) : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 646 of file ITstream.C.

References NotImplemented.

◆ read() [5/11]

Foam::Istream & read ( int32_t & )
overridevirtual

Read int32_t : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 653 of file ITstream.C.

References NotImplemented.

◆ read() [6/11]

Foam::Istream & read ( int64_t & )
overridevirtual

Read int64_t : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 660 of file ITstream.C.

References NotImplemented.

◆ read() [7/11]

Foam::Istream & read ( uint32_t & )
overridevirtual

Read uint32_t : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 667 of file ITstream.C.

References NotImplemented.

◆ read() [8/11]

Foam::Istream & read ( uint64_t & )
overridevirtual

Read uint64_t : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 674 of file ITstream.C.

References NotImplemented.

◆ read() [9/11]

Foam::Istream & read ( float & )
overridevirtual

Read a float : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 681 of file ITstream.C.

References NotImplemented.

◆ read() [10/11]

Foam::Istream & read ( double & )
overridevirtual

Read a double : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 688 of file ITstream.C.

References NotImplemented.

◆ read() [11/11]

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

Read binary block : triggers not implemented error.

Implements Istream.

Reimplemented in primitiveEntry.

Definition at line 702 of file ITstream.C.

References NotImplemented.

◆ readRaw()

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

Low-level raw binary read : triggers not implemented error.

Implements Istream.

Definition at line 695 of file ITstream.C.

References NotImplemented.

◆ beginRawRead()

virtual bool beginRawRead ( )
inlineoverridevirtual

Start of low-level raw binary read : no-op.

Implements Istream.

Definition at line 628 of file ITstream.H.

◆ endRawRead()

virtual bool endRawRead ( )
inlineoverridevirtual

End of low-level raw binary read : no-op.

Implements Istream.

Definition at line 633 of file ITstream.H.

◆ rewind()

virtual void rewind ( )
inlineoverridevirtual

Rewind the stream so that it may be read again. Same as seek(0).

Implements Istream.

Definition at line 638 of file ITstream.H.

References Istream::rewind(), and seek().

Referenced by Foam::exprTools::getList().

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

◆ print()

void print ( Ostream & os) const
overridevirtual

Print stream description to Ostream.

Reimplemented from IOstream.

Definition at line 264 of file ITstream.C.

References UList< T >::back(), UList< T >::empty(), UList< T >::front(), IOstream::lineNumber(), os(), and IOstream::print().

Here is the call graph for this function:

◆ toString()

std::string toString ( ) const

Concatenate tokens into a space-separated std::string. The resulting string may contain quote characters.

Definition at line 289 of file ITstream.C.

References UList< T >::cbegin(), UList< T >::cend(), UList< T >::empty(), UList< T >::front(), UList< T >::last(), OSstream::precision(), UList< T >::size(), token::SPACE, OCharStream::view(), and UList< T >::view().

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)

Copy assignment, with rewind().

Definition at line 750 of file ITstream.C.

References ITstream(), List< token >::operator=(), and seek().

Here is the call graph for this function:

◆ operator=() [2/3]

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

Copy assignment of tokens, with rewind().

Definition at line 763 of file ITstream.C.

References List< token >::operator=(), and seek().

Here is the call graph for this function:

◆ operator=() [3/3]

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

Move assignment of tokens, with rewind().

Definition at line 770 of file ITstream.C.

References List< token >::operator=(), and seek().

Here is the call graph for this function:

◆ peekFirst()

const token & peekFirst ( ) const
inline

Same as front().

Definition at line 720 of file ITstream.H.

References front(), and peekFirst().

Referenced by peekFirst().

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

◆ append() [1/4]

void append ( const token & t,
bool  )
inline

Definition at line 723 of file ITstream.H.

References add_tokens(), and append().

Referenced by append(), append(), append(), and append().

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

◆ append() [2/4]

void append ( token && t,
bool  )
inline

Definition at line 726 of file ITstream.H.

References add_tokens(), and append().

Here is the call graph for this function:

◆ append() [3/4]

void append ( const UList< token > & t,
bool  )
inline

Definition at line 729 of file ITstream.H.

References add_tokens(), and append().

Here is the call graph for this function:

◆ append() [4/4]

void append ( List< token > && t,
bool  )
inline

Definition at line 732 of file ITstream.H.

References add_tokens(), and append().

Here is the call graph for this function:

◆ push_back() [1/4]

void push_back ( const token & t,
bool  )
inline

Definition at line 735 of file ITstream.H.

References add_tokens(), and push_back().

Referenced by push_back(), push_back(), push_back(), and push_back().

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

◆ push_back() [2/4]

void push_back ( token && t,
bool  )
inline

Definition at line 738 of file ITstream.H.

References add_tokens(), and push_back().

Here is the call graph for this function:

◆ push_back() [3/4]

void push_back ( const UList< token > & t,
bool  )
inline

Definition at line 741 of file ITstream.H.

References add_tokens(), and push_back().

Here is the call graph for this function:

◆ push_back() [4/4]

void push_back ( List< token > && t,
bool  )
inline

Definition at line 744 of file ITstream.H.

References add_tokens(), and push_back().

Here is the call graph for this function:

◆ operator()()

Foam::Istream & operator() ( ) const

Return a non-const reference to const Istream.

Definition at line 282 of file Istream.C.


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