Go to the documentation of this file.
38 #ifndef dynamicCodeContext_H
39 #define dynamicCodeContext_H
59 std::reference_wrapper<const dictionary> dict_;
123 bool valid()
const noexcept;
135 const string&
options() const noexcept
141 const string&
libs() const noexcept
147 const string&
include() const noexcept
159 const string&
code() const noexcept
171 void append(
const std::string& str)
190 bool mandatory =
true,
191 bool withLineNum =
true
202 bool withLineNum =
true
const string & localCode() const noexcept
The local (file-scope) code.
A keyword and a list of tokens is an 'entry'.
SHA1 & append(const char *str)
Append data for processing.
A class for handling words, derived from Foam::string.
bool readEntry(const word &key, string &str, bool mandatory=true, bool withLineNum=true)
Functions to compute SHA1 message digest according to the NIST specification FIPS-180-1.
bool valid() const noexcept
Considered valid if not using dictionary::null as the context.
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 readIfPresent(const word &key, string &str, bool withLineNum=true)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
const dictionary & dict() const noexcept
Return the parent dictionary context.
dynamicCodeContext()
Default construct.
void append(const std::string &str)
Add content to SHA1 hashing.
const SHA1 & sha1() const noexcept
The SHA1 calculated from options, libs, include, code, etc.
const entry * findEntry(const word &key) const
Locate literal dictionary entry, nullptr if not found.
const string & libs() const noexcept
The code libs (LIB_LIBS)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void setCodeContext(const dictionary &dict)
Set code context from a dictionary.
const string & include() const noexcept
The code includes.
static void inplaceExpand(string &str, const dictionary &dict)
Cleanup string and expand with dictionary parameters.
static unsigned addLineDirective(string &code, label lineNum, const string &file)
Prefix a #line directive to code.
const string & code() const noexcept
The code.
const string & options() const noexcept
The code options (Make/options)