diff options
author | marha <marha@users.sourceforge.net> | 2009-08-04 11:56:03 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-08-04 11:56:03 +0000 |
commit | e5838b892c8f8041868d3ee08110261cde13e098 (patch) | |
tree | f69d9e97a800f62bcf8798199559b0d96abd14a9 /tools/mhmake/src/functions.cpp | |
parent | e2cafb0970b536247274e86ae949beeb7ab1e814 (diff) | |
download | vcxsrv-e5838b892c8f8041868d3ee08110261cde13e098.tar.gz vcxsrv-e5838b892c8f8041868d3ee08110261cde13e098.tar.bz2 vcxsrv-e5838b892c8f8041868d3ee08110261cde13e098.zip |
- Made copy command recursive when copying a directory.
- When -q is specified output nothing.
- Solved problem when mhmake is run from inside Visual Studio
(output of cl.exe was send directly to the IDE instead of stdout)
- Added strip function
- Now use the svn info command to get the revision from the working copy.
- Removed VC6 solution file.
Diffstat (limited to 'tools/mhmake/src/functions.cpp')
-rw-r--r-- | tools/mhmake/src/functions.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/mhmake/src/functions.cpp b/tools/mhmake/src/functions.cpp index 4ae9ddd2e..9564610f8 100644 --- a/tools/mhmake/src/functions.cpp +++ b/tools/mhmake/src/functions.cpp @@ -51,6 +51,7 @@ funcdef mhmakefileparser::m_FunctionsDef[]= { ,{"filter-out" ,&mhmakefileparser::f_filterout}
,{"word" ,&mhmakefileparser::f_word}
,{"words" ,&mhmakefileparser::f_words}
+ ,{"strip" ,&mhmakefileparser::f_strip}
};
map<string,function_f> mhmakefileparser::m_Functions;
@@ -625,6 +626,20 @@ string mhmakefileparser::f_words(const string & Arg) const }
///////////////////////////////////////////////////////////////////////////////
+// Removes leading and trailing space
+string mhmakefileparser::f_strip(const string & Arg) const
+{
+ string::const_iterator pFirst=Arg.begin();
+ string::const_iterator pLast=Arg.end();
+ while (strchr(" \t",*pFirst) && pFirst!=pLast) pFirst++;
+ if (pFirst==pLast)
+ return "";
+ while (strchr(" \t",*(--pLast)));
+ pLast++;
+ return Arg.substr(pFirst-Arg.begin(),pLast-pFirst);
+}
+
+///////////////////////////////////////////////////////////////////////////////
static string dir(const string &FileName,const string &)
{
int Pos=FileName.find_last_of(OSPATHSEP);
|