38 #ifndef Foam_dynamicCodeContext_H 39 #define Foam_dynamicCodeContext_H 59 std::reference_wrapper<const dictionary> dict_;
171 void append(
const std::string& str)
190 bool mandatory =
true,
191 bool withLineNum =
true 202 bool withLineNum =
true dynamicCodeContext()
Default construct.
const string & include() const noexcept
The code includes.
const string & localCode() const noexcept
The local (file-scope) code.
void setCodeContext(const dictionary &dict)
Set code context from a dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void append(const std::string &str)
Add content to SHA1 hashing.
const entry * findEntry(const word &key) const
Locate literal dictionary entry, nullptr if not found.
const dictionary & dict() const noexcept
Return the parent dictionary context.
const string & options() const noexcept
The code options (Make/options)
A class for handling words, derived from Foam::string.
static unsigned addLineDirective(string &code, label lineNum, const string &file)
Prefix a #line directive to code.
const string & code() const noexcept
The code.
Encapsulation of dynamic code dictionaries.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
bool valid() const noexcept
Considered valid if not using dictionary::null as the context.
void append(char c)
Append single character.
const string & libs() const noexcept
The code libs (LIB_LIBS)
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
bool readEntry(const word &key, string &str, bool mandatory=true, bool withLineNum=true)
Read string entry from context dictionary append content to SHA1 hashing and add line number etc...
static void inplaceExpand(string &str, const dictionary &dict)
Cleanup string and expand with dictionary parameters.
A keyword and a list of tokens is an 'entry'.
const SHA1 & sha1() const noexcept
The SHA1 calculated from options, libs, include, code, etc.
bool readIfPresent(const word &key, string &str, bool withLineNum=true)
Read optional string entry from context dictionary, append content to SHA1 hashing and add line numbe...