diff options
Diffstat (limited to 'src/nodemetadata.h')
-rw-r--r-- | src/nodemetadata.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nodemetadata.h b/src/nodemetadata.h index 24779a1ea..262b64d74 100644 --- a/src/nodemetadata.h +++ b/src/nodemetadata.h @@ -55,7 +55,7 @@ public: i = m_stringvars.find(name); if(i == m_stringvars.end()) return ""; - return i->second; + return resolveString(i->second); } void setString(const std::string &name, const std::string &var) { @@ -64,6 +64,13 @@ public: else m_stringvars[name] = var; } + // support variable names in values + std::string resolveString(const std::string &str) const + { + if(str.substr(0,2) == "${" && str[str.length()-1] == '}') + return resolveString(getString(str.substr(2,str.length()-3))); + return str; + } std::map<std::string, std::string> getStrings() const { return m_stringvars; |