aboutsummaryrefslogtreecommitdiff
path: root/src/build.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/build.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/build.cpp b/src/build.cpp
index 372e607..255cbd3 100644
--- a/src/build.cpp
+++ b/src/build.cpp
@@ -17,14 +17,14 @@ void Build::setStringProc( StringProc *pStrProc )
17 this->pStrProc = pStrProc; 17 this->pStrProc = pStrProc;
18} 18}
19 19
20std::string Build::replVars( const std::string &sSrc, const std::string &sCont ) 20std::string Build::replVars( const std::string &sSrc, const std::string &sCont, VarMap *mExtra )
21{ 21{
22 if( pStrProc == NULL ) 22 if( pStrProc == NULL )
23 throw BuildException( 23 throw BuildException(
24 "No valid string processor was registered with the Build object." 24 "No valid string processor was registered with the Build object."
25 ); 25 );
26 26
27 return pStrProc->replVars( sSrc, sCont ); 27 return pStrProc->replVars( sSrc, sCont, mExtra );
28} 28}
29 29
30void Build::execAction( const std::string &sWhat ) 30void Build::execAction( const std::string &sWhat )
@@ -113,16 +113,25 @@ void Build::setAdd( const std::string &cont, const std::string &var, const std::
113{ 113{
114 if( cont == "" ) 114 if( cont == "" )
115 { 115 {
116 mVars[var] = getVar( cont, var ) + " " + val; 116 mVars[var] = getVar( cont, var, NULL ) + " " + val;
117 } 117 }
118 else 118 else
119 { 119 {
120 mContVars[cont][var] = getVar( cont, var ) + " " + val; 120 mContVars[cont][var] = getVar( cont, var, NULL ) + " " + val;
121 } 121 }
122} 122}
123 123
124std::string Build::getVar( const std::string &cont, const std::string &var ) 124std::string Build::getVar( const std::string &cont, const std::string &var, VarMap *mExtra )
125{ 125{
126 if( mExtra != NULL )
127 {
128 if( mExtra->find(var) == mExtra->end() )
129 {
130 return getVar( cont, var, NULL );
131 }
132 return (*mExtra)[var];
133 }
134
126 if( cont == "" ) 135 if( cont == "" )
127 { 136 {
128 if( mVars.find(var) == mVars.end() ) 137 if( mVars.find(var) == mVars.end() )
@@ -142,7 +151,7 @@ std::string Build::getVar( const std::string &cont, const std::string &var )
142 { 151 {
143 if( mContVars[cont].find(var) == mContVars[cont].end() ) 152 if( mContVars[cont].find(var) == mContVars[cont].end() )
144 { 153 {
145 mContVars[cont][var] = getVar( "", var ); 154 mContVars[cont][var] = getVar( "", var, NULL );
146 } 155 }
147 return mContVars[cont][var]; 156 return mContVars[cont][var];
148 } 157 }