environmentVariable Class Reference

The environmentVariable substitution model. More...

Inheritance diagram for environmentVariable:
Collaboration diagram for environmentVariable:

Public Member Functions

 TypeName ("environmentVariable")
 Runtime type information. More...
 
 environmentVariable (const dictionary &dict, const Time &time)
 Constructor. More...
 
virtual ~environmentVariable ()=default
 Destructor. More...
 
virtual bool valid (const word &keyName) const
 Return true of model applies to this keyName. More...
 
virtual bool apply (const word &key, string &buffer) const
 Apply substitutions to this string buffer. More...
 
virtual wordList keys () const
 Return a word list of the keys. More...
 
- Public Member Functions inherited from substitutionModel
 TypeName ("substitutionModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, substitutionModel, dictionary,(const dictionary &dict, const Time &time),(dict, time))
 
 substitutionModel (const dictionary &dict, const Time &time)
 Constructor. More...
 
virtual ~substitutionModel ()=default
 Destructor. More...
 
virtual bool update ()
 Update model local data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from substitutionModel
static string keyify (const word &w)
 Return a key representation from a word. More...
 
static word cleanKey (const string &str)
 Clean the key text. More...
 
static wordList getKeys (string &buffer)
 Return all keys from a string buffer. More...
 
static void addBuiltinStr (const word &key, const string &value)
 Add a builtin to the hash table - does not overwrite. More...
 
template<class Type >
static void addBuiltin (const word &key, const Type &value)
 Add a builtin to the hash table - does not overwrite. More...
 
static bool containsBuiltin (const word &key)
 Return true if key is builtin. More...
 
static void setBuiltinStr (const word &key, const string &value)
 Set a builtin to the hash table. More...
 
template<class Type >
static void setBuiltin (const word &key, const Type &value)
 Set a builtin to the hash table. More...
 
static bool replaceBuiltin (const word &key, string &str)
 Replace key in string. More...
 
static bool replaceBuiltin (string &str)
 Replace all occurrences of key in string. More...
 
static void writeBuiltins (Ostream &os)
 Write all builtins to stream. More...
 
static autoPtr< substitutionModelNew (const dictionary &dict, const Time &time)
 Return a reference to the selected substitution model. More...
 
- Static Public Attributes inherited from substitutionModel
static const word KEY_BEGIN = "{{"
 Keyword starting characters. More...
 
static const word KEY_END = "}}"
 Keyword ending characters. More...
 
static HashTable< stringbuiltin_
 Built-in substitutions. More...
 
- Protected Attributes inherited from substitutionModel
const dictionary dict_
 Construction dictionary. More...
 
const Timetime_
 Reference to the time database. More...
 

Detailed Description

The environmentVariable substitution model.

environmentVariables1
{
    // Mandatory entries
    type        environmentVariable;

    entries
    {
        home    "HOME";
        ldpath  "LD_LIBRARY_PATH";
    }

    // Inherited entries
    ...
}

The entries mean:

Property Description Type Reqd Deflt
type Type name: environmentVariable word yes -
entries Keyword lookup pairs dictionary yes -

The inherited entries are elaborated in:

Source files

Definition at line 94 of file environmentVariable.H.

Constructor & Destructor Documentation

◆ environmentVariable()

environmentVariable ( const dictionary dict,
const Time time 
)

Constructor.

Definition at line 44 of file environmentVariable.C.

References dict, and Foam::constant::electromagnetic::e.

◆ ~environmentVariable()

virtual ~environmentVariable ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "environmentVariable"  )

Runtime type information.

◆ valid()

bool valid ( const word keyName) const
virtual

Return true of model applies to this keyName.

Implements substitutionModel.

Definition at line 64 of file environmentVariable.C.

◆ apply()

bool apply ( const word key,
string buffer 
) const
virtual

Apply substitutions to this string buffer.

Implements substitutionModel.

Definition at line 73 of file environmentVariable.C.

References Foam::env(), Foam::getEnv(), Foam::glTF::key(), and string::replaceAll().

Here is the call graph for this function:

◆ keys()

Foam::wordList keys ( ) const
virtual

Return a word list of the keys.

Implements substitutionModel.

Definition at line 88 of file environmentVariable.C.


The documentation for this class was generated from the following files: