A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read, written and printed, and the types and values of its tokens analysed. More...
Public Member Functions | |
primitiveEntry (const keyType &key) | |
primitiveEntry (const keyType &key, const token &tok) | |
primitiveEntry (const keyType &key, const UList< token > &tokens) | |
primitiveEntry (const keyType &key, List< token > &&tokens) | |
primitiveEntry (const keyType &key, const ITstream &is) | |
primitiveEntry (const keyType &key, Istream &is) | |
primitiveEntry (const keyType &key, const dictionary &dict, Istream &is) | |
template<class T > | |
primitiveEntry (const keyType &key, const T &val) | |
autoPtr< entry > | clone (const dictionary &) const |
virtual const fileName & | name () const |
virtual fileName & | name () |
virtual fileName | relativeName () const |
virtual label | startLineNumber () const |
virtual label | endLineNumber () const |
virtual bool | isStream () const noexcept |
virtual ITstream & | stream () const |
virtual const dictionary & | dict () const |
virtual dictionary & | dict () |
virtual bool | read (const dictionary &dict, Istream &is) |
virtual void | write (Ostream &os) const |
void | write (Ostream &os, const bool contentsOnly) const |
InfoProxy< primitiveEntry > | info () const |
virtual Istream & | read (token &tok) |
virtual Istream & | read (char &) |
virtual Istream & | read (word &) |
virtual Istream & | read (string &) |
virtual Istream & | read (label &) |
virtual Istream & | read (floatScalar &) |
virtual Istream & | read (doubleScalar &) |
virtual Istream & | read (char *data, std::streamsize) |
![]() | |
entry (const keyType &keyword) | |
entry (const entry &e) | |
virtual autoPtr< entry > | clone () const |
virtual | ~entry ()=default |
const keyType & | keyword () const noexcept |
keyType & | keyword () noexcept |
virtual bool | isDict () const noexcept |
virtual const dictionary * | dictPtr () const noexcept |
virtual dictionary * | dictPtr () noexcept |
void | checkITstream (const ITstream &is) const |
template<class T > | |
T | get () const |
template<class T > | |
void | readEntry (T &val) const |
template<class T , class Predicate > | |
T | getCheck (const Predicate &pred) const |
template<class T , class Predicate > | |
void | readCheck (T &val, const Predicate &pred) const |
void | operator= (const entry &e) |
bool | operator== (const entry &e) const |
bool | operator!= (const entry &e) const |
![]() | |
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 token & | peekFirst () const |
const token & | peekLast () const |
const token & | peek () const |
label | tokenIndex () const noexcept |
label & | tokenIndex () noexcept |
label | nRemainingTokens () const noexcept |
void | seek (label pos) |
void | skip (label n=1) |
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 Istream & | read (token &tok) |
virtual Istream & | read (char &) |
virtual Istream & | read (word &) |
virtual Istream & | read (string &) |
virtual Istream & | read (label &) |
virtual Istream & | read (floatScalar &) |
virtual Istream & | read (doubleScalar &) |
virtual Istream & | read (char *data, std::streamsize) |
virtual Istream & | readRaw (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) |
![]() | |
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 token & | peekBack () 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) |
Istream & | operator() () const |
![]() | |
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< IOstream > | info () const |
![]() | |
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) |
![]() | |
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) |
T & | newElmt (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) |
Istream & | readList (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) |
Istream & | readList (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) | |
Istream & | readList (Istream &is) |
Additional Inherited Members | |
![]() | |
enum | inputMode { MERGE, OVERWRITE, PROTECT, WARN, ERROR, GLOBAL } |
![]() | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
![]() | |
typedef SubList< T > | subList |
![]() | |
static bool | New (dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0) |
static autoPtr< entry > | New (Istream &is) |
static void | resetInputMode () |
![]() | |
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 unsigned int | defaultPrecision () noexcept |
static unsigned int | defaultPrecision (unsigned int prec) noexcept |
![]() | |
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 const List< T > & | null () |
![]() | |
static int | disableFunctionEntries |
static inputMode | globalInputMode = inputMode::MERGE |
![]() | |
static unsigned int | precision_ |
![]() | |
static const Enum< streamFormat > | formatNames |
static const versionNumber | currentVersion |
![]() | |
bool | hasPutback () const noexcept |
![]() | |
void | setOpened () noexcept |
void | setClosed () noexcept |
void | setState (std::ios_base::iostate state) noexcept |
void | setGood () noexcept |
![]() | |
static void | reportReadWarning (const IOstream &, const std::string &) |
![]() | |
std::ios_base::iostate | ioState_ |
streamAccess | openClosed_ |
unsigned char | sizeofLabel_ |
unsigned char | sizeofScalar_ |
label | lineNumber_ |
![]() | |
static fileName | staticName_ |
A keyword and a list of tokens comprise a primitiveEntry. A primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
A primitiveEntry is a high-level building block for data description. It is a front-end for the token parser. A list of entries can be used as a set of keyword syntax elements, for example.
Definition at line 59 of file primitiveEntry.H.
|
explicit |
Definition at line 211 of file primitiveEntry.C.
Referenced by primitiveEntry::clone().
primitiveEntry | ( | const keyType & | key, |
const token & | tok | ||
) |
Definition at line 218 of file primitiveEntry.C.
primitiveEntry | ( | const keyType & | key, |
const UList< token > & | tokens | ||
) |
Definition at line 226 of file primitiveEntry.C.
primitiveEntry | ( | const keyType & | key, |
List< token > && | tokens | ||
) |
Definition at line 237 of file primitiveEntry.C.
primitiveEntry | ( | const keyType & | key, |
const ITstream & | is | ||
) |
Definition at line 247 of file primitiveEntry.C.
References Foam::glTF::key(), and ITstream::name().
primitiveEntry | ( | const keyType & | key, |
Istream & | is | ||
) |
Definition at line 261 of file primitiveEntryIO.C.
primitiveEntry | ( | const keyType & | key, |
const dictionary & | dict, | ||
Istream & | is | ||
) |
Definition at line 243 of file primitiveEntryIO.C.
References dict.
primitiveEntry | ( | const keyType & | key, |
const T & | val | ||
) |
Definition at line 28 of file primitiveEntryTemplates.C.
References token::END_STATEMENT, dictionary::null, and os().
|
inlinevirtual |
Implements entry.
Definition at line 130 of file primitiveEntry.H.
References primitiveEntry::primitiveEntry().
|
inlinevirtual |
Implements entry.
Definition at line 142 of file primitiveEntry.H.
References ITstream::name().
|
inlinevirtual |
Implements entry.
Definition at line 148 of file primitiveEntry.H.
References ITstream::name().
|
inlinevirtual |
Implements entry.
Definition at line 154 of file primitiveEntry.H.
References IOstream::relativeName().
|
virtual |
Implements entry.
Definition at line 258 of file primitiveEntry.C.
|
virtual |
Implements entry.
Definition at line 271 of file primitiveEntry.C.
|
inlinevirtualnoexcept |
Reimplemented from entry.
Definition at line 166 of file primitiveEntry.H.
|
virtual |
Implements entry.
Definition at line 284 of file primitiveEntry.C.
References ITstream::rewind().
|
virtual |
Implements entry.
Definition at line 292 of file primitiveEntry.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and dictionary::null.
|
virtual |
Implements entry.
|
virtual |
Definition at line 103 of file primitiveEntryIO.C.
References IOstream::bad(), token::BEGIN_BLOCK, token::BEGIN_LIST, Foam::constant::universal::c, dict, token::END_BLOCK, token::END_LIST, token::END_STATEMENT, IOstream::fatalCheck(), FUNCTION_NAME, token::good(), token::isPunctuation(), token::pToken(), and Istream::read().
|
virtual |
Implements entry.
Reimplemented in functionEntry.
Definition at line 297 of file primitiveEntryIO.C.
References Foam::vtk::write().
Referenced by Foam::entryToString().
Definition at line 269 of file primitiveEntryIO.C.
References token::END_STATEMENT, Foam::endl(), os(), token::SPACE, OBJstream::write(), and Ostream::writeKeyword().
|
inline |
Definition at line 193 of file primitiveEntry.H.
Foam::Istream & read |
Definition at line 446 of file ITstream.C.
Foam::Istream & read |
Definition at line 498 of file ITstream.C.
Foam::Istream & read |
Definition at line 505 of file ITstream.C.
Foam::Istream & read |
Definition at line 512 of file ITstream.C.
Foam::Istream & read |
Definition at line 519 of file ITstream.C.
Foam::Istream & read |
Definition at line 526 of file ITstream.C.
Foam::Istream & read |
Definition at line 533 of file ITstream.C.
Foam::Istream & read |
Definition at line 547 of file ITstream.C.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.