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