Commit d3afab9c authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding macro getter via module call in core

parent aa529134
...@@ -5096,6 +5096,14 @@ CVAStruct CVACoreImpl::CallObject( const CVAStruct& oArgs ) ...@@ -5096,6 +5096,14 @@ CVAStruct CVACoreImpl::CallObject( const CVAStruct& oArgs )
oReturn[ "searchpaths" ] = oSearchPaths; oReturn[ "searchpaths" ] = oSearchPaths;
} }
if( oArgs.HasKey( "getmacros" ) )
{
CVAStruct oMacros;
for( auto& macro : m_oCoreConfig.mMacros.GetMacroMapCopy() )
oMacros[ macro.first ] = macro.second;
oReturn[ "macros" ] = oMacros;
}
if( oArgs.HasKey( "getloglevel" ) ) if( oArgs.HasKey( "getloglevel" ) )
{ {
oReturn[ "loglevel" ] = VALog_GetLogLevel(); oReturn[ "loglevel" ] = VALog_GetLogLevel();
......
...@@ -54,3 +54,8 @@ std::string CVAMacroMap::SubstituteMacros( const std::string& sStr ) const ...@@ -54,3 +54,8 @@ std::string CVAMacroMap::SubstituteMacros( const std::string& sStr ) const
return sOutput; return sOutput;
} }
std::map< std::string, std::string > CVAMacroMap::GetMacroMapCopy() const
{
return m_mMacroMap;
}
...@@ -29,6 +29,8 @@ public: ...@@ -29,6 +29,8 @@ public:
// Makros in einem String durch deren Werte ersetzen // Makros in einem String durch deren Werte ersetzen
std::string SubstituteMacros( const std::string& sStr ) const; std::string SubstituteMacros( const std::string& sStr ) const;
std::map< std::string, std::string > GetMacroMapCopy() const;
private: private:
// Macros $(...) = ... // Macros $(...) = ...
std::map< std::string, std::string > m_mMacroMap; std::map< std::string, std::string > m_mMacroMap;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment