MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / getKeyword

Function getKeyword

src/OpenFOAM/db/dictionary/entry/entryIO.C:37–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
36
37bool Foam::entry::getKeyword(keyType& keyword, token& keywordToken, Istream& is)
38{
39 // Read the next valid token discarding spurious ';'s
40 do
41 {
42 if
43 (
44 is.read(keywordToken).bad()
45 || is.eof()
46 || !keywordToken.good()
47 )
48 {
49 return false;
50 }
51 }
52 while (keywordToken == token::END_STATEMENT);
53
54 // If the token is a valid keyword set 'keyword' return true...
55 if (keywordToken.isWord())
56 {
57 keyword = keywordToken.wordToken();
58 return true;
59 }
60 else if (keywordToken.isString())
61 {
62 // Enable wildcards
63 keyword = keywordToken.stringToken();
64 return true;
65 }
66 else
67 {
68 return false;
69 }
70}
71
72
73bool Foam::entry::getKeyword(keyType& keyword, Istream& is)

Callers 2

NewFunction · 0.85
entryIO.CFile · 0.85

Calls 7

eofMethod · 0.80
isWordMethod · 0.80
isStringMethod · 0.80
badMethod · 0.45
readMethod · 0.45
goodMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected