new helper function Replace()
Modified: trunk/reactos/tools/rbuild/module.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
_____
Modified: trunk/reactos/tools/rbuild/module.cpp
--- trunk/reactos/tools/rbuild/module.cpp 2005-08-24 04:00:37 UTC
(rev 17504)
+++ trunk/reactos/tools/rbuild/module.cpp 2005-08-24 05:50:21 UTC
(rev 17505)
@@ -24,6 +24,25 @@
using std::vector;
string
+Replace ( const string& s, const string& find, const string& with )
+{
+ string ret;
+ const char* p = s.c_str();
+ while ( p )
+ {
+ const char* p2 = strstr ( p, find.c_str() );
+ if ( !p2 )
+ break;
+ if ( p2 > p )
+ ret += string ( p, p2-p );
+ p = p2 + find.size();
+ }
+ if ( *p )
+ ret += *p;
+ return ret;
+}
+
+string
FixSeparator ( const string& s )
{
string s2(s);
_____
Modified: trunk/reactos/tools/rbuild/rbuild.h
--- trunk/reactos/tools/rbuild/rbuild.h 2005-08-24 04:00:37 UTC (rev
17504)
+++ trunk/reactos/tools/rbuild/rbuild.h 2005-08-24 05:50:21 UTC (rev
17505)
@@ -739,6 +739,8 @@
std::string StripSymbol ( std::string symbol );
};
+extern std::string
+Replace ( const std::string& s, const std::string& find, const
std::string& with );
extern std::string
FixSeparator ( const std::string& s );
Show replies by date