diff options
Diffstat (limited to '')
-rw-r--r-- | src/functionregexp.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/functionregexp.cpp b/src/functionregexp.cpp index d1491e6..57a1725 100644 --- a/src/functionregexp.cpp +++ b/src/functionregexp.cpp | |||
@@ -12,7 +12,7 @@ FunctionRegexp::~FunctionRegexp() | |||
12 | { | 12 | { |
13 | } | 13 | } |
14 | 14 | ||
15 | void FunctionRegexp::execute( const StringList &lInput, StringList &lOutput ) | 15 | void FunctionRegexp::execute( Build *bld, const StringList &lInput, StringList &lOutput ) |
16 | { | 16 | { |
17 | if( lParams.size() == 1 ) | 17 | if( lParams.size() == 1 ) |
18 | { | 18 | { |
@@ -24,6 +24,16 @@ void FunctionRegexp::execute( const StringList &lInput, StringList &lOutput ) | |||
24 | if( re.execute( (*i).c_str() ) ) | 24 | if( re.execute( (*i).c_str() ) ) |
25 | { | 25 | { |
26 | lOutput.push_back( *i ); | 26 | lOutput.push_back( *i ); |
27 | if( bld ) | ||
28 | { | ||
29 | int jmax = re.getNumSubStrings(); | ||
30 | for( int j = 0; j < jmax; j++ ) | ||
31 | { | ||
32 | char buf[30]; | ||
33 | sprintf( buf, "re:%d", j ); | ||
34 | bld->set( *i, buf, re.getSubString( j ) ); | ||
35 | } | ||
36 | } | ||
27 | } | 37 | } |
28 | } | 38 | } |
29 | } | 39 | } |
@@ -32,3 +42,10 @@ void FunctionRegexp::execute( const StringList &lInput, StringList &lOutput ) | |||
32 | } | 42 | } |
33 | } | 43 | } |
34 | 44 | ||
45 | Function *FunctionRegexp::duplicate( Build &bld, const std::string &cont, VarMap *mExtra ) | ||
46 | { | ||
47 | Function *pRet = new FunctionRegexp(); | ||
48 | pRet->copyData( this, bld, cont, mExtra ); | ||
49 | return pRet; | ||
50 | } | ||
51 | |||