Commit 38482b46 authored by Brad King's avatar Brad King

ENH: Merged use of the kwsys RegularExpression class instead of cmRegularExpression.

parent b2368399
......@@ -35,6 +35,7 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
SET(KWSYS_NAMESPACE cmsys)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_Directory 1)
SET(KWSYS_USE_RegularExpression 1)
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SUBDIRS(Source/kwsys)
......
......@@ -5,7 +5,6 @@ cmake.cxx
cmakewizard.cxx
cmMakeDepend.cxx
cmMakefile.cxx
cmRegularExpression.cxx
cmSourceFile.cxx
cmSystemTools.cxx
cmDocumentation.cxx
......@@ -25,7 +24,6 @@ cmake.h
cmakewizard.h
cmMakeDepend.h
cmMakefile.h
cmRegularExpression.h
cmSourceFile.h
cmSystemTools.h
cmDynamicLoader.h
......
......@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmBuildNameCommand.h"
#include <cmsys/RegularExpression.hxx>
// cmBuildNameCommand
bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args)
{
......@@ -28,7 +30,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args)
if(cacheValue)
{
// do we need to correct the value?
cmRegularExpression reg("[()/]");
cmsys::RegularExpression reg("[()/]");
if (reg.find(cacheValue))
{
std::string cv = cacheValue;
......@@ -53,7 +55,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string> const& args)
if(buildname.length())
{
std::string RegExp = "([^ ]*) [^ ]* ([^ ]*) ";
cmRegularExpression reg( RegExp.c_str() );
cmsys::RegularExpression reg( RegExp.c_str() );
if(reg.find(buildname.c_str()))
{
buildname = reg.match(1) + "-" + reg.match(2);
......
......@@ -15,10 +15,11 @@
=========================================================================*/
#include "cmCTest.h"
#include "cmRegularExpression.h"
#include "cmSystemTools.h"
#include "cmListFileCache.h"
#include <cmsys/RegularExpression.hxx>
#ifdef HAVE_CURL
# include "cmCTestSubmit.h"
# include "curl/curl.h"
......@@ -590,10 +591,10 @@ int cmCTest::UpdateDirectory()
std::vector<cmStdString> lines;
cmSystemTools::Split(goutput.c_str(), lines);
std::cout << "Updated; gathering version information" << std::endl;
cmRegularExpression date_author("^date: +([^;]+); +author: +([^;]+); +state: +[^;]+;");
cmRegularExpression revision("^revision +([^ ]*) *$");
cmRegularExpression end_of_file("^=============================================================================$");
cmRegularExpression end_of_comment("^----------------------------$");
cmsys::RegularExpression date_author("^date: +([^;]+); +author: +([^;]+); +state: +[^;]+;");
cmsys::RegularExpression revision("^revision +([^ ]*) *$");
cmsys::RegularExpression end_of_file("^=============================================================================$");
cmsys::RegularExpression end_of_comment("^----------------------------$");
std::string current_path = "";
bool first_file = true;
......@@ -974,7 +975,7 @@ int cmCTest::BuildDirectory()
// Errors
for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ )
{
cmRegularExpression re(cmCTestErrorMatches[cc]);
cmsys::RegularExpression re(cmCTestErrorMatches[cc]);
std::vector<std::string>::size_type kk;
for ( kk = 0; kk < lines.size(); kk ++ )
{
......@@ -987,7 +988,7 @@ int cmCTest::BuildDirectory()
// Warnings
for ( cc = 0; cmCTestWarningMatches[cc]; cc ++ )
{
cmRegularExpression re(cmCTestWarningMatches[cc]);
cmsys::RegularExpression re(cmCTestWarningMatches[cc]);
std::vector<std::string>::size_type kk;
for ( kk = 0; kk < lines.size(); kk ++ )
{
......@@ -1000,7 +1001,7 @@ int cmCTest::BuildDirectory()
// Errors exceptions
for ( cc = 0; cmCTestErrorExceptions[cc]; cc ++ )
{
cmRegularExpression re(cmCTestErrorExceptions[cc]);
cmsys::RegularExpression re(cmCTestErrorExceptions[cc]);
std::vector<int>::size_type kk;
for ( kk =0; kk < markedLines.size(); kk ++ )
{
......@@ -1016,7 +1017,7 @@ int cmCTest::BuildDirectory()
// Warning exceptions
for ( cc = 0; cmCTestWarningExceptions[cc]; cc ++ )
{
cmRegularExpression re(cmCTestWarningExceptions[cc]);
cmsys::RegularExpression re(cmCTestWarningExceptions[cc]);
std::vector<int>::size_type kk;
for ( kk =0; kk < markedLines.size(); kk ++ )
{
......@@ -1614,9 +1615,9 @@ void cmCTest::ProcessDirectory(std::vector<std::string> &passed,
int firstTest = 1;
long line = 0;
cmRegularExpression ireg(this->m_IncludeRegExp.c_str());
cmRegularExpression ereg(this->m_ExcludeRegExp.c_str());
cmRegularExpression dartStuff("([\t\n ]*<DartMeasurement.*/DartMeasurement[a-zA-Z]*>[\t ]*[\n]*)");
cmsys::RegularExpression ireg(this->m_IncludeRegExp.c_str());
cmsys::RegularExpression ereg(this->m_ExcludeRegExp.c_str());
cmsys::RegularExpression dartStuff("([\t\n ]*<DartMeasurement.*/DartMeasurement[a-zA-Z]*>[\t ]*[\n]*)");
bool parseError;
while ( fin )
......
......@@ -19,9 +19,10 @@
#include "cmSystemTools.h"
#include "cmCacheManager.h"
#include "cmMakefile.h"
#include "cmRegularExpression.h"
#include "stdio.h"
#include <cmsys/RegularExpression.hxx>
#if defined(_WIN32) || defined(__CYGWIN__)
# include <windows.h>
#endif // _WIN32
......@@ -84,9 +85,9 @@ bool cmCacheManager::ParseEntry(const char* entry,
CacheEntryType& type)
{
// input line is: key:type=value
cmRegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
// input line is: "key":type=value
cmRegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
cmsys::RegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
bool flag = false;
if(regQuoted.find(entry))
{
......
......@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmConfigureFileCommand.h"
#include <cmsys/RegularExpression.hxx>
// cmConfigureFileCommand
bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args)
{
......@@ -106,7 +108,7 @@ void cmConfigureFileCommand::ConfigureFile()
// now copy input to output and expand variables in the
// input file at the same time
std::string inLine;
cmRegularExpression cmdefine("#cmakedefine[ \t]*([A-Za-z_0-9]*)");
cmsys::RegularExpression cmdefine("#cmakedefine[ \t]*([A-Za-z_0-9]*)");
while( cmSystemTools::GetLineFromStream(fin, inLine) )
{
m_Makefile->ExpandVariablesInString(inLine, m_EscapeQuotes, m_AtOnly);
......
......@@ -17,6 +17,8 @@
#include "cmIfCommand.h"
#include <stdlib.h> // required for atof
#include <cmsys/RegularExpression.hxx>
bool cmIfFunctionBlocker::
IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
{
......@@ -217,7 +219,7 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args,
if (args.size() == 3 && (args[1] == "MATCHES"))
{
def = cmIfCommand::GetVariableOrString(args[0].c_str(), makefile);
cmRegularExpression regEntry(args[2].c_str());
cmsys::RegularExpression regEntry(args[2].c_str());
// check for black line or comment
if (!regEntry.find(def))
......
......@@ -16,7 +16,8 @@
=========================================================================*/
#include "cmListFileCache.h"
#include "cmSystemTools.h"
#include "cmRegularExpression.h"
#include <cmsys/RegularExpression.hxx>
cmListFileCache* cmListFileCache::Instance = 0;
......@@ -174,10 +175,10 @@ bool cmListFileCache::ParseFunction(std::ifstream& fin,
{
++line;
RemoveComments(inbuffer);
cmRegularExpression blankLine("^[ \t\r]*$");
cmRegularExpression oneLiner("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)\\)[ \t\r]*$");
cmRegularExpression multiLine("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)$");
cmRegularExpression lastLine("^(.*)\\)[ \t\r]*$");
cmsys::RegularExpression blankLine("^[ \t\r]*$");
cmsys::RegularExpression oneLiner("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)\\)[ \t\r]*$");
cmsys::RegularExpression multiLine("^[ \t]*([A-Za-z_0-9]*)[ \t]*\\((.*)$");
cmsys::RegularExpression lastLine("^(.*)\\)[ \t\r]*$");
// check for blank line or comment
if(blankLine.find(inbuffer.c_str()) )
......@@ -258,9 +259,9 @@ void cmListFileCache::GetArguments(std::string& line,
std::vector<cmListFileArgument>& arguments)
{
// Match a normal argument (not quoted, no spaces).
cmRegularExpression normalArgument("[ \t]*(([^ \t\r\\]|[\\].)+)[ \t\r]*");
cmsys::RegularExpression normalArgument("[ \t]*(([^ \t\r\\]|[\\].)+)[ \t\r]*");
// Match a quoted argument (surrounded by double quotes, spaces allowed).
cmRegularExpression quotedArgument("[ \t]*(\"([^\"\\]|[\\].)*\")[ \t\r]*");
cmsys::RegularExpression quotedArgument("[ \t]*(\"([^\"\\]|[\\].)*\")[ \t\r]*");
bool done = false;
while(!done)
......
......@@ -16,6 +16,7 @@
=========================================================================*/
#include "cmLoadCacheCommand.h"
#include <cmsys/RegularExpression.hxx>
// cmLoadCacheCommand
bool cmLoadCacheCommand::InitialPass(std::vector<std::string> const& args)
......@@ -202,9 +203,9 @@ bool cmLoadCacheCommand::ParseEntry(const char* entry, std::string& var,
std::string& value)
{
// input line is: key:type=value
cmRegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
cmsys::RegularExpression reg("^([^:]*):([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
// input line is: "key":type=value
cmRegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
cmsys::RegularExpression regQuoted("^\"([^\"]*)\":([^=]*)=(.*[^\t ]|[\t ]*)[\t ]*$");
bool flag = false;
if(regQuoted.find(entry))
{
......
......@@ -22,6 +22,8 @@ PURPOSE. See the above copyright notices for more information.
#include "cmCacheManager.h"
#include "cmake.h"
#include <cmsys/RegularExpression.hxx>
cmLocalCodeWarriorGenerator::cmLocalCodeWarriorGenerator()
{
}
......@@ -168,9 +170,9 @@ void cmLocalCodeWarriorGenerator::WriteSettingList(std::ostream& fout,
// library paths
// now add in the libraries we depend on
cmRegularExpression isAframework("[ \t]*\\-framework");
cmRegularExpression isEnvironment("\\${");
cmRegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
cmsys::RegularExpression isAframework("[ \t]*\\-framework");
cmsys::RegularExpression isEnvironment("\\${");
cmsys::RegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
const cmTarget::LinkLibraries& libs = l->GetLinkLibraries();
cmTarget::LinkLibraries::const_iterator lib = libs.begin();
for(; lib != libs.end(); ++lib)
......@@ -564,9 +566,9 @@ void cmLocalCodeWarriorGenerator::WriteFileList(std::ostream& fout,
}
// now add in the libraries we depend on
cmRegularExpression isAframework("[ \t]*\\-framework");
cmRegularExpression isEnvironment("\\${");
cmRegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
cmsys::RegularExpression isAframework("[ \t]*\\-framework");
cmsys::RegularExpression isEnvironment("\\${");
cmsys::RegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
const cmTarget::LinkLibraries& libs = l->GetLinkLibraries();
cmTarget::LinkLibraries::const_iterator lib = libs.begin();
for(; lib != libs.end(); ++lib)
......@@ -694,9 +696,9 @@ void cmLocalCodeWarriorGenerator::WriteLinkOrder(std::ostream& fout,
}
// now add in the libraries we depend on
cmRegularExpression isAframework("[ \t]*\\-framework");
cmRegularExpression isEnvironment("\\${");
cmRegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
cmsys::RegularExpression isAframework("[ \t]*\\-framework");
cmsys::RegularExpression isEnvironment("\\${");
cmsys::RegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
const cmTarget::LinkLibraries& libs = l->GetLinkLibraries();
cmTarget::LinkLibraries::const_iterator lib = libs.begin();
......@@ -814,7 +816,7 @@ void cmLocalCodeWarriorGenerator::WriteLinkOrder(std::ostream& fout,
// we need at least one framework for the XML to be valid
// generate framework list
cmRegularExpression reg("[ \t]*\\-framework[ \t]+([^ \t]+)");
cmsys::RegularExpression reg("[ \t]*\\-framework[ \t]+([^ \t]+)");
std::vector<std::string> frameworks;
lib = libs.begin();
......@@ -967,9 +969,9 @@ void cmLocalCodeWarriorGenerator::WriteGroup(std::ostream& fout,
}
// now add in the libraries we depend on
cmRegularExpression isAframework("[ \t]*\\-framework");
cmRegularExpression isEnvironment("\\${");
cmRegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
cmsys::RegularExpression isAframework("[ \t]*\\-framework");
cmsys::RegularExpression isEnvironment("\\${");
cmsys::RegularExpression isUNIX("[ \t]*\\-l([^ \t]+)");
const cmTarget::LinkLibraries& libs = l->GetLinkLibraries();
cmTarget::LinkLibraries::const_iterator lib = libs.begin();
for(; lib != libs.end(); ++lib)
......
......@@ -22,6 +22,8 @@
#include "cmMakeDepend.h"
#include "cmCacheManager.h"
#include "cmGeneratedFileStream.h"
#include <cmsys/RegularExpression.hxx>
#include <stdio.h>
cmLocalUnixMakefileGenerator::cmLocalUnixMakefileGenerator()
......@@ -565,7 +567,7 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
std::string regexp = ".*\\";
regexp += linkSuffix;
regexp += "$";
cmRegularExpression hasSuffix(regexp.c_str());
cmsys::RegularExpression hasSuffix(regexp.c_str());
std::string librariesLinked;
const cmTarget::LinkLibraries& libs = tgt.GetLinkLibraries();
for(cmTarget::LinkLibraries::const_iterator lib = libs.begin();
......@@ -579,7 +581,7 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
// if a variable expands to nothing.
if (lib->first.size() == 0) continue;
// if it is a full path break it into -L and -l
cmRegularExpression reg("([ \t]*\\-l)|([ \t]*\\-framework)|(\\${)");
cmsys::RegularExpression reg("([ \t]*\\-l)|([ \t]*\\-framework)|(\\${)");
if(lib->first.find('/') != std::string::npos
&& !reg.find(lib->first))
{
......@@ -597,8 +599,8 @@ void cmLocalUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
runtimeDirs.push_back( libpath );
}
}
cmRegularExpression libname("^lib([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*");
cmRegularExpression libname_noprefix("([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*");
cmsys::RegularExpression libname("^lib([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*");
cmsys::RegularExpression libname_noprefix("([^/]*)(\\.so|\\.lib|\\.dll|\\.sl|\\.a|\\.dylib).*");
if(libname.find(file))
{
// Library had "lib" prefix.
......
......@@ -22,6 +22,8 @@
#include "cmCacheManager.h"
#include <queue>
#include <cmsys/RegularExpression.hxx>
cmLocalVisualStudio6Generator::cmLocalVisualStudio6Generator()
{
}
......@@ -607,7 +609,7 @@ void cmLocalVisualStudio6Generator::SetBuildType(BuildType b,
// possible
std::ifstream fin(m_DSPHeaderTemplate.c_str());
cmRegularExpression reg("# Name ");
cmsys::RegularExpression reg("# Name ");
if(!fin)
{
cmSystemTools::Error("Error Reading ", m_DSPHeaderTemplate.c_str());
......
......@@ -18,6 +18,7 @@
#include "cmStandardIncludes.h"
#include "cmSystemTools.h"
#include <cmsys/RegularExpression.hxx>
void cmDependInformation::AddDependencies(cmDependInformation* info)
{
......@@ -189,7 +190,7 @@ void cmMakeDepend::GenerateDependInformation(cmDependInformation* info)
// #include directives
void cmMakeDepend::DependWalk(cmDependInformation* info)
{
cmRegularExpression includeLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
cmsys::RegularExpression includeLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
std::ifstream fin(info->m_FullPath.c_str());
if(!fin)
{
......
......@@ -19,9 +19,10 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmRegularExpression.h"
#include "cmStandardIncludes.h"
#include <cmsys/RegularExpression.hxx>
/** \class cmDependInformation
* \brief Store dependency information for a single source file.
*
......@@ -150,8 +151,8 @@ protected:
const cmMakefile* m_Makefile;
bool m_Verbose;
cmRegularExpression m_IncludeFileRegularExpression;
cmRegularExpression m_ComplainFileRegularExpression;
cmsys::RegularExpression m_IncludeFileRegularExpression;
cmsys::RegularExpression m_ComplainFileRegularExpression;
std::vector<std::string> m_IncludeDirectories;
typedef std::map<cmStdString, cmDependInformation*> DependInformationMap;
DependInformationMap m_DependInformationMap;
......
......@@ -29,6 +29,9 @@
#include "cmake.h"
#include <stdio.h> // required for sprintf
#include <stdlib.h> // required for atoi
#include <cmsys/RegularExpression.hxx>
// default is not to be building executables
cmMakefile::cmMakefile()
{
......@@ -458,7 +461,7 @@ void cmMakefile::AddCustomCommand(const char* source,
d != outputs.end(); ++d)
{
// if this looks like a real file then use is as the main depend
cmRegularExpression SourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
cmsys::RegularExpression SourceFiles("\\.(C|M|c|c\\+\\+|cc|cpp|cxx|m|mm|rc|def|r|odl|idl|hpj|bat|h|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
if (SourceFiles.find(source))
{
this->AddCustomCommandToOutput(d->c_str(), command, commandArgs,
......@@ -1461,7 +1464,7 @@ void cmMakefile::RemoveVariablesInString(std::string& source,
{
if(!atOnly)
{
cmRegularExpression var("(\\${[A-Za-z_0-9]*})");
cmsys::RegularExpression var("(\\${[A-Za-z_0-9]*})");
while (var.find(source))
{
source.erase(var.start(),var.end() - var.start());
......@@ -1470,13 +1473,13 @@ void cmMakefile::RemoveVariablesInString(std::string& source,
if(!atOnly)
{
cmRegularExpression varb("(\\$ENV{[A-Za-z_0-9]*})");
cmsys::RegularExpression varb("(\\$ENV{[A-Za-z_0-9]*})");
while (varb.find(source))
{
source.erase(varb.start(),varb.end() - varb.start());
}
}
cmRegularExpression var2("(@[A-Za-z_0-9]*@)");
cmsys::RegularExpression var2("(@[A-Za-z_0-9]*@)");
while (var2.find(source))
{
source.erase(var2.start(),var2.end() - var2.start());
......
This diff is collapsed.
This diff is collapsed.
......@@ -16,6 +16,8 @@
=========================================================================*/
#include "cmSiteNameCommand.h"
#include <cmsys/RegularExpression.hxx>
// cmSiteNameCommand
bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
{
......@@ -72,7 +74,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
{
// remove any white space from the host name
std::string hostRegExp = "[ \t\n\r]*([^\t\n\r ]*)[ \t\n\r]*";
cmRegularExpression hostReg (hostRegExp.c_str());
cmsys::RegularExpression hostReg (hostRegExp.c_str());
if (hostReg.find(host.c_str()))
{
// strip whitespace
......@@ -109,7 +111,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
std::string RegExp = ".*Name:[ \t\n]*";
RegExp += host;
RegExp += "\\.([^ \t\n\r]*)[ \t\n\r]*Address:";
cmRegularExpression reg( RegExp.c_str() );
cmsys::RegularExpression reg( RegExp.c_str() );
if(reg.find(nsOutput.c_str()))
{
siteName += '.' + cmSystemTools::LowerCase(reg.match(1));
......
......@@ -18,7 +18,8 @@
#define cmSourceGroup_h
#include "cmStandardIncludes.h"
#include "cmRegularExpression.h"
#include <cmsys/RegularExpression.hxx>
class cmSourceFile;
/** \class cmSourceGroup
......@@ -57,7 +58,7 @@ private:
/**
* The regular expression matching the files in the group.
*/
cmRegularExpression m_GroupRegex;
cmsys::RegularExpression m_GroupRegex;
/**
* vector of all source files in this source group
......
......@@ -15,6 +15,8 @@
=========================================================================*/
#include "cmStringCommand.h"
#include <cmsys/RegularExpression.hxx>
#include <stdlib.h> // required for atoi
//----------------------------------------------------------------------------
bool cmStringCommand::InitialPass(std::vector<std::string> const& args)
......@@ -136,7 +138,7 @@ bool cmStringCommand::RegexMatch(std::vector<std::string> const& args)
}
// Compile the regular expression.
cmRegularExpression re;
cmsys::RegularExpression re;
if(!re.compile(regex.c_str()))
{
std::string e = "sub-command REGEX, mode MATCH failed to compile regex \""+regex+"\".";
......@@ -179,7 +181,7 @@ bool cmStringCommand::RegexMatchAll(std::vector<std::string> const& args)
}
// Compile the regular expression.
cmRegularExpression re;
cmsys::RegularExpression re;
if(!re.compile(regex.c_str()))
{
std::string e = "sub-command REGEX, mode MATCHALL failed to compile regex \""+regex+"\".";
......@@ -277,7 +279,7 @@ bool cmStringCommand::RegexReplace(std::vector<std::string> const& args)
}
// Compile the regular expression.
cmRegularExpression re;
cmsys::RegularExpression re;
if(!re.compile(regex.c_str()))
{
std::string e = "sub-command REGEX, mode REPLACE failed to compile regex \""+regex+"\".";
......
......@@ -16,11 +16,11 @@
=========================================================================*/
#include "cmSystemTools.h"
#include <stdio.h>
#include "cmRegularExpression.h"
#include <ctype.h>
#include <errno.h>
#include <time.h>
#include <cmsys/RegularExpression.hxx>
#include <cmsys/Directory.hxx>
// support for realpath call
......@@ -76,7 +76,7 @@ void cmSystemTools::ExpandRegistryValues(std::string& source)
// The "[^]]" part of this expression will match any character except
// a close square-bracket. The ']' character must be the first in the
// list of characters inside the [^...] block of the expression.
cmRegularExpression regEntry("\\[(HKEY[^]]*)\\]");
cmsys::RegularExpression regEntry("\\[(HKEY[^]]*)\\]");
// check for black line or comment
while (regEntry.find(source))
......@@ -263,7 +263,7 @@ bool cmSystemTools::IsOn(const char* val)
bool cmSystemTools::IsNOTFOUND(const char* val)
{
cmRegularExpression reg("-NOTFOUND$");
cmsys::RegularExpression reg("-NOTFOUND$");
if(reg.find(val))
{
return true;
......@@ -539,7 +539,7 @@ bool cmSystemTools::RunCommand(const char* command,
// one set of quotes in the arguments
if(count > 2)
{
cmRegularExpression quoted("^\"([^\"]*)\"[ \t](.*)");
cmsys::RegularExpression quoted("^\"([^\"]*)\"[ \t](.*)");
if(quoted.find(command))
{
std::string shortCmd;
......@@ -609,7 +609,7 @@ void cmSystemTools::Glob(const char *directory, const char *regexp,
std::vector<std::string>& files)
{
cmsys::Directory d;
cmRegularExpression reg(regexp);
cmsys::RegularExpression reg(regexp);
if (d.Load(directory))
{
......
......@@ -17,6 +17,8 @@
#include "cmUseMangledMesaCommand.h"
#include "cmSystemTools.h"
#include <cmsys/RegularExpression.hxx>
// cmUseMangledMesaCommand
bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args)
{
......@@ -91,11 +93,11 @@ CopyAndFullPathMesaHeader(const char* source,
// input file at the same time
std::string inLine;
// regular expression for any #include line
cmRegularExpression includeLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
cmsys::RegularExpression includeLine("^[ \t]*#[ \t]*include[ \t]*[<\"]([^\">]+)[\">]");
// regular expression for gl/ or GL/ in a file (match(1) of above)
cmRegularExpression glDirLine("(gl|GL)(/|\\\\)([^<\"]+)");
cmsys::RegularExpression glDirLine("(gl|GL)(/|\\\\)([^<\"]+)");
// regular expression for gl GL or xmesa in a file (match(1) of above)
cmRegularExpression glLine("(gl|GL|xmesa)");
cmsys::RegularExpression glLine("(gl|GL|xmesa)");
while(cmSystemTools::GetLineFromStream(fin,inLine))
{
if(includeLine.find(inLine.c_str()))
......
......@@ -16,11 +16,11 @@
=========================================================================*/
#include "cmaketest.h"
#include "cmSystemTools.h"
#include "cmRegularExpression.h"
#include "cmake.h"
#include "cmListFileCache.h"
#include "cmCacheManager.h"
#include "cmDynamicLoader.h"
#if defined(_WIN32) && !defined(__CYGWIN__)
#include "windows.h"
#endif
......
......@@ -30,7 +30,6 @@ CMAKE_SOURCES="\
cmDocumentation \
cmGlobalGenerator \
cmLocalGenerator \
cmRegularExpression \
cmSourceFile \
cmSystemTools \
cmGlobalUnixMakefileGenerator \
......
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