38#ifndef Foam_dynamicCodeContext_H
39#define Foam_dynamicCodeContext_H
59 std::reference_wrapper<const dictionary> dict_;
123 bool good()
const noexcept;
126 bool valid()
const noexcept {
return good(); }
138 const string&
options()
const noexcept
144 const string&
libs()
const noexcept
150 const string&
include()
const noexcept
174 void append(
const std::string& str)
193 bool mandatory =
true,
194 bool withLineNum =
true
205 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,...
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)
Read optional string entry from context dictionary, append content to SHA1 hashing and add line numbe...
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 good() const noexcept
Not using dummy code context (dictionary::null).
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.
const string & localCode() const noexcept
The local (file-scope) code.
bool valid() const noexcept
Same as good().
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.