The userValue substitution model. Dictionaries can be retrieved from an object registry, e.g. time, mesh, or from a file.
More...
#include <userValue.H>


Public Member Functions | |
| TypeName ("userValue") | |
| Runtime type information. | |
| userValue (const dictionary &dict, const Time &time) | |
| Constructor. | |
| virtual | ~userValue ()=default |
| Destructor. | |
| virtual bool | valid (const word &keyName) const |
| Return true of model applies to this keyName. | |
| virtual bool | apply (const word &key, string &buffer) const |
| Apply substitutions to this string buffer. | |
| virtual wordList | keys () const |
| Return a word list of the keys. | |
| Public Member Functions inherited from substitutionModel | |
| TypeName ("substitutionModel") | |
| Runtime type information. | |
| declareRunTimeSelectionTable (autoPtr, substitutionModel, dictionary,(const dictionary &dict, const Time &time),(dict, time)) | |
| substitutionModel (const dictionary &dict, const Time &time) | |
| Constructor. | |
| virtual | ~substitutionModel ()=default |
| Destructor. | |
| virtual bool | update () |
| Update model local data. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from substitutionModel | |
| static string | keyify (const word &w) |
| Return a key representation from a word. | |
| static word | cleanKey (const string &str) |
| Clean the key text. | |
| static wordList | getKeys (string &buffer) |
| Return all keys from a string buffer. | |
| static void | addBuiltinStr (const word &key, const string &value) |
| Add a builtin to the hash table - does not overwrite. | |
| template<class Type> | |
| static void | addBuiltin (const word &key, const Type &value) |
| Add a builtin to the hash table - does not overwrite. | |
| static bool | containsBuiltin (const word &key) |
| Return true if key is builtin. | |
| static void | setBuiltinStr (const word &key, const string &value) |
| Set a builtin to the hash table. | |
| template<class Type> | |
| static void | setBuiltin (const word &key, const Type &value) |
| Set a builtin to the hash table. | |
| static bool | replaceBuiltin (const word &key, string &str) |
| Replace key in string. | |
| static bool | replaceBuiltin (string &str) |
| Replace all occurrences of key in string. | |
| static void | writeBuiltins (Ostream &os) |
| Write all builtins to stream. | |
| static autoPtr< substitutionModel > | New (const dictionary &dict, const Time &time) |
| Return a reference to the selected substitution model. | |
| Static Public Attributes inherited from substitutionModel | |
| static const word | KEY_BEGIN = "{{" |
| Keyword starting characters. | |
| static const word | KEY_END = "}}" |
| Keyword ending characters. | |
| static HashTable< string > | builtin_ |
| Built-in substitutions. | |
| Protected Attributes inherited from substitutionModel | |
| const dictionary | dict_ |
| Construction dictionary. | |
| const Time & | time_ |
| Reference to the time database. | |
The userValue substitution model. Dictionaries can be retrieved from an object registry, e.g. time, mesh, or from a file.
userValues1
{
// Mandatory entries
type userValue;
entries
{
my_keyword1 "My local string value";
my_keyword2 "My local string value";
}
// Inherited entries
...
}
The entries mean:
| Property | Description | Type | Reqd | Deflt |
|---|---|---|---|---|
type | Type name: userValue | word | yes | - |
entries | Keyword lookup pairs | dictionary | yes | - |
The inherited entries are elaborated in:
Definition at line 95 of file userValue.H.
| userValue | ( | const dictionary & | dict, |
| const Time & | time ) |
Constructor.
Definition at line 43 of file userValue.C.
References substitutionModel::cleanKey(), dict, and e.

|
virtualdefault |
Destructor.
| TypeName | ( | "userValue" | ) |
Runtime type information.
References dict.
|
virtual |
Return true of model applies to this keyName.
Implements substitutionModel.
Definition at line 63 of file userValue.C.
Referenced by apply().

Apply substitutions to this string buffer.
Implements substitutionModel.
Definition at line 72 of file userValue.C.
References substitutionModel::keyify(), string::replaceAll(), and valid().

|
virtual |
Return a word list of the keys.
Implements substitutionModel.
Definition at line 86 of file userValue.C.