Merge topic 'dev/string-apis'

b633b263 CPackWiX: Fix test to build with expected config
191f25e2 stringapi: Prevent a NULL dereference in WiX
219d6ad6 speedup: Avoid excess iterator dereferences
caaad357 speedup: Cache strings for comparisons
7abf4e31 stringapi: Use strings for dependency information
94fc63e2 stringapi: Use strings for cache iterator values
85fc9f26 stringapi: Command names
6557382d stringapi: Use strings for program paths
1a1b737c stringapi: Use strings for generator names
24b5e93d stringapi: Use strings for directories
11ed3e2c stringapi: Add string overload for the Def struct
b3bf31a5 stringapi: Miscellaneous char* parameters
5af95c39 typo: Match argument name with the header
2b17626e stringapi: Pass strings as install directories in CPack
3def29da stringapi: Use strings for feature arguments
acb116e3 stringapi: Return a string reference for the configuration
...
This commit is contained in:
Brad King 2014-03-09 10:29:02 -04:00 committed by CMake Topic Stage
commit ad9f0d831e
405 changed files with 3427 additions and 3464 deletions

View File

@ -987,7 +987,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
endif() endif()
endif() endif()
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the # This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
# CMake source. # CMake source.
# Remove leading / # Remove leading /

View File

@ -34,12 +34,11 @@ cmWIXPatchParser::cmWIXPatchParser(
} }
void cmWIXPatchParser::StartElement(const char *name, const char **atts) void cmWIXPatchParser::StartElement(const std::string& name, const char **atts)
{ {
std::string name_str = name;
if(State == BEGIN_DOCUMENT) if(State == BEGIN_DOCUMENT)
{ {
if(name_str == "CPackWiXPatch") if(name == "CPackWiXPatch")
{ {
State = BEGIN_FRAGMENTS; State = BEGIN_FRAGMENTS;
} }
@ -50,7 +49,7 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
} }
else if(State == BEGIN_FRAGMENTS) else if(State == BEGIN_FRAGMENTS)
{ {
if(name_str == "CPackWiXFragment") if(name == "CPackWiXFragment")
{ {
State = INSIDE_FRAGMENT; State = INSIDE_FRAGMENT;
StartFragment(atts); StartFragment(atts);
@ -107,12 +106,11 @@ void cmWIXPatchParser::StartFragment(const char **attributes)
} }
} }
void cmWIXPatchParser::EndElement(const char *name) void cmWIXPatchParser::EndElement(const std::string& name)
{ {
std::string name_str = name;
if(State == INSIDE_FRAGMENT) if(State == INSIDE_FRAGMENT)
{ {
if(name_str == "CPackWiXFragment") if(name == "CPackWiXFragment")
{ {
State = BEGIN_FRAGMENTS; State = BEGIN_FRAGMENTS;
ElementStack.clear(); ElementStack.clear();

View File

@ -43,11 +43,11 @@ public:
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger); cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
private: private:
virtual void StartElement(const char *name, const char **atts); virtual void StartElement(const std::string& name, const char **atts);
void StartFragment(const char **attributes); void StartFragment(const char **attributes);
virtual void EndElement(const char *name); virtual void EndElement(const std::string& name);
virtual void ReportError(int line, int column, const char* msg); virtual void ReportError(int line, int column, const char* msg);
void ReportValidationError(std::string const& message); void ReportValidationError(std::string const& message);

View File

@ -16,7 +16,8 @@
#include <string> #include <string>
//---------------------------------------------------------------------- //----------------------------------------------------------------------
unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const unsigned long cmCPackComponent::GetInstalledSize(
const std::string& installDir) const
{ {
if (this->TotalSize != 0) if (this->TotalSize != 0)
{ {
@ -37,7 +38,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
unsigned long unsigned long
cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const cmCPackComponent::GetInstalledSizeInKbytes(const std::string& installDir) const
{ {
unsigned long result = (GetInstalledSize(installDir) + 512) / 1024; unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
return result? result : 1; return result? result : 1;

View File

@ -94,11 +94,11 @@ public:
/// Get the total installed size of all of the files in this /// Get the total installed size of all of the files in this
/// component, in bytes. installDir is the directory into which the /// component, in bytes. installDir is the directory into which the
/// component was installed. /// component was installed.
unsigned long GetInstalledSize(const char* installDir) const; unsigned long GetInstalledSize(const std::string& installDir) const;
/// Identical to GetInstalledSize, but returns the result in /// Identical to GetInstalledSize, but returns the result in
/// kilobytes. /// kilobytes.
unsigned long GetInstalledSizeInKbytes(const char* installDir) const; unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
private: private:
mutable unsigned long TotalSize; mutable unsigned long TotalSize;

View File

@ -254,7 +254,7 @@ int cmCPackGenerator::InstallProject()
// If the project is a CMAKE project then run pre-install // If the project is a CMAKE project then run pre-install
// and then read the cmake_install script to run it // and then read the cmake_install script to run it
if ( !this->InstallProjectViaInstallCMakeProjects( if ( !this->InstallProjectViaInstallCMakeProjects(
setDestDir, bareTempInstallDirectory.c_str()) ) setDestDir, bareTempInstallDirectory) )
{ {
return 0; return 0;
} }
@ -269,7 +269,7 @@ int cmCPackGenerator::InstallProject()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallCommands( int cmCPackGenerator::InstallProjectViaInstallCommands(
bool setDestDir, const char* tempInstallDirectory) bool setDestDir, const std::string& tempInstallDirectory)
{ {
(void) setDestDir; (void) setDestDir;
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS"); const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
@ -312,7 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstalledDirectories( int cmCPackGenerator::InstallProjectViaInstalledDirectories(
bool setDestDir, const char* tempInstallDirectory) bool setDestDir, const std::string& tempInstallDirectory)
{ {
(void)setDestDir; (void)setDestDir;
(void)tempInstallDirectory; (void)tempInstallDirectory;
@ -349,7 +349,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
return 0; return 0;
} }
std::vector<std::string>::iterator it; std::vector<std::string>::iterator it;
const char* tempDir = tempInstallDirectory; const std::string& tempDir = tempInstallDirectory;
for ( it = installDirectoriesVector.begin(); for ( it = installDirectoriesVector.begin();
it != installDirectoriesVector.end(); it != installDirectoriesVector.end();
++it ) ++it )
@ -457,7 +457,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallScript( int cmCPackGenerator::InstallProjectViaInstallScript(
bool setDestDir, const char* tempInstallDirectory) bool setDestDir, const std::string& tempInstallDirectory)
{ {
const char* cmakeScripts const char* cmakeScripts
= this->GetOption("CPACK_INSTALL_SCRIPT"); = this->GetOption("CPACK_INSTALL_SCRIPT");
@ -499,7 +499,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
} }
else else
{ {
this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory); this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory.c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG, cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Using non-DESTDIR install... (this->SetOption)" << std::endl); "- Using non-DESTDIR install... (this->SetOption)" << std::endl);
@ -509,9 +509,9 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
} }
this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR", this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR",
tempInstallDirectory); tempInstallDirectory.c_str());
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR", this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
tempInstallDirectory); tempInstallDirectory.c_str());
int res = this->MakefileMap->ReadListFile(0, installScript.c_str()); int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
if ( cmSystemTools::GetErrorOccuredFlag() || !res ) if ( cmSystemTools::GetErrorOccuredFlag() || !res )
{ {
@ -524,7 +524,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
bool setDestDir, const char* baseTempInstallDirectory) bool setDestDir, const std::string& baseTempInstallDirectory)
{ {
const char* cmakeProjects const char* cmakeProjects
= this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
@ -623,7 +623,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
componentsVector.push_back(installComponent); componentsVector.push_back(installComponent);
} }
const char* buildConfig = this->GetOption("CPACK_BUILD_CONFIG"); const char* buildConfigCstr = this->GetOption("CPACK_BUILD_CONFIG");
std::string buildConfig = buildConfigCstr ? buildConfigCstr : "";
cmGlobalGenerator* globalGenerator cmGlobalGenerator* globalGenerator
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator( = this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
cmakeGenerator); cmakeGenerator);
@ -822,9 +823,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
<< "'" << std::endl); << "'" << std::endl);
} }
if ( buildConfig && *buildConfig ) if (!buildConfig.empty())
{ {
mf->AddDefinition("BUILD_TYPE", buildConfig); mf->AddDefinition("BUILD_TYPE", buildConfig.c_str());
} }
std::string installComponentLowerCase std::string installComponentLowerCase
= cmSystemTools::LowerCase(installComponent); = cmSystemTools::LowerCase(installComponent);
@ -972,7 +973,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCPackGenerator::SetOptionIfNotSet(const char* op, void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
const char* value) const char* value)
{ {
const char* def = this->MakefileMap->GetDefinition(op); const char* def = this->MakefileMap->GetDefinition(op);
@ -984,12 +985,8 @@ void cmCPackGenerator::SetOptionIfNotSet(const char* op,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCPackGenerator::SetOption(const char* op, const char* value) void cmCPackGenerator::SetOption(const std::string& op, const char* value)
{ {
if ( !op )
{
return;
}
if ( !value ) if ( !value )
{ {
this->MakefileMap->RemoveDefinition(op); this->MakefileMap->RemoveDefinition(op);
@ -1092,7 +1089,7 @@ int cmCPackGenerator::DoPackage()
* may update this during PackageFiles. * may update this during PackageFiles.
* (either putting several names or updating the provided one) * (either putting several names or updating the provided one)
*/ */
packageFileNames.push_back(tempPackageFileName); packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
toplevel = tempDirectory; toplevel = tempDirectory;
if ( !this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag()) if ( !this->PackageFiles() || cmSystemTools::GetErrorOccuredFlag())
{ {
@ -1142,7 +1139,7 @@ int cmCPackGenerator::DoPackage()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackGenerator::Initialize(const char* name, cmMakefile* mf) int cmCPackGenerator::Initialize(const std::string& name, cmMakefile* mf)
{ {
this->MakefileMap = mf; this->MakefileMap = mf;
this->Name = name; this->Name = name;
@ -1176,19 +1173,19 @@ int cmCPackGenerator::InitializeInternal()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackGenerator::IsSet(const char* name) const bool cmCPackGenerator::IsSet(const std::string& name) const
{ {
return this->MakefileMap->IsSet(name); return this->MakefileMap->IsSet(name);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackGenerator::IsOn(const char* name) const bool cmCPackGenerator::IsOn(const std::string& name) const
{ {
return cmSystemTools::IsOn(GetOption(name)); return cmSystemTools::IsOn(GetOption(name));
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char* cmCPackGenerator::GetOption(const char* op) const const char* cmCPackGenerator::GetOption(const std::string& op) const
{ {
const char* ret = this->MakefileMap->GetDefinition(op); const char* ret = this->MakefileMap->GetDefinition(op);
if(!ret) if(!ret)
@ -1486,8 +1483,8 @@ bool cmCPackGenerator::WantsComponentInstallation() const
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackInstallationType* cmCPackInstallationType*
cmCPackGenerator::GetInstallationType(const char *projectName, cmCPackGenerator::GetInstallationType(const std::string& projectName,
const char *name) const std::string& name)
{ {
(void) projectName; (void) projectName;
bool hasInstallationType = this->InstallationTypes.count(name) != 0; bool hasInstallationType = this->InstallationTypes.count(name) != 0;
@ -1518,7 +1515,8 @@ cmCPackGenerator::GetInstallationType(const char *projectName,
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackComponent* cmCPackComponent*
cmCPackGenerator::GetComponent(const char *projectName, const char *name) cmCPackGenerator::GetComponent(const std::string& projectName,
const std::string& name)
{ {
bool hasComponent = this->Components.count(name) != 0; bool hasComponent = this->Components.count(name) != 0;
cmCPackComponent *component = &this->Components[name]; cmCPackComponent *component = &this->Components[name];
@ -1586,7 +1584,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
++installTypesIt) ++installTypesIt)
{ {
component->InstallationTypes.push_back( component->InstallationTypes.push_back(
this->GetInstallationType(projectName, installTypesIt->c_str())); this->GetInstallationType(projectName, *installTypesIt));
} }
} }
@ -1613,7 +1611,8 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackComponentGroup* cmCPackComponentGroup*
cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name) cmCPackGenerator::GetComponentGroup(const std::string& projectName,
const std::string& name)
{ {
(void) projectName; (void) projectName;
std::string macroPrefix = "CPACK_COMPONENT_GROUP_" std::string macroPrefix = "CPACK_COMPONENT_GROUP_"

View File

@ -90,7 +90,7 @@ public:
/** /**
* Initialize generator * Initialize generator
*/ */
int Initialize(const char* name, cmMakefile* mf); int Initialize(const std::string& name, cmMakefile* mf);
/** /**
* Construct generator * Construct generator
@ -99,12 +99,12 @@ public:
virtual ~cmCPackGenerator(); virtual ~cmCPackGenerator();
//! Set and get the options //! Set and get the options
void SetOption(const char* op, const char* value); void SetOption(const std::string& op, const char* value);
void SetOptionIfNotSet(const char* op, const char* value); void SetOptionIfNotSet(const std::string& op, const char* value);
const char* GetOption(const char* op) const; const char* GetOption(const std::string& op) const;
std::vector<std::string> GetOptions() const; std::vector<std::string> GetOptions() const;
bool IsSet(const char* name) const; bool IsSet(const std::string& name) const;
bool IsOn(const char* name) const; bool IsOn(const std::string& name) const;
//! Set the logger //! Set the logger
void SetLogger(cmCPackLog* log) { this->Logger = log; } void SetLogger(cmCPackLog* log) { this->Logger = log; }
@ -190,13 +190,13 @@ protected:
//! Run install commands if specified //! Run install commands if specified
virtual int InstallProjectViaInstallCommands( virtual int InstallProjectViaInstallCommands(
bool setDestDir, const char* tempInstallDirectory); bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstallScript( virtual int InstallProjectViaInstallScript(
bool setDestDir, const char* tempInstallDirectory); bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstalledDirectories( virtual int InstallProjectViaInstalledDirectories(
bool setDestDir, const char* tempInstallDirectory); bool setDestDir, const std::string& tempInstallDirectory);
virtual int InstallProjectViaInstallCMakeProjects( virtual int InstallProjectViaInstallCMakeProjects(
bool setDestDir, const char* tempInstallDirectory); bool setDestDir, const std::string& tempInstallDirectory);
/** /**
* The various level of support of * The various level of support of
@ -245,12 +245,14 @@ protected:
* @return true if component installation is supported and wanted. * @return true if component installation is supported and wanted.
*/ */
virtual bool WantsComponentInstallation() const; virtual bool WantsComponentInstallation() const;
virtual cmCPackInstallationType* GetInstallationType(const char *projectName, virtual cmCPackInstallationType* GetInstallationType(
const char* name); const std::string& projectName,
virtual cmCPackComponent* GetComponent(const char *projectName, const std::string& name);
const char* name); virtual cmCPackComponent* GetComponent(const std::string& projectName,
virtual cmCPackComponentGroup* GetComponentGroup(const char *projectName, const std::string& name);
const char* name); virtual cmCPackComponentGroup* GetComponentGroup(
const std::string& projectName,
const std::string& name);
cmSystemTools::OutputOption GeneratorVerbose; cmSystemTools::OutputOption GeneratorVerbose;
std::string Name; std::string Name;

View File

@ -151,7 +151,8 @@ cmCPackGeneratorFactory::~cmCPackGeneratorFactory()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(const char* name) cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
const std::string& name)
{ {
cmCPackGenerator* gen = this->NewGeneratorInternal(name); cmCPackGenerator* gen = this->NewGeneratorInternal(name);
if ( !gen ) if ( !gen )
@ -165,12 +166,8 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(const char* name)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal( cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
const char* name) const std::string& name)
{ {
if ( !name )
{
return 0;
}
cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it
= this->GeneratorCreators.find(name); = this->GeneratorCreators.find(name);
if ( it == this->GeneratorCreators.end() ) if ( it == this->GeneratorCreators.end() )
@ -181,11 +178,11 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCPackGeneratorFactory::RegisterGenerator(const char* name, void cmCPackGeneratorFactory::RegisterGenerator(const std::string& name,
const char* generatorDescription, const char* generatorDescription,
CreateGeneratorCall* createGenerator) CreateGeneratorCall* createGenerator)
{ {
if ( !name || !createGenerator ) if ( !createGenerator )
{ {
cmCPack_Log(this->Logger, cmCPackLog::LOG_ERROR, cmCPack_Log(this->Logger, cmCPackLog::LOG_ERROR,
"Cannot register generator" << std::endl); "Cannot register generator" << std::endl);

View File

@ -31,26 +31,26 @@ public:
~cmCPackGeneratorFactory(); ~cmCPackGeneratorFactory();
//! Get the generator //! Get the generator
cmCPackGenerator* NewGenerator(const char* name); cmCPackGenerator* NewGenerator(const std::string& name);
void DeleteGenerator(cmCPackGenerator* gen); void DeleteGenerator(cmCPackGenerator* gen);
typedef cmCPackGenerator* CreateGeneratorCall(); typedef cmCPackGenerator* CreateGeneratorCall();
void RegisterGenerator(const char* name, void RegisterGenerator(const std::string& name,
const char* generatorDescription, const char* generatorDescription,
CreateGeneratorCall* createGenerator); CreateGeneratorCall* createGenerator);
void SetLogger(cmCPackLog* logger) { this->Logger = logger; } void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
typedef std::map<cmStdString, cmStdString> DescriptionsMap; typedef std::map<std::string, std::string> DescriptionsMap;
const DescriptionsMap& GetGeneratorsList() const const DescriptionsMap& GetGeneratorsList() const
{ return this->GeneratorDescriptions; } { return this->GeneratorDescriptions; }
private: private:
cmCPackGenerator* NewGeneratorInternal(const char* name); cmCPackGenerator* NewGeneratorInternal(const std::string& name);
std::vector<cmCPackGenerator*> Generators; std::vector<cmCPackGenerator*> Generators;
typedef std::map<cmStdString, CreateGeneratorCall*> t_GeneratorCreatorsMap; typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
t_GeneratorCreatorsMap GeneratorCreators; t_GeneratorCreatorsMap GeneratorCreators;
DescriptionsMap GeneratorDescriptions; DescriptionsMap GeneratorDescriptions;
cmCPackLog* Logger; cmCPackLog* Logger;

View File

@ -227,7 +227,7 @@ int cmCPackOSXX11Generator::InitializeInternal()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/* /*
bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name) bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
{ {
std::string uname = cmSystemTools::UpperCase(name); std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname; std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
@ -271,8 +271,8 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
*/ */
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name, bool cmCPackOSXX11Generator::CopyResourcePlistFile(const std::string& name,
const char* dir, const char* outputFileName /* = 0 */, const std::string& dir, const char* outputFileName /* = 0 */,
bool copyOnly /* = false */) bool copyOnly /* = false */)
{ {
std::string inFName = "CPack."; std::string inFName = "CPack.";
@ -288,7 +288,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
if ( !outputFileName ) if ( !outputFileName )
{ {
outputFileName = name; outputFileName = name.c_str();
} }
std::string destFileName = dir; std::string destFileName = dir;

View File

@ -37,8 +37,9 @@ protected:
virtual const char* GetPackagingInstallPrefix(); virtual const char* GetPackagingInstallPrefix();
virtual const char* GetOutputExtension() { return ".dmg"; } virtual const char* GetOutputExtension() { return ".dmg"; }
//bool CopyCreateResourceFile(const char* name, const char* dir); //bool CopyCreateResourceFile(const std::string& name,
bool CopyResourcePlistFile(const char* name, const char* dir, // const std::string& dir);
bool CopyResourcePlistFile(const std::string& name, const std::string& dir,
const char* outputFileName = 0, bool copyOnly = false); const char* outputFileName = 0, bool copyOnly = false);
std::string InstallPrefix; std::string InstallPrefix;
}; };

View File

@ -43,14 +43,14 @@ bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir, int cmCPackPackageMakerGenerator::CopyInstallScript(const std::string& resdir,
const char* script, const std::string& script,
const char* name) const std::string& name)
{ {
std::string dst = resdir; std::string dst = resdir;
dst += "/"; dst += "/";
dst += name; dst += name;
cmSystemTools::CopyFileAlways(script, dst.c_str()); cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
cmSystemTools::SetPermissions(dst.c_str(),0777); cmSystemTools::SetPermissions(dst.c_str(),0777);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"copy script : " << script << "\ninto " << dst.c_str() << "copy script : " << script << "\ninto " << dst.c_str() <<
@ -553,8 +553,9 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name, bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(
const char* dirName) const std::string& name,
const std::string& dirName)
{ {
std::string uname = cmSystemTools::UpperCase(name); std::string uname = cmSystemTools::UpperCase(name);
std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname; std::string cpackVar = "CPACK_RESOURCE_FILE_" + uname;
@ -563,7 +564,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str() cmCPackLogger(cmCPackLog::LOG_ERROR, "CPack option: " << cpackVar.c_str()
<< " not specified. It should point to " << " not specified. It should point to "
<< (name ? name : "(NULL)") << (!name.empty() ? name : "<empty>")
<< ".rtf, " << name << ".rtf, " << name
<< ".html, or " << name << ".txt file" << std::endl); << ".html, or " << name << ".txt file" << std::endl);
return false; return false;
@ -571,7 +572,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
if ( !cmSystemTools::FileExists(inFileName) ) if ( !cmSystemTools::FileExists(inFileName) )
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find " cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
<< (name ? name : "(NULL)") << (!name.empty() ? name : "<empty>")
<< " resource file: " << inFileName << std::endl); << " resource file: " << inFileName << std::endl);
return false; return false;
} }
@ -600,12 +601,13 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
return true; return true;
} }
bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(const char* name, bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(
const char* outName) const std::string& name,
const char* outName)
{ {
if (!outName) if (!outName)
{ {
outName = name; outName = name.c_str();
} }
std::string inFName = "CPack."; std::string inFName = "CPack.";

View File

@ -38,9 +38,9 @@ public:
virtual bool SupportsComponentInstallation() const; virtual bool SupportsComponentInstallation() const;
protected: protected:
int CopyInstallScript(const char* resdir, int CopyInstallScript(const std::string& resdir,
const char* script, const std::string& script,
const char* name); const std::string& name);
virtual int InitializeInternal(); virtual int InitializeInternal();
int PackageFiles(); int PackageFiles();
virtual const char* GetOutputExtension() { return ".dmg"; } virtual const char* GetOutputExtension() { return ".dmg"; }
@ -51,8 +51,9 @@ protected:
// CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased // CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
// version of name) specifies the input file to use for this file, // version of name) specifies the input file to use for this file,
// which will be configured via ConfigureFile. // which will be configured via ConfigureFile.
bool CopyCreateResourceFile(const char* name, const char *dirName); bool CopyCreateResourceFile(const std::string& name,
bool CopyResourcePlistFile(const char* name, const char* outName = 0); const std::string& dirName);
bool CopyResourcePlistFile(const std::string& name, const char* outName = 0);
// Run PackageMaker with the given command line, which will (if // Run PackageMaker with the given command line, which will (if
// successful) produce the given package file. Returns true if // successful) produce the given package file. Returns true if

View File

@ -68,7 +68,7 @@ int cpackUnknownArgument(const char*, void*)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
struct cpackDefinitions struct cpackDefinitions
{ {
typedef std::map<cmStdString, cmStdString> MapType; typedef std::map<std::string, std::string> MapType;
MapType Map; MapType Map;
cmCPackLog *Log; cmCPackLog *Log;
}; };

View File

@ -225,35 +225,35 @@ private:
return true; return true;
} }
virtual void StartElement(const char* name, const char**) virtual void StartElement(const std::string& name, const char**)
{ {
this->CData.clear(); this->CData.clear();
if(strcmp(name, "log") == 0) if(name == "log")
{ {
this->Rev = Revision(); this->Rev = Revision();
this->Changes.clear(); this->Changes.clear();
} }
// affected-files can contain blocks of // affected-files can contain blocks of
// modified, unknown, renamed, kind-changed, removed, conflicts, added // modified, unknown, renamed, kind-changed, removed, conflicts, added
else if(strcmp(name, "modified") == 0 else if(name == "modified"
|| strcmp(name, "renamed") == 0 || name == "renamed"
|| strcmp(name, "kind-changed") == 0) || name == "kind-changed")
{ {
this->CurChange = Change(); this->CurChange = Change();
this->CurChange.Action = 'M'; this->CurChange.Action = 'M';
} }
else if(strcmp(name, "added") == 0) else if(name == "added")
{ {
this->CurChange = Change(); this->CurChange = Change();
this->CurChange = 'A'; this->CurChange = 'A';
} }
else if(strcmp(name, "removed") == 0) else if(name == "removed")
{ {
this->CurChange = Change(); this->CurChange = Change();
this->CurChange = 'D'; this->CurChange = 'D';
} }
else if(strcmp(name, "unknown") == 0 else if(name == "unknown"
|| strcmp(name, "conflicts") == 0) || name == "conflicts")
{ {
// Should not happen here // Should not happen here
this->CurChange = Change(); this->CurChange = Change();
@ -265,27 +265,27 @@ private:
this->CData.insert(this->CData.end(), data, data+length); this->CData.insert(this->CData.end(), data, data+length);
} }
virtual void EndElement(const char* name) virtual void EndElement(const std::string& name)
{ {
if(strcmp(name, "log") == 0) if(name == "log")
{ {
this->BZR->DoRevision(this->Rev, this->Changes); this->BZR->DoRevision(this->Rev, this->Changes);
} }
else if((strcmp(name, "file") == 0 || strcmp(name, "directory") == 0) else if(!this->CData.empty() &&
&& !this->CData.empty()) (name == "file" || name == "directory"))
{ {
this->CurChange.Path.assign(&this->CData[0], this->CData.size()); this->CurChange.Path.assign(&this->CData[0], this->CData.size());
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange); this->Changes.push_back(this->CurChange);
} }
else if(strcmp(name, "symlink") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "symlink")
{ {
// symlinks have an arobase at the end in the log // symlinks have an arobase at the end in the log
this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1); this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1);
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path); cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange); this->Changes.push_back(this->CurChange);
} }
else if(strcmp(name, "committer") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "committer")
{ {
this->Rev.Author.assign(&this->CData[0], this->CData.size()); this->Rev.Author.assign(&this->CData[0], this->CData.size());
if(this->EmailRegex.find(this->Rev.Author)) if(this->EmailRegex.find(this->Rev.Author))
@ -294,15 +294,15 @@ private:
this->Rev.EMail = this->EmailRegex.match(2); this->Rev.EMail = this->EmailRegex.match(2);
} }
} }
else if(strcmp(name, "timestamp") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "timestamp")
{ {
this->Rev.Date.assign(&this->CData[0], this->CData.size()); this->Rev.Date.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "message") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "message")
{ {
this->Rev.Log.assign(&this->CData[0], this->CData.size()); this->Rev.Log.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "revno") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "revno")
{ {
this->Rev.Rev.assign(&this->CData[0], this->CData.size()); this->Rev.Rev.assign(&this->CData[0], this->CData.size());
} }
@ -409,7 +409,7 @@ bool cmCTestBZR::UpdateImpl()
{ {
opts = this->CTest->GetCTestConfiguration("BZRUpdateOptions"); opts = this->CTest->GetCTestConfiguration("BZRUpdateOptions");
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
// TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) // TODO: if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
@ -418,7 +418,7 @@ bool cmCTestBZR::UpdateImpl()
bzr_update.push_back(this->CommandLineTool.c_str()); bzr_update.push_back(this->CommandLineTool.c_str());
bzr_update.push_back("pull"); bzr_update.push_back("pull");
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
bzr_update.push_back(ai->c_str()); bzr_update.push_back(ai->c_str());

View File

@ -54,7 +54,7 @@ protected:
std::string &cmakeOutString, std::string &cmakeOutString,
std::string &cwd, cmake *cm); std::string &cwd, cmake *cm);
cmStdString Output; std::string Output;
std::string BuildGenerator; std::string BuildGenerator;
std::string BuildGeneratorToolset; std::string BuildGeneratorToolset;

View File

@ -101,8 +101,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
} }
if ( this->GlobalGenerator ) if ( this->GlobalGenerator )
{ {
if ( strcmp(this->GlobalGenerator->GetName(), if ( this->GlobalGenerator->GetName() != cmakeGeneratorName )
cmakeGeneratorName) != 0 )
{ {
delete this->GlobalGenerator; delete this->GlobalGenerator;
this->GlobalGenerator = 0; this->GlobalGenerator = 0;
@ -130,8 +129,9 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory"); std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string buildCommand std::string buildCommand
= this->GlobalGenerator-> = this->GlobalGenerator->
GenerateCMakeBuildCommand(cmakeBuildTarget, cmakeBuildConfiguration, GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
cmakeBuildAdditionalFlags, true); cmakeBuildConfiguration,
cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" "SetMakeCommand:"
<< buildCommand.c_str() << "\n"); << buildCommand.c_str() << "\n");

View File

@ -43,7 +43,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_build";} virtual std::string GetName() const { return "ctest_build";}
virtual bool InitialPass(std::vector<std::string> const& args, virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status); cmExecutionStatus &status);

View File

@ -380,7 +380,7 @@ int cmCTestBuildHandler::ProcessHandler()
// Create lists of regular expression strings for errors, error exceptions, // Create lists of regular expression strings for errors, error exceptions,
// warnings and warning exceptions. // warnings and warning exceptions.
std::vector<cmStdString>::size_type cc; std::vector<std::string>::size_type cc;
for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ ) for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ )
{ {
this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]); this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
@ -400,7 +400,7 @@ int cmCTestBuildHandler::ProcessHandler()
} }
// Pre-compile regular expressions objects for all regular expressions // Pre-compile regular expressions objects for all regular expressions
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
#define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \ #define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \
regexes.clear(); \ regexes.clear(); \
@ -602,7 +602,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
// Sort XML fragments in chronological order. // Sort XML fragments in chronological order.
cmFileTimeComparison ftc; cmFileTimeComparison ftc;
FragmentCompare fragmentCompare(&ftc); FragmentCompare fragmentCompare(&ftc);
typedef std::set<cmStdString, FragmentCompare> Fragments; typedef std::set<std::string, FragmentCompare> Fragments;
Fragments fragments(fragmentCompare); Fragments fragments(fragmentCompare);
// Identify fragments on disk. // Identify fragments on disk.
@ -889,7 +889,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
int* retVal, const char* dir, int timeout, std::ostream& ofs) int* retVal, const char* dir, int timeout, std::ostream& ofs)
{ {
// First generate the command and arguments // First generate the command and arguments
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); std::vector<std::string> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1) if(args.size() < 1)
{ {
@ -897,7 +897,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
} }
std::vector<const char*> argv; std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin(); for(std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) a != args.end(); ++a)
{ {
argv.push_back(a->c_str()); argv.push_back(a->c_str());
@ -1133,7 +1133,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
errorwarning.PostContext = ""; errorwarning.PostContext = "";
// Copy pre-context to report // Copy pre-context to report
std::deque<cmStdString>::iterator pcit; std::deque<std::string>::iterator pcit;
for ( pcit = this->PreContext.begin(); for ( pcit = this->PreContext.begin();
pcit != this->PreContext.end(); pcit != this->PreContext.end();
++pcit ) ++pcit )

View File

@ -97,10 +97,10 @@ private:
double StartBuildTime; double StartBuildTime;
double EndBuildTime; double EndBuildTime;
std::vector<cmStdString> CustomErrorMatches; std::vector<std::string> CustomErrorMatches;
std::vector<cmStdString> CustomErrorExceptions; std::vector<std::string> CustomErrorExceptions;
std::vector<cmStdString> CustomWarningMatches; std::vector<std::string> CustomWarningMatches;
std::vector<cmStdString> CustomWarningExceptions; std::vector<std::string> CustomWarningExceptions;
std::vector<std::string> ReallyCustomWarningMatches; std::vector<std::string> ReallyCustomWarningMatches;
std::vector<std::string> ReallyCustomWarningExceptions; std::vector<std::string> ReallyCustomWarningExceptions;
std::vector<cmCTestCompileErrorWarningRex> ErrorWarningFileLineRegex; std::vector<cmCTestCompileErrorWarningRex> ErrorWarningFileLineRegex;
@ -121,8 +121,8 @@ private:
size_t BuildOutputLogSize; size_t BuildOutputLogSize;
std::vector<char> CurrentProcessingLine; std::vector<char> CurrentProcessingLine;
cmStdString SimplifySourceDir; std::string SimplifySourceDir;
cmStdString SimplifyBuildDir; std::string SimplifyBuildDir;
size_t OutputLineCounter; size_t OutputLineCounter;
typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector; typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector;
t_ErrorsAndWarningsVector ErrorsAndWarnings; t_ErrorsAndWarningsVector ErrorsAndWarnings;
@ -130,7 +130,7 @@ private:
size_t PostContextCount; size_t PostContextCount;
size_t MaxPreContext; size_t MaxPreContext;
size_t MaxPostContext; size_t MaxPostContext;
std::deque<cmStdString> PreContext; std::deque<std::string> PreContext;
int TotalErrors; int TotalErrors;
int TotalWarnings; int TotalWarnings;

View File

@ -99,7 +99,7 @@ bool cmCTestCVS::UpdateImpl()
opts = "-dP"; opts = "-dP";
} }
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
// Specify the start time for nightly testing. // Specify the start time for nightly testing.
if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
@ -112,7 +112,7 @@ bool cmCTestCVS::UpdateImpl()
cvs_update.push_back(this->CommandLineTool.c_str()); cvs_update.push_back(this->CommandLineTool.c_str());
cvs_update.push_back("-z3"); cvs_update.push_back("-z3");
cvs_update.push_back("update"); cvs_update.push_back("update");
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
cvs_update.push_back(ai->c_str()); cvs_update.push_back(ai->c_str());
@ -308,7 +308,7 @@ bool cmCTestCVS::WriteXMLUpdates(std::ostream& xml)
" Gathering version information (one . per updated file):\n" " Gathering version information (one . per updated file):\n"
" " << std::flush); " " << std::flush);
for(std::map<cmStdString, Directory>::const_iterator for(std::map<std::string, Directory>::const_iterator
di = this->Dirs.begin(); di != this->Dirs.end(); ++di) di = this->Dirs.begin(); di != this->Dirs.end(); ++di)
{ {
this->WriteXMLDirectory(xml, di->first, di->second); this->WriteXMLDirectory(xml, di->first, di->second);

View File

@ -32,8 +32,8 @@ private:
virtual bool WriteXMLUpdates(std::ostream& xml); virtual bool WriteXMLUpdates(std::ostream& xml);
// Update status for files in each directory. // Update status for files in each directory.
class Directory: public std::map<cmStdString, PathStatus> {}; class Directory: public std::map<std::string, PathStatus> {};
std::map<cmStdString, Directory> Dirs; std::map<std::string, Directory> Dirs;
std::string ComputeBranchFlag(std::string const& dir); std::string ComputeBranchFlag(std::string const& dir);
void LoadRevisions(std::string const& file, const char* branchFlag, void LoadRevisions(std::string const& file, const char* branchFlag,

View File

@ -38,7 +38,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_configure";} virtual std::string GetName() const { return "ctest_configure";}
cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestConfigureCommand, cmCTestHandlerCommand);

View File

@ -39,7 +39,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_coverage";} virtual std::string GetName() const { return "ctest_coverage";}
cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestCoverageCommand, cmCTestHandlerCommand);
@ -56,7 +56,7 @@ protected:
}; };
bool LabelsMentioned; bool LabelsMentioned;
std::set<cmStdString> Labels; std::set<std::string> Labels;
}; };

View File

@ -363,7 +363,7 @@ int cmCTestCoverageHandler::ProcessHandler()
// setup the regex exclude stuff // setup the regex exclude stuff
this->CustomCoverageExcludeRegex.clear(); this->CustomCoverageExcludeRegex.clear();
std::vector<cmStdString>::iterator rexIt; std::vector<std::string>::iterator rexIt;
for ( rexIt = this->CustomCoverageExclude.begin(); for ( rexIt = this->CustomCoverageExclude.begin();
rexIt != this->CustomCoverageExclude.end(); rexIt != this->CustomCoverageExclude.end();
++ rexIt ) ++ rexIt )
@ -713,7 +713,7 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
this->CustomCoverageExclude); this->CustomCoverageExclude);
this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB", this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB",
this->ExtraCoverageGlobs); this->ExtraCoverageGlobs);
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
for ( it = this->CustomCoverageExclude.begin(); for ( it = this->CustomCoverageExclude.begin();
it != this->CustomCoverageExclude.end(); it != this->CustomCoverageExclude.end();
++ it ) ++ it )
@ -989,8 +989,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
<< "--------------------------------------------------------------" << "--------------------------------------------------------------"
<< std::endl); << std::endl);
std::vector<cmStdString> lines; std::vector<std::string> lines;
std::vector<cmStdString>::iterator line; std::vector<std::string>::iterator line;
cmSystemTools::Split(output.c_str(), lines); cmSystemTools::Split(output.c_str(), lines);
@ -1504,7 +1504,7 @@ namespace
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCTestCoverageHandler::RunBullseyeCoverageBranch( int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
cmCTestCoverageHandlerContainer* cont, cmCTestCoverageHandlerContainer* cont,
std::set<cmStdString>& coveredFileNames, std::set<std::string>& coveredFileNames,
std::vector<std::string>& files, std::vector<std::string>& files,
std::vector<std::string>& filesFullPath) std::vector<std::string>& filesFullPath)
{ {
@ -1545,7 +1545,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
outputFile.c_str() << std::endl); outputFile.c_str() << std::endl);
return 0; return 0;
} }
std::map<cmStdString, cmStdString> fileMap; std::map<std::string, std::string> fileMap;
std::vector<std::string>::iterator fp = filesFullPath.begin(); std::vector<std::string>::iterator fp = filesFullPath.begin();
for(std::vector<std::string>::iterator f = files.begin(); for(std::vector<std::string>::iterator f = files.begin();
f != files.end(); ++f, ++fp) f != files.end(); ++f, ++fp)
@ -1558,7 +1558,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
std::string lineIn; std::string lineIn;
bool valid = false; // are we in a valid output file bool valid = false; // are we in a valid output file
int line = 0; // line of the current file int line = 0; // line of the current file
cmStdString file; std::string file;
while(cmSystemTools::GetLineFromStream(fin, lineIn)) while(cmSystemTools::GetLineFromStream(fin, lineIn))
{ {
bool startFile = false; bool startFile = false;
@ -1593,7 +1593,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
} }
count++; // move on one count++; // move on one
} }
std::map<cmStdString, cmStdString>::iterator std::map<std::string, std::string>::iterator
i = fileMap.find(file); i = fileMap.find(file);
// if the file should be covered write out the header for that file // if the file should be covered write out the header for that file
if(i != fileMap.end()) if(i != fileMap.end())
@ -1758,7 +1758,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
outputFile.c_str() << std::endl); outputFile.c_str() << std::endl);
return 0; return 0;
} }
std::set<cmStdString> coveredFileNames; std::set<std::string> coveredFileNames;
while(cmSystemTools::GetLineFromStream(fin, stdline)) while(cmSystemTools::GetLineFromStream(fin, stdline))
{ {
// if we have a line of output from stdout // if we have a line of output from stdout
@ -2105,10 +2105,10 @@ void cmCTestCoverageHandler::WriteXMLLabels(std::ostream& os,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmCTestCoverageHandler::SetLabelFilter(std::set<cmStdString> const& labels) cmCTestCoverageHandler::SetLabelFilter(std::set<std::string> const& labels)
{ {
this->LabelFilter.clear(); this->LabelFilter.clear();
for(std::set<cmStdString>::const_iterator li = labels.begin(); for(std::set<std::string>::const_iterator li = labels.begin();
li != labels.end(); ++li) li != labels.end(); ++li)
{ {
this->LabelFilter.insert(this->GetLabelId(*li)); this->LabelFilter.insert(this->GetLabelId(*li));
@ -2158,7 +2158,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
{ {
std::set<std::string> extraMatches; std::set<std::string> extraMatches;
for(std::vector<cmStdString>::iterator i = this->ExtraCoverageGlobs.begin(); for(std::vector<std::string>::iterator i = this->ExtraCoverageGlobs.begin();
i != this->ExtraCoverageGlobs.end(); ++i) i != this->ExtraCoverageGlobs.end(); ++i)
{ {
cmsys::Glob gl; cmsys::Glob gl;

View File

@ -55,7 +55,7 @@ public:
void PopulateCustomVectors(cmMakefile *mf); void PopulateCustomVectors(cmMakefile *mf);
/** Report coverage only for sources with these labels. */ /** Report coverage only for sources with these labels. */
void SetLabelFilter(std::set<cmStdString> const& labels); void SetLabelFilter(std::set<std::string> const& labels);
private: private:
bool ShouldIDoCoverage(const char* file, const char* srcDir, bool ShouldIDoCoverage(const char* file, const char* srcDir,
@ -81,7 +81,7 @@ private:
int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont); int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont);
int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont); int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont);
int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont, int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont,
std::set<cmStdString>& coveredFileNames, std::set<std::string>& coveredFileNames,
std::vector<std::string>& files, std::vector<std::string>& files,
std::vector<std::string>& filesFullPath); std::vector<std::string>& filesFullPath);
@ -112,19 +112,19 @@ private:
std::set<std::string> FindUncoveredFiles( std::set<std::string> FindUncoveredFiles(
cmCTestCoverageHandlerContainer* cont); cmCTestCoverageHandlerContainer* cont);
std::vector<cmStdString> CustomCoverageExclude; std::vector<std::string> CustomCoverageExclude;
std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex; std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex;
std::vector<cmStdString> ExtraCoverageGlobs; std::vector<std::string> ExtraCoverageGlobs;
// Map from source file to label ids. // Map from source file to label ids.
class LabelSet: public std::set<int> {}; class LabelSet: public std::set<int> {};
typedef std::map<cmStdString, LabelSet> LabelMapType; typedef std::map<std::string, LabelSet> LabelMapType;
LabelMapType SourceLabels; LabelMapType SourceLabels;
LabelMapType TargetDirs; LabelMapType TargetDirs;
// Map from label name to label id. // Map from label name to label id.
typedef std::map<cmStdString, int> LabelIdMapType; typedef std::map<std::string, int> LabelIdMapType;
LabelIdMapType LabelIdMap; LabelIdMapType LabelIdMap;
std::vector<std::string> Labels; std::vector<std::string> Labels;
int GetLabelId(std::string const& label); int GetLabelId(std::string const& label);

View File

@ -48,7 +48,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_empty_binary_directory";} virtual std::string GetName() const { return "ctest_empty_binary_directory";}
cmTypeMacro(cmCTestEmptyBinaryDirectoryCommand, cmCTestCommand); cmTypeMacro(cmCTestEmptyBinaryDirectoryCommand, cmCTestCommand);

View File

@ -179,8 +179,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
{ {
opts = this->CTest->GetCTestConfiguration("GITUpdateOptions"); opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
git_fetch.push_back(ai->c_str()); git_fetch.push_back(ai->c_str());

View File

@ -30,12 +30,8 @@ cmCTestGenericHandler::~cmCTestGenericHandler()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCTestGenericHandler::SetOption(const char* op, const char* value) void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
{ {
if ( !op )
{
return;
}
if ( !value ) if ( !value )
{ {
cmCTestGenericHandler::t_StringToString::iterator remit cmCTestGenericHandler::t_StringToString::iterator remit
@ -51,14 +47,10 @@ void cmCTestGenericHandler::SetOption(const char* op, const char* value)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCTestGenericHandler::SetPersistentOption(const char* op, void cmCTestGenericHandler::SetPersistentOption(const std::string& op,
const char* value) const char* value)
{ {
this->SetOption(op, value); this->SetOption(op, value);
if ( !op )
{
return;
}
if ( !value ) if ( !value )
{ {
cmCTestGenericHandler::t_StringToString::iterator remit cmCTestGenericHandler::t_StringToString::iterator remit
@ -88,7 +80,7 @@ void cmCTestGenericHandler::Initialize()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const char* cmCTestGenericHandler::GetOption(const char* op) const char* cmCTestGenericHandler::GetOption(const std::string& op)
{ {
cmCTestGenericHandler::t_StringToString::iterator remit cmCTestGenericHandler::t_StringToString::iterator remit
= this->Options.find(op); = this->Options.find(op);

View File

@ -71,12 +71,12 @@ public:
cmCTestGenericHandler(); cmCTestGenericHandler();
virtual ~cmCTestGenericHandler(); virtual ~cmCTestGenericHandler();
typedef std::map<cmStdString,cmStdString> t_StringToString; typedef std::map<std::string,std::string> t_StringToString;
void SetPersistentOption(const char* op, const char* value); void SetPersistentOption(const std::string& op, const char* value);
void SetOption(const char* op, const char* value); void SetOption(const std::string& op, const char* value);
const char* GetOption(const char* op); const char* GetOption(const std::string& op);
void SetCommand(cmCTestCommand* command) void SetCommand(cmCTestCommand* command)
{ {

View File

@ -132,7 +132,7 @@ bool cmCTestGlobalVC::WriteXMLUpdates(std::ostream& xml)
this->WriteXMLGlobal(xml); this->WriteXMLGlobal(xml);
for(std::map<cmStdString, Directory>::const_iterator for(std::map<std::string, Directory>::const_iterator
di = this->Dirs.begin(); di != this->Dirs.end(); ++di) di = this->Dirs.begin(); di != this->Dirs.end(); ++di)
{ {
this->WriteXMLDirectory(xml, di->first, di->second); this->WriteXMLDirectory(xml, di->first, di->second);

View File

@ -39,8 +39,8 @@ protected:
}; };
// Update status for files in each directory. // Update status for files in each directory.
class Directory: public std::map<cmStdString, File> {}; class Directory: public std::map<std::string, File> {};
std::map<cmStdString, Directory> Dirs; std::map<std::string, Directory> Dirs;
// Old and new repository revisions. // Old and new repository revisions.
std::string OldRevision; std::string OldRevision;

View File

@ -149,8 +149,8 @@ bool cmCTestHG::UpdateImpl()
{ {
opts = this->CTest->GetCTestConfiguration("HGUpdateOptions"); opts = this->CTest->GetCTestConfiguration("HGUpdateOptions");
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
hg_update.push_back(ai->c_str()); hg_update.push_back(ai->c_str());
@ -189,10 +189,10 @@ private:
return true; return true;
} }
virtual void StartElement(const char* name, const char** atts) virtual void StartElement(const std::string& name, const char** atts)
{ {
this->CData.clear(); this->CData.clear();
if(strcmp(name, "logentry") == 0) if(name == "logentry")
{ {
this->Rev = Revision(); this->Rev = Revision();
if(const char* rev = this->FindAttribute(atts, "revision")) if(const char* rev = this->FindAttribute(atts, "revision"))
@ -208,29 +208,29 @@ private:
this->CData.insert(this->CData.end(), data, data+length); this->CData.insert(this->CData.end(), data, data+length);
} }
virtual void EndElement(const char* name) virtual void EndElement(const std::string& name)
{ {
if(strcmp(name, "logentry") == 0) if(name == "logentry")
{ {
this->HG->DoRevision(this->Rev, this->Changes); this->HG->DoRevision(this->Rev, this->Changes);
} }
else if(strcmp(name, "author") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "author")
{ {
this->Rev.Author.assign(&this->CData[0], this->CData.size()); this->Rev.Author.assign(&this->CData[0], this->CData.size());
} }
else if ( strcmp(name, "email") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "email")
{ {
this->Rev.EMail.assign(&this->CData[0], this->CData.size()); this->Rev.EMail.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "date") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "date")
{ {
this->Rev.Date.assign(&this->CData[0], this->CData.size()); this->Rev.Date.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "msg") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "msg")
{ {
this->Rev.Log.assign(&this->CData[0], this->CData.size()); this->Rev.Log.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "files") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "files")
{ {
std::vector<std::string> paths = this->SplitCData(); std::vector<std::string> paths = this->SplitCData();
for(unsigned int i = 0; i < paths.size(); ++i) for(unsigned int i = 0; i < paths.size(); ++i)
@ -242,7 +242,7 @@ private:
this->Changes.push_back(this->CurChange); this->Changes.push_back(this->CurChange);
} }
} }
else if(strcmp(name, "file_adds") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "file_adds")
{ {
std::string added_paths(this->CData.begin(), this->CData.end()); std::string added_paths(this->CData.begin(), this->CData.end());
for(unsigned int i = 0; i < this->Changes.size(); ++i) for(unsigned int i = 0; i < this->Changes.size(); ++i)
@ -253,7 +253,7 @@ private:
} }
} }
} }
else if(strcmp(name, "file_dels") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "file_dels")
{ {
std::string added_paths(this->CData.begin(), this->CData.end()); std::string added_paths(this->CData.begin(), this->CData.end());
for(unsigned int i = 0; i < this->Changes.size(); ++i) for(unsigned int i = 0; i < this->Changes.size(); ++i)

View File

@ -567,7 +567,7 @@ void cmCTestLaunch::WriteXMLLabels(std::ostream& fxml)
fxml << "\n"; fxml << "\n";
fxml << "\t\t<!-- Interested parties -->\n"; fxml << "\t\t<!-- Interested parties -->\n";
fxml << "\t\t<Labels>\n"; fxml << "\t\t<Labels>\n";
for(std::set<cmStdString>::const_iterator li = this->Labels.begin(); for(std::set<std::string>::const_iterator li = this->Labels.begin();
li != this->Labels.end(); ++li) li != this->Labels.end(); ++li)
{ {
fxml << "\t\t\t<Label>" << cmXMLSafe(*li) << "</Label>\n"; fxml << "\t\t\t<Label>" << cmXMLSafe(*li) << "</Label>\n";

View File

@ -73,7 +73,7 @@ private:
bool HaveErr; bool HaveErr;
// Labels associated with the build rule. // Labels associated with the build rule.
std::set<cmStdString> Labels; std::set<std::string> Labels;
void LoadLabels(); void LoadLabels();
bool SourceMatches(std::string const& lhs, bool SourceMatches(std::string const& lhs,
std::string const& rhs); std::string const& rhs);

View File

@ -41,7 +41,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_memcheck";} virtual std::string GetName() const { return "ctest_memcheck";}
cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand); cmTypeMacro(cmCTestMemCheckCommand, cmCTestTestCommand);

View File

@ -49,21 +49,15 @@ class cmBoundsCheckerParser : public cmXMLParser
{ {
public: public:
cmBoundsCheckerParser(cmCTest* c) { this->CTest = c;} cmBoundsCheckerParser(cmCTest* c) { this->CTest = c;}
void StartElement(const char* name, const char** atts) void StartElement(const std::string& name, const char** atts)
{ {
if(strcmp(name, "MemoryLeak") == 0) if(name == "MemoryLeak" ||
name == "ResourceLeak")
{ {
this->Errors.push_back(cmCTestMemCheckHandler::MLK); this->Errors.push_back(cmCTestMemCheckHandler::MLK);
} }
if(strcmp(name, "ResourceLeak") == 0) else if(name == "Error" ||
{ name == "Dangling Pointer")
this->Errors.push_back(cmCTestMemCheckHandler::MLK);
}
if(strcmp(name, "Error") == 0)
{
this->ParseError(atts);
}
if(strcmp(name, "Dangling Pointer") == 0)
{ {
this->ParseError(atts); this->ParseError(atts);
} }
@ -79,7 +73,7 @@ public:
ostr << "\n"; ostr << "\n";
this->Log += ostr.str(); this->Log += ostr.str();
} }
void EndElement(const char* ) void EndElement(const std::string& )
{ {
} }
@ -246,8 +240,8 @@ int cmCTestMemCheckHandler::PostProcessHandler()
void cmCTestMemCheckHandler::GenerateTestCommand( void cmCTestMemCheckHandler::GenerateTestCommand(
std::vector<std::string>& args, int test) std::vector<std::string>& args, int test)
{ {
std::vector<cmStdString>::size_type pp; std::vector<std::string>::size_type pp;
cmStdString index; std::string index;
cmOStringStream stream; cmOStringStream stream;
std::string memcheckcommand std::string memcheckcommand
= cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
@ -255,9 +249,9 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
index = stream.str(); index = stream.str();
for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ ) for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ )
{ {
cmStdString arg = this->MemoryTesterDynamicOptions[pp]; std::string arg = this->MemoryTesterDynamicOptions[pp];
cmStdString::size_type pos = arg.find("??"); std::string::size_type pos = arg.find("??");
if (pos != cmStdString::npos) if (pos != std::string::npos)
{ {
arg.replace(pos, 2, index); arg.replace(pos, 2, index);
} }
@ -580,7 +574,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
return false; return false;
} }
std::vector<cmStdString>::size_type cc; std::vector<std::string>::size_type cc;
for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ ) for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ )
{ {
this->MemoryTesterGlobalResults[cc] = 0; this->MemoryTesterGlobalResults[cc] = 0;
@ -627,7 +621,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
const std::string& str, std::string& log, const std::string& str, std::string& log,
int* results) int* results)
{ {
std::vector<cmStdString> lines; std::vector<std::string> lines;
cmSystemTools::Split(str.c_str(), lines); cmSystemTools::Split(str.c_str(), lines);
cmOStringStream ostr; cmOStringStream ostr;
log = ""; log = "";
@ -636,7 +630,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
int defects = 0; int defects = 0;
for( std::vector<cmStdString>::iterator i = lines.begin(); for( std::vector<std::string>::iterator i = lines.begin();
i != lines.end(); ++i) i != lines.end(); ++i)
{ {
int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT; int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
@ -681,7 +675,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
const std::string& str, std::string& log, const std::string& str, std::string& log,
int* results) int* results)
{ {
std::vector<cmStdString> lines; std::vector<std::string> lines;
cmSystemTools::Split(str.c_str(), lines); cmSystemTools::Split(str.c_str(), lines);
bool unlimitedOutput = false; bool unlimitedOutput = false;
if(str.find("CTEST_FULL_OUTPUT") != str.npos || if(str.find("CTEST_FULL_OUTPUT") != str.npos ||
@ -864,10 +858,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
{ {
log = ""; log = "";
double sttime = cmSystemTools::GetTime(); double sttime = cmSystemTools::GetTime();
std::vector<cmStdString> lines; std::vector<std::string> lines;
cmSystemTools::Split(str.c_str(), lines); cmSystemTools::Split(str.c_str(), lines);
cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl); cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl);
std::vector<cmStdString>::size_type cc; std::vector<std::string>::size_type cc;
for ( cc = 0; cc < lines.size(); cc ++ ) for ( cc = 0; cc < lines.size(); cc ++ )
{ {
if(lines[cc] == BOUNDS_CHECKER_MARKER) if(lines[cc] == BOUNDS_CHECKER_MARKER)
@ -923,7 +917,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessBoundsCheckerTest for : " "PostProcessBoundsCheckerTest for : "
<< res.Name.c_str() << std::endl); << res.Name.c_str() << std::endl);
cmStdString ofile = testOutputFileName(test); std::string ofile = testOutputFileName(test);
if ( ofile.empty() ) if ( ofile.empty() )
{ {
return; return;
@ -979,7 +973,7 @@ void
cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
int test) int test)
{ {
cmStdString ofile = testOutputFileName(test); std::string ofile = testOutputFileName(test);
if ( ofile.empty() ) if ( ofile.empty() )
{ {
@ -1000,15 +994,15 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
} }
} }
cmStdString std::string
cmCTestMemCheckHandler::testOutputFileName(int test) cmCTestMemCheckHandler::testOutputFileName(int test)
{ {
cmStdString index; std::string index;
cmOStringStream stream; cmOStringStream stream;
stream << test; stream << test;
index = stream.str(); index = stream.str();
cmStdString ofile = this->MemoryTesterOutputFile; std::string ofile = this->MemoryTesterOutputFile;
cmStdString::size_type pos = ofile.find("??"); std::string::size_type pos = ofile.find("??");
ofile.replace(pos, 2, index); ofile.replace(pos, 2, index);
if ( !cmSystemTools::FileExists(ofile.c_str()) ) if ( !cmSystemTools::FileExists(ofile.c_str()) )

View File

@ -89,8 +89,8 @@ private:
std::string BoundsCheckerDPBDFile; std::string BoundsCheckerDPBDFile;
std::string BoundsCheckerXMLFile; std::string BoundsCheckerXMLFile;
std::string MemoryTester; std::string MemoryTester;
std::vector<cmStdString> MemoryTesterDynamicOptions; std::vector<std::string> MemoryTesterDynamicOptions;
std::vector<cmStdString> MemoryTesterOptions; std::vector<std::string> MemoryTesterOptions;
int MemoryTesterStyle; int MemoryTesterStyle;
std::string MemoryTesterOutputFile; std::string MemoryTesterOutputFile;
int MemoryTesterGlobalResults[NO_MEMORY_FAULT]; int MemoryTesterGlobalResults[NO_MEMORY_FAULT];
@ -103,8 +103,8 @@ private:
*/ */
void GenerateDartOutput(std::ostream& os); void GenerateDartOutput(std::ostream& os);
std::vector<cmStdString> CustomPreMemCheck; std::vector<std::string> CustomPreMemCheck;
std::vector<cmStdString> CustomPostMemCheck; std::vector<std::string> CustomPostMemCheck;
//! Parse Valgrind/Purify/Bounds Checker result out of the output //! Parse Valgrind/Purify/Bounds Checker result out of the output
//string. After running, log holds the output and results hold the //string. After running, log holds the output and results hold the
@ -127,7 +127,7 @@ private:
int test); int test);
///! generate the output filename for the given test index ///! generate the output filename for the given test index
cmStdString testOutputFileName(int test); std::string testOutputFileName(int test);
}; };
#endif #endif

View File

@ -369,7 +369,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
// Write list of failed tests // Write list of failed tests
fout << "---\n"; fout << "---\n";
for(std::vector<cmStdString>::iterator i = this->Failed->begin(); for(std::vector<std::string>::iterator i = this->Failed->begin();
i != this->Failed->end(); ++i) i != this->Failed->end(); ++i)
{ {
fout << i->c_str() << "\n"; fout << i->c_str() << "\n";

View File

@ -41,8 +41,8 @@ public:
void PrintTestList(); void PrintTestList();
void PrintLabels(); void PrintLabels();
void SetPassFailVectors(std::vector<cmStdString>* passed, void SetPassFailVectors(std::vector<std::string>* passed,
std::vector<cmStdString>* failed) std::vector<std::string>* failed)
{ {
this->Passed = passed; this->Passed = passed;
this->Failed = failed; this->Failed = failed;
@ -107,9 +107,9 @@ protected:
PropertiesMap Properties; PropertiesMap Properties;
std::map<int, bool> TestRunningMap; std::map<int, bool> TestRunningMap;
std::map<int, bool> TestFinishMap; std::map<int, bool> TestFinishMap;
std::map<int, cmStdString> TestOutput; std::map<int, std::string> TestOutput;
std::vector<cmStdString>* Passed; std::vector<std::string>* Passed;
std::vector<cmStdString>* Failed; std::vector<std::string>* Failed;
std::vector<std::string> LastTestsFailed; std::vector<std::string> LastTestsFailed;
std::set<std::string> LockedResources; std::set<std::string> LockedResources;
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults; std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;

View File

@ -346,10 +346,10 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
//The CTEST_P4_OPTIONS variable adds additional Perforce command line //The CTEST_P4_OPTIONS variable adds additional Perforce command line
//options before the main command //options before the main command
std::string opts = this->CTest->GetCTestConfiguration("P4Options"); std::string opts = this->CTest->GetCTestConfiguration("P4Options");
std::vector<cmStdString> args = std::vector<std::string> args =
cmSystemTools::ParseArguments(opts.c_str()); cmSystemTools::ParseArguments(opts.c_str());
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
P4Options.push_back(ai->c_str()); P4Options.push_back(ai->c_str());
@ -538,8 +538,8 @@ bool cmCTestP4::UpdateImpl()
{ {
opts = this->CTest->GetCTestConfiguration("P4UpdateOptions"); opts = this->CTest->GetCTestConfiguration("P4UpdateOptions");
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
p4_sync.push_back(ai->c_str()); p4_sync.push_back(ai->c_str());

View File

@ -46,7 +46,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_read_custom_files";} virtual std::string GetName() const { return "ctest_read_custom_files";}
cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand); cmTypeMacro(cmCTestReadCustomFilesCommand, cmCTestCommand);

View File

@ -47,7 +47,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_run_script";} virtual std::string GetName() const { return "ctest_run_script";}
cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand); cmTypeMacro(cmCTestRunScriptCommand, cmCTestCommand);
}; };

View File

@ -277,7 +277,7 @@ bool cmCTestSVN::UpdateImpl()
{ {
opts = this->CTest->GetCTestConfiguration("SVNUpdateOptions"); opts = this->CTest->GetCTestConfiguration("SVNUpdateOptions");
} }
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str()); std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
// Specify the start time for nightly testing. // Specify the start time for nightly testing.
if(this->CTest->GetTestModel() == cmCTest::NIGHTLY) if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
@ -287,7 +287,7 @@ bool cmCTestSVN::UpdateImpl()
std::vector<char const*> svn_update; std::vector<char const*> svn_update;
svn_update.push_back("update"); svn_update.push_back("update");
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
svn_update.push_back(ai->c_str()); svn_update.push_back(ai->c_str());
@ -314,9 +314,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
std::string userOptions = std::string userOptions =
this->CTest->GetCTestConfiguration("SVNOptions"); this->CTest->GetCTestConfiguration("SVNOptions");
std::vector<cmStdString> parsedUserOptions = std::vector<std::string> parsedUserOptions =
cmSystemTools::ParseArguments(userOptions.c_str()); cmSystemTools::ParseArguments(userOptions.c_str());
for(std::vector<cmStdString>::iterator i = parsedUserOptions.begin(); for(std::vector<std::string>::iterator i = parsedUserOptions.begin();
i != parsedUserOptions.end(); ++i) i != parsedUserOptions.end(); ++i)
{ {
args.push_back(i->c_str()); args.push_back(i->c_str());
@ -361,10 +361,10 @@ private:
return true; return true;
} }
virtual void StartElement(const char* name, const char** atts) virtual void StartElement(const std::string& name, const char** atts)
{ {
this->CData.clear(); this->CData.clear();
if(strcmp(name, "logentry") == 0) if(name == "logentry")
{ {
this->Rev = Revision(); this->Rev = Revision();
this->Rev.SVNInfo = &SVNRepo; this->Rev.SVNInfo = &SVNRepo;
@ -374,7 +374,7 @@ private:
} }
this->Changes.clear(); this->Changes.clear();
} }
else if(strcmp(name, "path") == 0) else if(name == "path")
{ {
this->CurChange = Change(); this->CurChange = Change();
if(const char* action = this->FindAttribute(atts, "action")) if(const char* action = this->FindAttribute(atts, "action"))
@ -389,28 +389,28 @@ private:
this->CData.insert(this->CData.end(), data, data+length); this->CData.insert(this->CData.end(), data, data+length);
} }
virtual void EndElement(const char* name) virtual void EndElement(const std::string& name)
{ {
if(strcmp(name, "logentry") == 0) if(name == "logentry")
{ {
this->SVN->DoRevisionSVN(this->Rev, this->Changes); this->SVN->DoRevisionSVN(this->Rev, this->Changes);
} }
else if(strcmp(name, "path") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "path")
{ {
std::string orig_path(&this->CData[0], this->CData.size()); std::string orig_path(&this->CData[0], this->CData.size());
std::string new_path = SVNRepo.BuildLocalPath( orig_path ); std::string new_path = SVNRepo.BuildLocalPath( orig_path );
this->CurChange.Path.assign(new_path); this->CurChange.Path.assign(new_path);
this->Changes.push_back(this->CurChange); this->Changes.push_back(this->CurChange);
} }
else if(strcmp(name, "author") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "author")
{ {
this->Rev.Author.assign(&this->CData[0], this->CData.size()); this->Rev.Author.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "date") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "date")
{ {
this->Rev.Date.assign(&this->CData[0], this->CData.size()); this->Rev.Date.assign(&this->CData[0], this->CData.size());
} }
else if(strcmp(name, "msg") == 0 && !this->CData.empty()) else if(!this->CData.empty() && name == "msg")
{ {
this->Rev.Log.assign(&this->CData[0], this->CData.size()); this->Rev.Log.assign(&this->CData[0], this->CData.size());
} }

View File

@ -231,7 +231,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
cmSystemTools::GetCTestCommand() << "\n"); cmSystemTools::GetCTestCommand() << "\n");
// now pass through all the other arguments // now pass through all the other arguments
std::vector<cmStdString> &initArgs = std::vector<std::string> &initArgs =
this->CTest->GetInitialCommandLineArguments(); this->CTest->GetInitialCommandLineArguments();
//*** need to make sure this does not have the current script *** //*** need to make sure this does not have the current script ***
for(size_t i=1; i < initArgs.size(); ++i) for(size_t i=1; i < initArgs.size(); ++i)
@ -766,7 +766,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
// do an initial cvs update as required // do an initial cvs update as required
command = this->UpdateCmd; command = this->UpdateCmd;
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
for (it = this->ExtraUpdates.begin(); for (it = this->ExtraUpdates.begin();
it != this->ExtraUpdates.end(); it != this->ExtraUpdates.end();
++ it ) ++ it )

View File

@ -138,26 +138,26 @@ private:
// Try to remove the binary directory once // Try to remove the binary directory once
static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath); static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
std::vector<cmStdString> ConfigurationScripts; std::vector<std::string> ConfigurationScripts;
std::vector<bool> ScriptProcessScope; std::vector<bool> ScriptProcessScope;
bool Backup; bool Backup;
bool EmptyBinDir; bool EmptyBinDir;
bool EmptyBinDirOnce; bool EmptyBinDirOnce;
cmStdString SourceDir; std::string SourceDir;
cmStdString BinaryDir; std::string BinaryDir;
cmStdString BackupSourceDir; std::string BackupSourceDir;
cmStdString BackupBinaryDir; std::string BackupBinaryDir;
cmStdString CTestRoot; std::string CTestRoot;
cmStdString CVSCheckOut; std::string CVSCheckOut;
cmStdString CTestCmd; std::string CTestCmd;
cmStdString UpdateCmd; std::string UpdateCmd;
cmStdString CTestEnv; std::string CTestEnv;
cmStdString InitialCache; std::string InitialCache;
cmStdString CMakeCmd; std::string CMakeCmd;
cmStdString CMOutFile; std::string CMOutFile;
std::vector<cmStdString> ExtraUpdates; std::vector<std::string> ExtraUpdates;
double MinimumInterval; double MinimumInterval;
double ContinuousDuration; double ContinuousDuration;

View File

@ -47,7 +47,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_sleep";} virtual std::string GetName() const { return "ctest_sleep";}
cmTypeMacro(cmCTestSleepCommand, cmCTestCommand); cmTypeMacro(cmCTestSleepCommand, cmCTestCommand);

View File

@ -55,7 +55,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_start";} virtual std::string GetName() const { return "ctest_start";}
cmTypeMacro(cmCTestStartCommand, cmCTestCommand); cmTypeMacro(cmCTestStartCommand, cmCTestCommand);

View File

@ -72,7 +72,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
if (notesFilesVariable) if (notesFilesVariable)
{ {
std::vector<std::string> notesFiles; std::vector<std::string> notesFiles;
std::vector<cmStdString> newNotesFiles; cmCTest::VectorOfStrings newNotesFiles;
cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles); cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
std::vector<std::string>::iterator it; std::vector<std::string>::iterator it;
for ( it = notesFiles.begin(); for ( it = notesFiles.begin();
@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
if (extraFilesVariable) if (extraFilesVariable)
{ {
std::vector<std::string> extraFiles; std::vector<std::string> extraFiles;
std::vector<cmStdString> newExtraFiles; cmCTest::VectorOfStrings newExtraFiles;
cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles); cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
std::vector<std::string>::iterator it; std::vector<std::string>::iterator it;
for ( it = extraFiles.begin(); for ( it = extraFiles.begin();
@ -222,7 +222,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
if(this->ArgumentDoing == ArgumentDoingFiles) if(this->ArgumentDoing == ArgumentDoingFiles)
{ {
cmStdString filename(arg); std::string filename(arg);
if(cmSystemTools::FileExists(filename.c_str())) if(cmSystemTools::FileExists(filename.c_str()))
{ {
this->Files.insert(filename); this->Files.insert(filename);

View File

@ -48,7 +48,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_submit";} virtual std::string GetName() const { return "ctest_submit";}
cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);

View File

@ -68,10 +68,10 @@ private:
return val; return val;
} }
virtual void StartElement(const char* name, const char** atts) virtual void StartElement(const std::string& name, const char** atts)
{ {
this->CurrentValue.clear(); this->CurrentValue.clear();
if(strcmp(name, "cdash") == 0) if(name == "cdash")
{ {
this->CDashVersion = this->FindAttribute(atts, "version"); this->CDashVersion = this->FindAttribute(atts, "version");
} }
@ -82,9 +82,9 @@ private:
this->CurrentValue.insert(this->CurrentValue.end(), data, data+length); this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
} }
virtual void EndElement(const char* name) virtual void EndElement(const std::string& name)
{ {
if(strcmp(name, "status") == 0) if(name == "status")
{ {
std::string status = cmSystemTools::UpperCase(this->GetCurrentValue()); std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
if(status == "OK" || status == "SUCCESS") if(status == "OK" || status == "SUCCESS")
@ -100,15 +100,15 @@ private:
this->Status = STATUS_ERROR; this->Status = STATUS_ERROR;
} }
} }
else if(strcmp(name, "filename") == 0) else if(name == "filename")
{ {
this->Filename = this->GetCurrentValue(); this->Filename = this->GetCurrentValue();
} }
else if(strcmp(name, "md5") == 0) else if(name == "md5")
{ {
this->MD5 = this->GetCurrentValue(); this->MD5 = this->GetCurrentValue();
} }
else if(strcmp(name, "message") == 0) else if(name == "message")
{ {
this->Message = this->GetCurrentValue(); this->Message = this->GetCurrentValue();
} }
@ -170,10 +170,10 @@ void cmCTestSubmitHandler::Initialize()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix, bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url) const std::string& url)
{ {
CURL *curl; CURL *curl;
CURLcode res; CURLcode res;
@ -217,12 +217,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1); ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
cmStdString local_file = *file; std::string local_file = *file;
if ( !cmSystemTools::FileExists(local_file.c_str()) ) if ( !cmSystemTools::FileExists(local_file.c_str()) )
{ {
local_file = localprefix + "/" + *file; local_file = localprefix + "/" + *file;
} }
cmStdString upload_as std::string upload_as
= url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file); = url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
struct stat st; struct stat st;
@ -324,10 +324,10 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Uploading files is simpler // Uploading files is simpler
bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url) const std::string& url)
{ {
CURL *curl; CURL *curl;
CURLcode res; CURLcode res;
@ -336,8 +336,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
/* In windows, this will init the winsock stuff */ /* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL); ::curl_global_init(CURL_GLOBAL_ALL);
cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions")); std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args; std::vector<std::string> args;
cmSystemTools::ExpandListArgument(curlopt.c_str(), args); cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
bool verifyPeerOff = false; bool verifyPeerOff = false;
@ -354,7 +354,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
verifyHostOff = true; verifyHostOff = true;
} }
} }
cmStdString::size_type kk; std::string::size_type kk;
cmCTest::SetOfStrings::const_iterator file; cmCTest::SetOfStrings::const_iterator file;
for ( file = files.begin(); file != files.end(); ++file ) for ( file = files.begin(); file != files.end(); ++file )
{ {
@ -414,18 +414,18 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
::curl_easy_setopt(curl, CURLOPT_PUT, 1); ::curl_easy_setopt(curl, CURLOPT_PUT, 1);
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
cmStdString local_file = *file; std::string local_file = *file;
if ( !cmSystemTools::FileExists(local_file.c_str()) ) if ( !cmSystemTools::FileExists(local_file.c_str()) )
{ {
local_file = localprefix + "/" + *file; local_file = localprefix + "/" + *file;
} }
cmStdString remote_file std::string remote_file
= remoteprefix + cmSystemTools::GetFilenameName(*file); = remoteprefix + cmSystemTools::GetFilenameName(*file);
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to " *this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
<< remote_file.c_str() << std::endl; << remote_file.c_str() << std::endl;
cmStdString ofile = ""; std::string ofile = "";
for ( kk = 0; kk < remote_file.size(); kk ++ ) for ( kk = 0; kk < remote_file.size(); kk ++ )
{ {
char c = remote_file[kk]; char c = remote_file[kk];
@ -448,8 +448,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
ofile.append(hexCh); ofile.append(hexCh);
} }
} }
cmStdString upload_as std::string upload_as
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&") = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+ "FileName=" + ofile; + "FileName=" + ofile;
upload_as += "&MD5="; upload_as += "&MD5=";
@ -666,9 +666,9 @@ void cmCTestSubmitHandler
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCTestSubmitHandler::TriggerUsingHTTP( bool cmCTestSubmitHandler::TriggerUsingHTTP(
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url) const std::string& url)
{ {
CURL *curl; CURL *curl;
char error_buffer[1024]; char error_buffer[1024];
@ -721,10 +721,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk); ::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
cmStdString rfile std::string rfile
= remoteprefix + cmSystemTools::GetFilenameName(*file); = remoteprefix + cmSystemTools::GetFilenameName(*file);
cmStdString ofile = ""; std::string ofile = "";
cmStdString::iterator kk; std::string::iterator kk;
for ( kk = rfile.begin(); kk < rfile.end(); ++ kk) for ( kk = rfile.begin(); kk < rfile.end(); ++ kk)
{ {
char c = *kk; char c = *kk;
@ -747,8 +747,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
ofile.append(hexCh); ofile.append(hexCh);
} }
} }
cmStdString turl std::string turl
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&") = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+ "xmlfile=" + ofile; + "xmlfile=" + ofile;
*this->LogFile << "Trigger url: " << turl.c_str() << std::endl; *this->LogFile << "Trigger url: " << turl.c_str() << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
@ -805,11 +805,11 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCTestSubmitHandler::SubmitUsingSCP( bool cmCTestSubmitHandler::SubmitUsingSCP(
const cmStdString& scp_command, const std::string& scp_command,
const cmStdString& localprefix, const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url) const std::string& url)
{ {
if ( !scp_command.size() || !localprefix.size() || if ( !scp_command.size() || !localprefix.size() ||
!files.size() || !remoteprefix.size() || !url.size() ) !files.size() || !remoteprefix.size() || !url.size() )
@ -906,10 +906,10 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCTestSubmitHandler::SubmitUsingCP( bool cmCTestSubmitHandler::SubmitUsingCP(
const cmStdString& localprefix, const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& destination) const std::string& destination)
{ {
if ( !localprefix.size() || if ( !localprefix.size() ||
!files.size() || !remoteprefix.size() || !destination.size() ) !files.size() || !remoteprefix.size() || !destination.size() )
@ -947,17 +947,17 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#if defined(CTEST_USE_XMLRPC) #if defined(CTEST_USE_XMLRPC)
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url) const std::string& url)
{ {
xmlrpc_env env; xmlrpc_env env;
char ctestString[] = "CTest"; char ctestString[] = "CTest";
std::string ctestVersionString = cmVersion::GetCMakeVersion(); std::string ctestVersionString = cmVersion::GetCMakeVersion();
char* ctestVersion = const_cast<char*>(ctestVersionString.c_str()); char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
cmStdString realURL = url + "/" + remoteprefix + "/Command/"; std::string realURL = url + "/" + remoteprefix + "/Command/";
/* Start up our XML-RPC client library. */ /* Start up our XML-RPC client library. */
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion); xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
@ -973,7 +973,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
{ {
xmlrpc_value *result; xmlrpc_value *result;
cmStdString local_file = *file; std::string local_file = *file;
if ( !cmSystemTools::FileExists(local_file.c_str()) ) if ( !cmSystemTools::FileExists(local_file.c_str()) )
{ {
local_file = localprefix + "/" + *file; local_file = localprefix + "/" + *file;
@ -1045,10 +1045,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
return true; return true;
} }
#else #else
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&, bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&,
std::set<cmStdString> const&, std::set<std::string> const&,
cmStdString const&, std::string const&,
cmStdString const&) std::string const&)
{ {
return false; return false;
} }
@ -1085,7 +1085,7 @@ int cmCTestSubmitHandler::ProcessHandler()
} }
if ( getenv("HTTP_PROXY_TYPE") ) if ( getenv("HTTP_PROXY_TYPE") )
{ {
cmStdString type = getenv("HTTP_PROXY_TYPE"); std::string type = getenv("HTTP_PROXY_TYPE");
// HTTP/SOCKS4/SOCKS5 // HTTP/SOCKS4/SOCKS5
if ( type == "HTTP" ) if ( type == "HTTP" )
{ {
@ -1122,7 +1122,7 @@ int cmCTestSubmitHandler::ProcessHandler()
} }
if ( getenv("FTP_PROXY_TYPE") ) if ( getenv("FTP_PROXY_TYPE") )
{ {
cmStdString type = getenv("FTP_PROXY_TYPE"); std::string type = getenv("FTP_PROXY_TYPE");
// HTTP/SOCKS4/SOCKS5 // HTTP/SOCKS4/SOCKS5
if ( type == "HTTP" ) if ( type == "HTTP" )
{ {
@ -1178,7 +1178,7 @@ int cmCTestSubmitHandler::ProcessHandler()
this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml"); this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml");
if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml")) if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml"))
{ {
cmCTest::VectorOfStrings gfiles; std::vector<std::string> gfiles;
std::string gpath std::string gpath
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag(); = buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
std::string::size_type glen = gpath.size() + 1; std::string::size_type glen = gpath.size() + 1;
@ -1247,7 +1247,7 @@ int cmCTestSubmitHandler::ProcessHandler()
} }
this->SetLogFile(&ofs); this->SetLogFile(&ofs);
cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod")); std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
if ( dropMethod == "" || dropMethod == "ftp" ) if ( dropMethod == "" || dropMethod == "ftp" )
{ {

View File

@ -47,33 +47,33 @@ private:
/** /**
* Submit file using various ways * Submit file using various ways
*/ */
bool SubmitUsingFTP(const cmStdString& localprefix, bool SubmitUsingFTP(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
bool SubmitUsingHTTP(const cmStdString& localprefix, bool SubmitUsingHTTP(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
bool SubmitUsingSCP(const cmStdString& scp_command, bool SubmitUsingSCP(const std::string& scp_command,
const cmStdString& localprefix, const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
bool SubmitUsingCP( const cmStdString& localprefix, bool SubmitUsingCP( const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
bool TriggerUsingHTTP(const std::set<cmStdString>& files, bool TriggerUsingHTTP(const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
bool SubmitUsingXMLRPC(const cmStdString& localprefix, bool SubmitUsingXMLRPC(const std::string& localprefix,
const std::set<cmStdString>& files, const std::set<std::string>& files,
const cmStdString& remoteprefix, const std::string& remoteprefix,
const cmStdString& url); const std::string& url);
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar; typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
@ -82,10 +82,10 @@ private:
std::string GetSubmitResultsPrefix(); std::string GetSubmitResultsPrefix();
class ResponseParser; class ResponseParser;
cmStdString HTTPProxy; std::string HTTPProxy;
int HTTPProxyType; int HTTPProxyType;
cmStdString HTTPProxyAuth; std::string HTTPProxyAuth;
cmStdString FTPProxy; std::string FTPProxy;
int FTPProxyType; int FTPProxyType;
std::ostream* LogFile; std::ostream* LogFile;
bool SubmitPart[cmCTest::PartCount]; bool SubmitPart[cmCTest::PartCount];

View File

@ -39,7 +39,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_test";} virtual std::string GetName() const { return "ctest_test";}
cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestTestCommand, cmCTestHandlerCommand);

View File

@ -60,7 +60,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "subdirs";} virtual std::string GetName() const { return "subdirs";}
cmTypeMacro(cmCTestSubdirCommand, cmCommand); cmTypeMacro(cmCTestSubdirCommand, cmCommand);
@ -157,7 +157,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_subdirectory";} virtual std::string GetName() const { return "add_subdirectory";}
cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand); cmTypeMacro(cmCTestAddSubdirectoryCommand, cmCommand);
@ -243,7 +243,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_test";} virtual std::string GetName() const { return "add_test";}
cmTypeMacro(cmCTestAddTestCommand, cmCommand); cmTypeMacro(cmCTestAddTestCommand, cmCommand);
@ -287,7 +287,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "set_tests_properties";} virtual std::string GetName() const { return "set_tests_properties";}
cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand); cmTypeMacro(cmCTestSetTestsPropertiesCommand, cmCommand);
@ -540,8 +540,8 @@ int cmCTestTestHandler::ProcessHandler()
this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile); this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile);
this->LogFile = &mLogFile; this->LogFile = &mLogFile;
std::vector<cmStdString> passed; std::vector<std::string> passed;
std::vector<cmStdString> failed; std::vector<std::string> failed;
int total; int total;
//start the real time clock //start the real time clock
@ -569,7 +569,7 @@ int cmCTestTestHandler::ProcessHandler()
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl
<< "The following tests passed:" << std::endl); << "The following tests passed:" << std::endl);
for(std::vector<cmStdString>::iterator j = passed.begin(); for(std::vector<std::string>::iterator j = passed.begin();
j != passed.end(); ++j) j != passed.end(); ++j)
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j
@ -661,8 +661,8 @@ void cmCTestTestHandler::PrintLabelSummary()
cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin(); cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
cmCTestTestHandler::TestResultsVector::iterator ri = cmCTestTestHandler::TestResultsVector::iterator ri =
this->TestResults.begin(); this->TestResults.begin();
std::map<cmStdString, double> labelTimes; std::map<std::string, double> labelTimes;
std::set<cmStdString> labels; std::set<std::string> labels;
// initialize maps // initialize maps
std::string::size_type maxlen = 0; std::string::size_type maxlen = 0;
for(; it != this->TestList.end(); ++it) for(; it != this->TestList.end(); ++it)
@ -702,7 +702,7 @@ void cmCTestTestHandler::PrintLabelSummary()
{ {
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:"); cmCTestLog(this->CTest, HANDLER_OUTPUT, "\nLabel Time Summary:");
} }
for(std::set<cmStdString>::const_iterator i = labels.begin(); for(std::set<std::string>::const_iterator i = labels.begin();
i != labels.end(); ++i) i != labels.end(); ++i)
{ {
std::string label = *i; std::string label = *i;
@ -1050,8 +1050,8 @@ bool cmCTestTestHandler::GetValue(const char* tag,
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed, void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed,
std::vector<cmStdString> &failed) std::vector<std::string> &failed)
{ {
this->ComputeTestList(); this->ComputeTestList();
this->StartTest = this->CTest->CurrentTime(); this->StartTest = this->CTest->CurrentTime();
@ -1216,7 +1216,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
<< "name=\"Command Line\"><Value>" << "name=\"Command Line\"><Value>"
<< cmXMLSafe(result->FullCommandLine) << cmXMLSafe(result->FullCommandLine)
<< "</Value></NamedMeasurement>\n"; << "</Value></NamedMeasurement>\n";
std::map<cmStdString,cmStdString>::iterator measureIt; std::map<std::string,std::string>::iterator measureIt;
for ( measureIt = result->Properties->Measurements.begin(); for ( measureIt = result->Properties->Measurements.begin();
measureIt != result->Properties->Measurements.end(); measureIt != result->Properties->Measurements.end();
++ measureIt ) ++ measureIt )
@ -1328,9 +1328,9 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec) int cmCTestTestHandler::ExecuteCommands(std::vector<std::string>& vec)
{ {
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
for ( it = vec.begin(); it != vec.end(); ++it ) for ( it = vec.begin(); it != vec.end(); ++it )
{ {
int retVal = 0; int retVal = 0;
@ -2112,7 +2112,7 @@ bool cmCTestTestHandler::SetTestsProperties(
const std::vector<std::string>& args) const std::vector<std::string>& args)
{ {
std::vector<std::string>::const_iterator it; std::vector<std::string>::const_iterator it;
std::vector<cmStdString> tests; std::vector<std::string> tests;
bool found = false; bool found = false;
for ( it = args.begin(); it != args.end(); ++ it ) for ( it = args.begin(); it != args.end(); ++ it )
{ {
@ -2137,7 +2137,7 @@ bool cmCTestTestHandler::SetTestsProperties(
break; break;
} }
std::string val = *it; std::string val = *it;
std::vector<cmStdString>::const_iterator tit; std::vector<std::string>::const_iterator tit;
for ( tit = tests.begin(); tit != tests.end(); ++ tit ) for ( tit = tests.begin(); tit != tests.end(); ++ tit )
{ {
cmCTestTestHandler::ListOfTests::iterator rtit; cmCTestTestHandler::ListOfTests::iterator rtit;
@ -2319,7 +2319,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
} }
if ( this->MemCheck ) if ( this->MemCheck )
{ {
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
bool found = false; bool found = false;
for ( it = this->CustomTestsIgnore.begin(); for ( it = this->CustomTestsIgnore.begin();
it != this->CustomTestsIgnore.end(); ++ it ) it != this->CustomTestsIgnore.end(); ++ it )
@ -2339,7 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
} }
else else
{ {
std::vector<cmStdString>::iterator it; std::vector<std::string>::iterator it;
bool found = false; bool found = false;
for ( it = this->CustomTestsIgnore.begin(); for ( it = this->CustomTestsIgnore.begin();
it != this->CustomTestsIgnore.end(); ++ it ) it != this->CustomTestsIgnore.end(); ++ it )

View File

@ -87,8 +87,8 @@ public:
// ctest -j N will break for that feature // ctest -j N will break for that feature
struct cmCTestTestProperties struct cmCTestTestProperties
{ {
cmStdString Name; std::string Name;
cmStdString Directory; std::string Directory;
std::vector<std::string> Args; std::vector<std::string> Args;
std::vector<std::string> RequiredFiles; std::vector<std::string> RequiredFiles;
std::vector<std::string> Depends; std::vector<std::string> Depends;
@ -98,7 +98,7 @@ public:
std::string> > ErrorRegularExpressions; std::string> > ErrorRegularExpressions;
std::vector<std::pair<cmsys::RegularExpression, std::vector<std::pair<cmsys::RegularExpression,
std::string> > RequiredRegularExpressions; std::string> > RequiredRegularExpressions;
std::map<cmStdString, cmStdString> Measurements; std::map<std::string, std::string> Measurements;
bool IsInBasedOnREOptions; bool IsInBasedOnREOptions;
bool WillFail; bool WillFail;
float Cost; float Cost;
@ -162,7 +162,7 @@ protected:
virtual int PreProcessHandler(); virtual int PreProcessHandler();
virtual int PostProcessHandler(); virtual int PostProcessHandler();
virtual void GenerateTestCommand(std::vector<std::string>& args, int test); virtual void GenerateTestCommand(std::vector<std::string>& args, int test);
int ExecuteCommands(std::vector<cmStdString>& vec); int ExecuteCommands(std::vector<std::string>& vec);
void WriteTestResultHeader(std::ostream& os, cmCTestTestResult* result); void WriteTestResultHeader(std::ostream& os, cmCTestTestResult* result);
void WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result); void WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result);
@ -177,7 +177,7 @@ protected:
typedef std::vector<cmCTestTestResult> TestResultsVector; typedef std::vector<cmCTestTestResult> TestResultsVector;
TestResultsVector TestResults; TestResultsVector TestResults;
std::vector<cmStdString> CustomTestsIgnore; std::vector<std::string> CustomTestsIgnore;
std::string StartTest; std::string StartTest;
std::string EndTest; std::string EndTest;
unsigned int StartTestTime; unsigned int StartTestTime;
@ -210,8 +210,8 @@ private:
/** /**
* Run the tests for a directory and any subdirectories * Run the tests for a directory and any subdirectories
*/ */
void ProcessDirectory(std::vector<cmStdString> &passed, void ProcessDirectory(std::vector<std::string> &passed,
std::vector<cmStdString> &failed); std::vector<std::string> &failed);
/** /**
* Get the list of tests in directory and subdirectories. * Get the list of tests in directory and subdirectories.
@ -251,8 +251,8 @@ private:
void ExpandTestsToRunInformation(size_t numPossibleTests); void ExpandTestsToRunInformation(size_t numPossibleTests);
void ExpandTestsToRunInformationForRerunFailed(); void ExpandTestsToRunInformationForRerunFailed();
std::vector<cmStdString> CustomPreTest; std::vector<std::string> CustomPreTest;
std::vector<cmStdString> CustomPostTest; std::vector<std::string> CustomPostTest;
std::vector<int> TestsToRun; std::vector<int> TestsToRun;

View File

@ -39,7 +39,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_update";} virtual std::string GetName() const { return "ctest_update";}
cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestUpdateCommand, cmCTestHandlerCommand);

View File

@ -47,7 +47,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
{ {
if(this->ArgumentDoing == ArgumentDoingFiles) if(this->ArgumentDoing == ArgumentDoingFiles)
{ {
cmStdString filename(arg); std::string filename(arg);
if(cmSystemTools::FileExists(filename.c_str())) if(cmSystemTools::FileExists(filename.c_str()))
{ {
this->Files.insert(filename); this->Files.insert(filename);

View File

@ -43,7 +43,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "ctest_upload";} virtual std::string GetName() const { return "ctest_upload";}
cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand); cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand);

View File

@ -63,9 +63,9 @@ bool cmCTestVC::InitialCheckout(const char* command)
} }
// Construct the initial checkout command line. // Construct the initial checkout command line.
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); std::vector<std::string> args = cmSystemTools::ParseArguments(command);
std::vector<char const*> vc_co; std::vector<char const*> vc_co;
for(std::vector<cmStdString>::const_iterator ai = args.begin(); for(std::vector<std::string>::const_iterator ai = args.begin();
ai != args.end(); ++ai) ai != args.end(); ++ai)
{ {
vc_co.push_back(ai->c_str()); vc_co.push_back(ai->c_str());

View File

@ -182,7 +182,7 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
// ( file , entry ) = "number_executed:timing_info" // ( file , entry ) = "number_executed:timing_info"
// ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1 // ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1
// ( file , entry, line, IGNORE ) =number_executed // ( file , entry, line, IGNORE ) =number_executed
std::vector<cmStdString> args; std::vector<std::string> args;
std::string::size_type pos = line.find('(', 0); std::string::size_type pos = line.find('(', 0);
// if no ( is found, then return line has no coverage // if no ( is found, then return line has no coverage
if(pos == std::string::npos) if(pos == std::string::npos)

View File

@ -140,7 +140,7 @@ bool cmParseMumpsCoverage::LoadPackages(const char* d)
bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine, bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
std::string& filepath) std::string& filepath)
{ {
std::map<cmStdString, cmStdString>::iterator i = std::map<std::string, std::string>::iterator i =
this->RoutineToDirectory.find(routine); this->RoutineToDirectory.find(routine);
if(i != this->RoutineToDirectory.end()) if(i != this->RoutineToDirectory.end())
{ {

View File

@ -44,7 +44,7 @@ protected:
bool FindMumpsFile(std::string const& routine, bool FindMumpsFile(std::string const& routine,
std::string& filepath); std::string& filepath);
protected: protected:
std::map<cmStdString, cmStdString> RoutineToDirectory; std::map<std::string, std::string> RoutineToDirectory;
cmCTestCoverageHandlerContainer& Coverage; cmCTestCoverageHandlerContainer& Coverage;
cmCTest* CTest; cmCTest* CTest;
}; };

View File

@ -34,7 +34,7 @@ bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until)
return true; return true;
} }
bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in, bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in,
cmStdString const& fileName) std::string const& fileName)
{ {
cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector
= this->Coverage.TotalCoverage[fileName]; = this->Coverage.TotalCoverage[fileName];
@ -166,7 +166,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in)
// read the string data // read the string data
in.read(s, size-1); in.read(s, size-1);
s[size-1] = 0; s[size-1] = 0;
cmStdString fileName = s; std::string fileName = s;
delete [] s; delete [] s;
// read close quote // read close quote
if(in.get(c) && c != '"') if(in.get(c) && c != '"')

View File

@ -35,7 +35,7 @@ private:
bool ReadArraySize(std::istream& in, int& size); bool ReadArraySize(std::istream& in, int& size);
bool ReadFileInformation(std::istream& in); bool ReadFileInformation(std::istream& in);
bool ReadInt(std::istream& in, int& v); bool ReadInt(std::istream& in, int& v);
bool ReadCoverageArray(std::istream& in, cmStdString const&); bool ReadCoverageArray(std::istream& in, std::string const&);
bool ReadUntil(std::istream& in, char until); bool ReadUntil(std::istream& in, char until);
cmCTestCoverageHandlerContainer& Coverage; cmCTestCoverageHandlerContainer& Coverage;
cmCTest* CTest; cmCTest* CTest;

View File

@ -20,9 +20,9 @@ public:
protected: protected:
virtual void StartElement(const char* name, const char** atts) virtual void StartElement(const std::string& name, const char** atts)
{ {
if(strcmp(name, "class") == 0) if(name == "class")
{ {
int tagCount = 0; int tagCount = 0;
while(true) while(true)
@ -57,7 +57,7 @@ protected:
++tagCount; ++tagCount;
} }
} }
else if(strcmp(name, "line") == 0) else if(name == "line")
{ {
int tagCount = 0; int tagCount = 0;
int curNumber = -1; int curNumber = -1;
@ -85,7 +85,7 @@ protected:
} }
} }
virtual void EndElement(const char*) {} virtual void EndElement(const std::string&) {}
private: private:

View File

@ -19,9 +19,10 @@
#include "cmCursesDummyWidget.h" #include "cmCursesDummyWidget.h"
#include "../cmSystemTools.h" #include "../cmSystemTools.h"
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key, cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
int labelwidth, const std::string& key,
int entrywidth) : int labelwidth,
int entrywidth) :
Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{ {
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key); this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
@ -31,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
} }
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite( cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
const char* key, const cmCacheManager::CacheIterator& it, bool isNew, const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew,
int labelwidth, int entrywidth) int labelwidth, int entrywidth)
: Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth) : Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
{ {
@ -50,7 +51,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
{ {
case cmCacheManager::BOOL: case cmCacheManager::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1); this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
if (cmSystemTools::IsOn(it.GetValue())) if (cmSystemTools::IsOn(it.GetValue().c_str()))
{ {
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true); static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
} }
@ -93,7 +94,8 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
} }
break; break;
case cmCacheManager::UNINITIALIZED: case cmCacheManager::UNINITIALIZED:
cmSystemTools::Error("Found an undefined variable: ", it.GetName()); cmSystemTools::Error("Found an undefined variable: ",
it.GetName().c_str());
break; break;
default: default:
// TODO : put warning message here // TODO : put warning message here

View File

@ -18,8 +18,9 @@
class cmCursesCacheEntryComposite class cmCursesCacheEntryComposite
{ {
public: public:
cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth); cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
cmCursesCacheEntryComposite(const char* key, int entrywidth);
cmCursesCacheEntryComposite(const std::string& key,
const cmCacheManager::CacheIterator& it, const cmCacheManager::CacheIterator& it,
bool isNew, int labelwidth, int entrywidth); bool isNew, int labelwidth, int entrywidth);
~cmCursesCacheEntryComposite(); ~cmCursesCacheEntryComposite();

View File

@ -84,9 +84,9 @@ cmCursesMainForm::~cmCursesMainForm()
} }
// See if a cache entry is in the list of entries in the ui. // See if a cache entry is in the list of entries in the ui.
bool cmCursesMainForm::LookForCacheEntry(const char* key) bool cmCursesMainForm::LookForCacheEntry(const std::string& key)
{ {
if (!key || !this->Entries) if (!this->Entries)
{ {
return false; return false;
} }
@ -94,7 +94,7 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key)
std::vector<cmCursesCacheEntryComposite*>::iterator it; std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = this->Entries->begin(); it != this->Entries->end(); ++it) for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{ {
if (!strcmp(key, (*it)->Key.c_str())) if (key == (*it)->Key)
{ {
return true; return true;
} }
@ -146,7 +146,7 @@ void cmCursesMainForm::InitializeUI()
this->CMakeInstance->GetCacheManager()->NewIterator(); this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next()) !i.IsAtEnd(); i.Next())
{ {
const char* key = i.GetName(); std::string key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL || if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC || i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED ) i.GetType() == cmCacheManager::UNINITIALIZED )
@ -168,7 +168,7 @@ void cmCursesMainForm::InitializeUI()
this->CMakeInstance->GetCacheManager()->NewIterator(); this->CMakeInstance->GetCacheManager()->NewIterator();
!i.IsAtEnd(); i.Next()) !i.IsAtEnd(); i.Next())
{ {
const char* key = i.GetName(); std::string key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL || if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC || i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED ) i.GetType() == cmCacheManager::UNINITIALIZED )

View File

@ -51,7 +51,7 @@ public:
* Returns true if an entry with the given key is in the * Returns true if an entry with the given key is in the
* list of current composites. * list of current composites.
*/ */
bool LookForCacheEntry(const char* key); bool LookForCacheEntry(const std::string& key);
enum { enum {
MIN_WIDTH = 65, MIN_WIDTH = 65,

View File

@ -89,7 +89,7 @@ void cmCursesOptionsWidget::PreviousOption()
this->SetValue(this->Options[this->CurrentOption].c_str()); this->SetValue(this->Options[this->CurrentOption].c_str());
} }
void cmCursesOptionsWidget::SetOption(const char* value) void cmCursesOptionsWidget::SetOption(const std::string& value)
{ {
this->CurrentOption = 0; // default to 0 index this->CurrentOption = 0; // default to 0 index
this->SetValue(value); this->SetValue(value);

View File

@ -25,7 +25,7 @@ public:
// when this widget has focus. Returns true if the input was // when this widget has focus. Returns true if the input was
// handled. // handled.
virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w); virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
void SetOption(const char*); void SetOption(const std::string&);
void AddOption(std::string const &); void AddOption(std::string const &);
void NextOption(); void NextOption();
void PreviousOption(); void PreviousOption();

View File

@ -57,7 +57,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
{ {
glob = cstr + "*"; glob = cstr + "*";
} }
std::vector<cmStdString> dirs; std::vector<std::string> dirs;
cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0)); cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0));
if ( this->CurrentIndex < dirs.size() ) if ( this->CurrentIndex < dirs.size() )

View File

@ -195,7 +195,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return true; return true;
} }
void cmCursesStringWidget::SetString(const char* value) void cmCursesStringWidget::SetString(const std::string& value)
{ {
this->SetValue(value); this->SetValue(value);
} }

View File

@ -37,7 +37,7 @@ public:
/** /**
* Set/Get the string. * Set/Get the string.
*/ */
void SetString(const char* value); void SetString(const std::string& value);
const char* GetString(); const char* GetString();
virtual const char* GetValue(); virtual const char* GetValue();

View File

@ -46,10 +46,10 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage)
} }
} }
void cmCursesWidget::SetValue(const char* value) void cmCursesWidget::SetValue(const std::string& value)
{ {
this->Value = value; this->Value = value;
set_field_buffer(this->Field, 0, value); set_field_buffer(this->Field, 0, value.c_str());
} }
const char* cmCursesWidget::GetValue() const char* cmCursesWidget::GetValue()

View File

@ -40,7 +40,7 @@ public:
* Set/Get the value (setting the value also changes the contents * Set/Get the value (setting the value also changes the contents
* of the field buffer). * of the field buffer).
*/ */
virtual void SetValue(const char* value); virtual void SetValue(const std::string& value);
virtual const char* GetValue(); virtual const char* GetValue();
/** /**

View File

@ -111,7 +111,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
cmCacheManager::CacheIterator itm = cachem->NewIterator(); cmCacheManager::CacheIterator itm = cachem->NewIterator();
if ( itm.Find("CMAKE_HOME_DIRECTORY")) if ( itm.Find("CMAKE_HOME_DIRECTORY"))
{ {
setSourceDirectory(QString::fromLocal8Bit(itm.GetValue())); setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str()));
} }
if ( itm.Find("CMAKE_GENERATOR")) if ( itm.Find("CMAKE_GENERATOR"))
{ {
@ -201,11 +201,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
} }
QCMakeProperty prop; QCMakeProperty prop;
prop.Key = QString::fromLocal8Bit(i.GetName()); prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
int idx = props.indexOf(prop); int idx = props.indexOf(prop);
if(idx == -1) if(idx == -1)
{ {
toremove.append(QString::fromLocal8Bit(i.GetName())); toremove.append(QString::fromLocal8Bit(i.GetName().c_str()));
} }
else else
{ {
@ -286,15 +286,15 @@ QCMakePropertyList QCMake::properties() const
} }
QCMakeProperty prop; QCMakeProperty prop;
prop.Key = QString::fromLocal8Bit(i.GetName()); prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING"));
prop.Value = QString::fromLocal8Bit(i.GetValue()); prop.Value = QString::fromLocal8Bit(i.GetValue().c_str());
prop.Advanced = i.GetPropertyAsBool("ADVANCED"); prop.Advanced = i.GetPropertyAsBool("ADVANCED");
if(i.GetType() == cmCacheManager::BOOL) if(i.GetType() == cmCacheManager::BOOL)
{ {
prop.Type = QCMakeProperty::BOOL; prop.Type = QCMakeProperty::BOOL;
prop.Value = cmSystemTools::IsOn(i.GetValue()); prop.Value = cmSystemTools::IsOn(i.GetValue().c_str());
} }
else if(i.GetType() == cmCacheManager::PATH) else if(i.GetType() == cmCacheManager::PATH)
{ {

View File

@ -35,7 +35,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "add_compile_options";} virtual std::string GetName() const {return "add_compile_options";}
cmTypeMacro(cmAddCompileOptionsCommand, cmCommand); cmTypeMacro(cmAddCompileOptionsCommand, cmCommand);
}; };

View File

@ -41,7 +41,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "add_custom_command";} virtual std::string GetName() const {return "add_custom_command";}
cmTypeMacro(cmAddCustomCommandCommand, cmCommand); cmTypeMacro(cmAddCustomCommandCommand, cmCommand);
protected: protected:

View File

@ -42,7 +42,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const virtual std::string GetName() const
{return "add_custom_target";} {return "add_custom_target";}
cmTypeMacro(cmAddCustomTargetCommand, cmCommand); cmTypeMacro(cmAddCustomTargetCommand, cmCommand);

View File

@ -41,7 +41,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "add_definitions";} virtual std::string GetName() const {return "add_definitions";}
cmTypeMacro(cmAddDefinitionsCommand, cmCommand); cmTypeMacro(cmAddDefinitionsCommand, cmCommand);
}; };

View File

@ -40,7 +40,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_dependencies";} virtual std::string GetName() const { return "add_dependencies";}
cmTypeMacro(cmAddDependenciesCommand, cmCommand); cmTypeMacro(cmAddDependenciesCommand, cmCommand);
}; };

View File

@ -41,7 +41,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_executable";} virtual std::string GetName() const { return "add_executable";}
cmTypeMacro(cmAddExecutableCommand, cmCommand); cmTypeMacro(cmAddExecutableCommand, cmCommand);
}; };

View File

@ -41,7 +41,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_library";} virtual std::string GetName() const { return "add_library";}
cmTypeMacro(cmAddLibraryCommand, cmCommand); cmTypeMacro(cmAddLibraryCommand, cmCommand);
}; };

View File

@ -42,7 +42,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_subdirectory";} virtual std::string GetName() const { return "add_subdirectory";}
cmTypeMacro(cmAddSubDirectoryCommand, cmCommand); cmTypeMacro(cmAddSubDirectoryCommand, cmCommand);
}; };

View File

@ -40,7 +40,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "add_test";} virtual std::string GetName() const { return "add_test";}
cmTypeMacro(cmAddTestCommand, cmCommand); cmTypeMacro(cmAddTestCommand, cmCommand);
private: private:

View File

@ -44,7 +44,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const { return "aux_source_directory";} virtual std::string GetName() const { return "aux_source_directory";}
cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand); cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);
}; };

View File

@ -45,7 +45,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "break";} virtual std::string GetName() const {return "break";}
cmTypeMacro(cmBreakCommand, cmCommand); cmTypeMacro(cmBreakCommand, cmCommand);
}; };

View File

@ -44,7 +44,7 @@ bool cmBuildCommand
// Parse remaining arguments. // Parse remaining arguments.
const char* configuration = 0; const char* configuration = 0;
const char* project_name = 0; const char* project_name = 0;
const char* target = 0; std::string target;
enum Doing { DoingNone, DoingConfiguration, DoingProjectName, DoingTarget }; enum Doing { DoingNone, DoingConfiguration, DoingProjectName, DoingTarget };
Doing doing = DoingNone; Doing doing = DoingNone;
for(unsigned int i=1; i < args.size(); ++i) for(unsigned int i=1; i < args.size(); ++i)
@ -74,7 +74,7 @@ bool cmBuildCommand
else if(doing == DoingTarget) else if(doing == DoingTarget)
{ {
doing = DoingNone; doing = DoingNone;
target = args[i].c_str(); target = args[i];
} }
else else
{ {
@ -107,7 +107,7 @@ bool cmBuildCommand
std::string makecommand = this->Makefile->GetLocalGenerator() std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration, ->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
0, true); "", true);
this->Makefile->AddDefinition(variable, makecommand.c_str()); this->Makefile->AddDefinition(variable, makecommand.c_str());
@ -136,8 +136,8 @@ bool cmBuildCommand
} }
std::string makecommand = this->Makefile->GetLocalGenerator() std::string makecommand = this->Makefile->GetLocalGenerator()
->GetGlobalGenerator()->GenerateCMakeBuildCommand(0, configType.c_str(), ->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
0, true); "", true);
if(cacheValue) if(cacheValue)
{ {

View File

@ -50,7 +50,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "build_command";} virtual std::string GetName() const {return "build_command";}
cmTypeMacro(cmBuildCommand, cmCommand); cmTypeMacro(cmBuildCommand, cmCommand);
}; };

View File

@ -21,7 +21,7 @@ public:
virtual cmCommand* Clone() { return new cmBuildNameCommand; } virtual cmCommand* Clone() { return new cmBuildNameCommand; }
virtual bool InitialPass(std::vector<std::string> const& args, virtual bool InitialPass(std::vector<std::string> const& args,
cmExecutionStatus &status); cmExecutionStatus &status);
virtual const char* GetName() const {return "build_name";} virtual std::string GetName() const {return "build_name";}
virtual bool IsScriptable() const { return true; } virtual bool IsScriptable() const { return true; }
virtual bool IsDiscouraged() const { return true; } virtual bool IsDiscouraged() const { return true; }
}; };

View File

@ -48,7 +48,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const virtual std::string GetName() const
{ {
return "cmake_host_system_information"; return "cmake_host_system_information";
} }

View File

@ -45,7 +45,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "cmake_minimum_required";} virtual std::string GetName() const {return "cmake_minimum_required";}
cmTypeMacro(cmCMakeMinimumRequired, cmCommand); cmTypeMacro(cmCMakeMinimumRequired, cmCommand);

View File

@ -46,7 +46,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const {return "cmake_policy";} virtual std::string GetName() const {return "cmake_policy";}
cmTypeMacro(cmCMakePolicyCommand, cmCommand); cmTypeMacro(cmCMakePolicyCommand, cmCommand);
private: private:

View File

@ -1153,7 +1153,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
int* retVal, const char* dir, int timeout, std::ostream& ofs) int* retVal, const char* dir, int timeout, std::ostream& ofs)
{ {
// First generate the command and arguments // First generate the command and arguments
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); std::vector<std::string> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1) if(args.size() < 1)
{ {
@ -1161,7 +1161,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
} }
std::vector<const char*> argv; std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin(); for(std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) a != args.end(); ++a)
{ {
argv.push_back(a->c_str()); argv.push_back(a->c_str());
@ -1637,7 +1637,7 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCTest::GenerateNotesFile(const std::vector<cmStdString> &files) int cmCTest::GenerateNotesFile(const VectorOfStrings &files)
{ {
cmGeneratedFileStream ofs; cmGeneratedFileStream ofs;
if ( !this->OpenOutputFile(this->CurrentTag, "Notes.xml", ofs) ) if ( !this->OpenOutputFile(this->CurrentTag, "Notes.xml", ofs) )
@ -1658,7 +1658,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
return 1; return 1;
} }
std::vector<cmStdString> files; VectorOfStrings files;
cmCTestLog(this, OUTPUT, "Create notes file" << std::endl); cmCTestLog(this, OUTPUT, "Create notes file" << std::endl);
@ -1675,7 +1675,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
std::string cmCTest::Base64GzipEncodeFile(std::string file) std::string cmCTest::Base64GzipEncodeFile(std::string file)
{ {
std::string tarFile = file + "_temp.tar.gz"; std::string tarFile = file + "_temp.tar.gz";
std::vector<cmStdString> files; std::vector<std::string> files;
files.push_back(file); files.push_back(file);
if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false)) if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false))
@ -1722,9 +1722,9 @@ std::string cmCTest::Base64EncodeFile(std::string file)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files) bool cmCTest::SubmitExtraFiles(const VectorOfStrings &files)
{ {
std::vector<cmStdString>::const_iterator it; VectorOfStrings::const_iterator it;
for ( it = files.begin(); for ( it = files.begin();
it != files.end(); it != files.end();
++ it ) ++ it )
@ -1749,7 +1749,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
return 1; return 1;
} }
std::vector<cmStdString> files; VectorOfStrings files;
cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl); cmCTestLog(this, OUTPUT, "Submit extra files" << std::endl);
@ -2126,7 +2126,7 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1) if(this->CheckArgument(arg, "--overwrite") && i < args.size() - 1)
{ {
i++; i++;
this->AddCTestConfigurationOverwrite(args[i].c_str()); this->AddCTestConfigurationOverwrite(args[i]);
} }
if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1) if(this->CheckArgument(arg, "-A", "--add-notes") && i < args.size() - 1)
{ {
@ -2593,13 +2593,9 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def, void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
VectorOfStrings& vec) std::vector<std::string>& vec)
{ {
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def); const char* dval = mf->GetDefinition(def);
if ( !dval ) if ( !dval )
{ {
@ -2620,12 +2616,9 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCTest::PopulateCustomInteger(cmMakefile* mf, const char* def, int& val) void cmCTest::PopulateCustomInteger(cmMakefile* mf, const std::string& def,
int& val)
{ {
if ( !def)
{
return;
}
const char* dval = mf->GetDefinition(def); const char* dval = mf->GetDefinition(def);
if ( !dval ) if ( !dval )
{ {
@ -2702,7 +2695,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::GetCTestConfiguration(const char *name) std::string cmCTest::GetCTestConfiguration(const std::string& name)
{ {
if ( this->CTestConfigurationOverwrites.find(name) != if ( this->CTestConfigurationOverwrites.find(name) !=
this->CTestConfigurationOverwrites.end() ) this->CTestConfigurationOverwrites.end() )
@ -2847,9 +2840,8 @@ void cmCTest::AddSubmitFile(Part part, const char* name)
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCTest::AddCTestConfigurationOverwrite(const char* encstr) void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
{ {
std::string overStr = encstr;
size_t epos = overStr.find("="); size_t epos = overStr.find("=");
if ( epos == overStr.npos ) if ( epos == overStr.npos )
{ {
@ -2877,7 +2869,7 @@ void cmCTest::SetConfigType(const char* ct)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var) const char* dconfig, const std::string& cmake_var)
{ {
const char* ctvar; const char* ctvar;
ctvar = mf->GetDefinition(cmake_var); ctvar = mf->GetDefinition(cmake_var);
@ -2900,7 +2892,7 @@ bool cmCTest::RunCommand(
const char* dir, const char* dir,
double timeout) double timeout)
{ {
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command); std::vector<std::string> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1) if(args.size() < 1)
{ {
@ -2908,7 +2900,7 @@ bool cmCTest::RunCommand(
} }
std::vector<const char*> argv; std::vector<const char*> argv;
for(std::vector<cmStdString>::const_iterator a = args.begin(); for(std::vector<std::string>::const_iterator a = args.begin();
a != args.end(); ++a) a != args.end(); ++a)
{ {
argv.push_back(a->c_str()); argv.push_back(a->c_str());

View File

@ -70,8 +70,8 @@ public:
{ {
PartInfo(): Enabled(false) {} PartInfo(): Enabled(false) {}
void SetName(const char* name) { this->Name = name; } void SetName(const std::string& name) { this->Name = name; }
const char* GetName() const { return this->Name.c_str(); } const std::string& GetName() const { return this->Name; }
void Enable() { this->Enabled = true; } void Enable() { this->Enabled = true; }
operator bool() const { return this->Enabled; } operator bool() const { return this->Enabled; }
@ -101,8 +101,8 @@ public:
if the string does not name a valid part. */ if the string does not name a valid part. */
Part GetPartFromName(const char* name); Part GetPartFromName(const char* name);
typedef std::vector<cmStdString> VectorOfStrings; typedef std::vector<cmsys::String> VectorOfStrings;
typedef std::set<cmStdString> SetOfStrings; typedef std::set<std::string> SetOfStrings;
///! Process Command line arguments ///! Process Command line arguments
int Run(std::vector<std::string> &, std::string* output = 0); int Run(std::vector<std::string> &, std::string* output = 0);
@ -172,7 +172,7 @@ public:
std::string GetTestModelString(); std::string GetTestModelString();
static int GetTestModelFromString(const char* str); static int GetTestModelFromString(const char* str);
static std::string CleanString(const std::string& str); static std::string CleanString(const std::string& str);
std::string GetCTestConfiguration(const char *name); std::string GetCTestConfiguration(const std::string& name);
void SetCTestConfiguration(const char *name, const char* value); void SetCTestConfiguration(const char *name, const char* value);
void EmptyCTestConfiguration(); void EmptyCTestConfiguration();
@ -185,9 +185,9 @@ public:
//! Set the notes files to be created. //! Set the notes files to be created.
void SetNotesFiles(const char* notes); void SetNotesFiles(const char* notes);
void PopulateCustomVector(cmMakefile* mf, const char* definition, void PopulateCustomVector(cmMakefile* mf, const std::string& definition,
VectorOfStrings& vec); std::vector<std::string>& vec);
void PopulateCustomInteger(cmMakefile* mf, const char* def, void PopulateCustomInteger(cmMakefile* mf, const std::string& def,
int& val); int& val);
///! Get the current time as string ///! Get the current time as string
@ -332,7 +332,7 @@ public:
* Set the CTest variable from CMake variable * Set the CTest variable from CMake variable
*/ */
bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, bool SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
const char* dconfig, const char* cmake_var); const char* dconfig, const std::string& cmake_var);
//! Make string safe to be send as an URL //! Make string safe to be send as an URL
static std::string MakeURLSafe(const std::string&); static std::string MakeURLSafe(const std::string&);
@ -349,14 +349,14 @@ public:
//! Add overwrite to ctest configuration. //! Add overwrite to ctest configuration.
// The format is key=value // The format is key=value
void AddCTestConfigurationOverwrite(const char* encstr); void AddCTestConfigurationOverwrite(const std::string& encstr);
//! Create XML file that contains all the notes specified //! Create XML file that contains all the notes specified
int GenerateNotesFile(const std::vector<cmStdString> &files); int GenerateNotesFile(const VectorOfStrings &files);
//! Submit extra files to the server //! Submit extra files to the server
bool SubmitExtraFiles(const char* files); bool SubmitExtraFiles(const char* files);
bool SubmitExtraFiles(const std::vector<cmStdString> &files); bool SubmitExtraFiles(const VectorOfStrings &files);
//! Set the output log file name //! Set the output log file name
void SetOutputLogFileName(const char* name); void SetOutputLogFileName(const char* name);
@ -391,7 +391,7 @@ public:
//! Read the custom configuration files and apply them to the current ctest //! Read the custom configuration files and apply them to the current ctest
int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf); int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf);
std::vector<cmStdString> &GetInitialCommandLineArguments() std::vector<std::string> &GetInitialCommandLineArguments()
{ return this->InitialCommandLineArguments; }; { return this->InitialCommandLineArguments; };
//! Set the track to submit to //! Set the track to submit to
@ -447,13 +447,13 @@ private:
void DetermineNextDayStop(); void DetermineNextDayStop();
// these are helper classes // these are helper classes
typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers; typedef std::map<std::string,cmCTestGenericHandler*> t_TestingHandlers;
t_TestingHandlers TestingHandlers; t_TestingHandlers TestingHandlers;
bool ShowOnly; bool ShowOnly;
//! Map of configuration properties //! Map of configuration properties
typedef std::map<cmStdString, cmStdString> CTestConfigurationMap; typedef std::map<std::string, std::string> CTestConfigurationMap;
std::string CTestConfigFile; std::string CTestConfigFile;
// TODO: The ctest configuration should be a hierarchy of // TODO: The ctest configuration should be a hierarchy of
@ -463,7 +463,7 @@ private:
CTestConfigurationMap CTestConfiguration; CTestConfigurationMap CTestConfiguration;
CTestConfigurationMap CTestConfigurationOverwrites; CTestConfigurationMap CTestConfigurationOverwrites;
PartInfo Parts[PartCount]; PartInfo Parts[PartCount];
typedef std::map<cmStdString, Part> PartMapType; typedef std::map<std::string, Part> PartMapType;
PartMapType PartMap; PartMapType PartMap;
std::string CurrentTag; std::string CurrentTag;
@ -556,7 +556,7 @@ private:
int DartVersion; int DartVersion;
bool DropSiteCDash; bool DropSiteCDash;
std::vector<cmStdString> InitialCommandLineArguments; std::vector<std::string> InitialCommandLineArguments;
int SubmitIndex; int SubmitIndex;

View File

@ -82,19 +82,19 @@ bool cmCacheManager::LoadCache(cmMakefile* mf)
} }
bool cmCacheManager::LoadCache(const char* path) bool cmCacheManager::LoadCache(const std::string& path)
{ {
return this->LoadCache(path,true); return this->LoadCache(path,true);
} }
bool cmCacheManager::LoadCache(const char* path, bool cmCacheManager::LoadCache(const std::string& path,
bool internal) bool internal)
{ {
std::set<cmStdString> emptySet; std::set<std::string> emptySet;
return this->LoadCache(path, internal, emptySet, emptySet); return this->LoadCache(path, internal, emptySet, emptySet);
} }
static bool ParseEntryWithoutType(const char* entry, static bool ParseEntryWithoutType(const std::string& entry,
std::string& var, std::string& var,
std::string& value) std::string& value)
{ {
@ -132,7 +132,7 @@ static bool ParseEntryWithoutType(const char* entry,
return flag; return flag;
} }
bool cmCacheManager::ParseEntry(const char* entry, bool cmCacheManager::ParseEntry(const std::string& entry,
std::string& var, std::string& var,
std::string& value, std::string& value,
CacheEntryType& type) CacheEntryType& type)
@ -178,7 +178,7 @@ bool cmCacheManager::ParseEntry(const char* entry,
return flag; return flag;
} }
void cmCacheManager::CleanCMakeFiles(const char* path) void cmCacheManager::CleanCMakeFiles(const std::string& path)
{ {
std::string glob = path; std::string glob = path;
glob += cmake::GetCMakeFilesDirectory(); glob += cmake::GetCMakeFilesDirectory();
@ -193,10 +193,10 @@ void cmCacheManager::CleanCMakeFiles(const char* path)
} }
} }
bool cmCacheManager::LoadCache(const char* path, bool cmCacheManager::LoadCache(const std::string& path,
bool internal, bool internal,
std::set<cmStdString>& excludes, std::set<std::string>& excludes,
std::set<cmStdString>& includes) std::set<std::string>& includes)
{ {
std::string cacheFile = path; std::string cacheFile = path;
cacheFile += "/CMakeCache.txt"; cacheFile += "/CMakeCache.txt";
@ -428,7 +428,7 @@ bool cmCacheManager::SaveCache(cmMakefile* mf)
} }
bool cmCacheManager::SaveCache(const char* path) bool cmCacheManager::SaveCache(const std::string& path)
{ {
std::string cacheFile = path; std::string cacheFile = path;
cacheFile += "/CMakeCache.txt"; cacheFile += "/CMakeCache.txt";
@ -500,7 +500,7 @@ bool cmCacheManager::SaveCache(const char* path)
fout << "########################\n"; fout << "########################\n";
fout << "\n"; fout << "\n";
for( std::map<cmStdString, CacheEntry>::const_iterator i = for( std::map<std::string, CacheEntry>::const_iterator i =
this->Cache.begin(); i != this->Cache.end(); ++i) this->Cache.begin(); i != this->Cache.end(); ++i)
{ {
const CacheEntry& ce = (*i).second; const CacheEntry& ce = (*i).second;
@ -578,7 +578,7 @@ bool cmCacheManager::SaveCache(const char* path)
return true; return true;
} }
bool cmCacheManager::DeleteCache(const char* path) bool cmCacheManager::DeleteCache(const std::string& path)
{ {
std::string cacheFile = path; std::string cacheFile = path;
cmSystemTools::ConvertToUnixSlashes(cacheFile); cmSystemTools::ConvertToUnixSlashes(cacheFile);
@ -650,7 +650,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
} }
} }
void cmCacheManager::RemoveCacheEntry(const char* key) void cmCacheManager::RemoveCacheEntry(const std::string& key)
{ {
CacheEntryMap::iterator i = this->Cache.find(key); CacheEntryMap::iterator i = this->Cache.find(key);
if(i != this->Cache.end()) if(i != this->Cache.end())
@ -660,7 +660,8 @@ void cmCacheManager::RemoveCacheEntry(const char* key)
} }
cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(const char* key) cmCacheManager::CacheEntry *cmCacheManager::GetCacheEntry(
const std::string& key)
{ {
CacheEntryMap::iterator i = this->Cache.find(key); CacheEntryMap::iterator i = this->Cache.find(key);
if(i != this->Cache.end()) if(i != this->Cache.end())
@ -676,7 +677,7 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
return CacheIterator(*this, key); return CacheIterator(*this, key);
} }
const char* cmCacheManager::GetCacheValue(const char* key) const const char* cmCacheManager::GetCacheValue(const std::string& key) const
{ {
CacheEntryMap::const_iterator i = this->Cache.find(key); CacheEntryMap::const_iterator i = this->Cache.find(key);
if(i != this->Cache.end() && if(i != this->Cache.end() &&
@ -692,7 +693,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
{ {
out << "=================================================" << std::endl; out << "=================================================" << std::endl;
out << "CMakeCache Contents:" << std::endl; out << "CMakeCache Contents:" << std::endl;
for(std::map<cmStdString, CacheEntry>::const_iterator i = for(std::map<std::string, CacheEntry>::const_iterator i =
this->Cache.begin(); i != this->Cache.end(); ++i) this->Cache.begin(); i != this->Cache.end(); ++i)
{ {
if((*i).second.Type != INTERNAL) if((*i).second.Type != INTERNAL)
@ -708,7 +709,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
} }
void cmCacheManager::AddCacheEntry(const char* key, void cmCacheManager::AddCacheEntry(const std::string& key,
const char* value, const char* value,
const char* helpString, const char* helpString,
CacheEntryType type) CacheEntryType type)
@ -767,7 +768,7 @@ void cmCacheManager::CacheIterator::Begin()
this->Position = this->Container.Cache.begin(); this->Position = this->Container.Cache.begin();
} }
bool cmCacheManager::CacheIterator::Find(const char* key) bool cmCacheManager::CacheIterator::Find(const std::string& key)
{ {
this->Position = this->Container.Cache.find(key); this->Position = this->Container.Cache.find(key);
return !this->IsAtEnd(); return !this->IsAtEnd();
@ -807,13 +808,13 @@ bool cmCacheManager::CacheIterator::GetValueAsBool() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* const char*
cmCacheManager::CacheEntry::GetProperty(const char* prop) const cmCacheManager::CacheEntry::GetProperty(const std::string& prop) const
{ {
if(strcmp(prop, "TYPE") == 0) if(prop == "TYPE")
{ {
return cmCacheManagerTypes[this->Type]; return cmCacheManagerTypes[this->Type];
} }
else if(strcmp(prop, "VALUE") == 0) else if(prop == "VALUE")
{ {
return this->Value.c_str(); return this->Value.c_str();
} }
@ -823,14 +824,14 @@ cmCacheManager::CacheEntry::GetProperty(const char* prop) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmCacheManager::CacheEntry::SetProperty(const char* prop, void cmCacheManager::CacheEntry::SetProperty(const std::string& prop,
const char* value) const char* value)
{ {
if(strcmp(prop, "TYPE") == 0) if(prop == "TYPE")
{ {
this->Type = cmCacheManager::StringToType(value? value : "STRING"); this->Type = cmCacheManager::StringToType(value? value : "STRING");
} }
else if(strcmp(prop, "VALUE") == 0) else if(prop == "VALUE")
{ {
this->Value = value? value : ""; this->Value = value? value : "";
} }
@ -841,15 +842,15 @@ void cmCacheManager::CacheEntry::SetProperty(const char* prop,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmCacheManager::CacheEntry::AppendProperty(const char* prop, void cmCacheManager::CacheEntry::AppendProperty(const std::string& prop,
const char* value, const char* value,
bool asString) bool asString)
{ {
if(strcmp(prop, "TYPE") == 0) if(prop == "TYPE")
{ {
this->Type = cmCacheManager::StringToType(value? value : "STRING"); this->Type = cmCacheManager::StringToType(value? value : "STRING");
} }
else if(strcmp(prop, "VALUE") == 0) else if(prop == "VALUE")
{ {
if(value) if(value)
{ {
@ -867,7 +868,8 @@ void cmCacheManager::CacheEntry::AppendProperty(const char* prop,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmCacheManager::CacheIterator::GetProperty(const char* prop) const const char* cmCacheManager::CacheIterator::GetProperty(
const std::string& prop) const
{ {
if(!this->IsAtEnd()) if(!this->IsAtEnd())
{ {
@ -877,7 +879,8 @@ const char* cmCacheManager::CacheIterator::GetProperty(const char* prop) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v) void cmCacheManager::CacheIterator::SetProperty(const std::string& p,
const char* v)
{ {
if(!this->IsAtEnd()) if(!this->IsAtEnd())
{ {
@ -886,7 +889,7 @@ void cmCacheManager::CacheIterator::SetProperty(const char* p, const char* v)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmCacheManager::CacheIterator::AppendProperty(const char* p, void cmCacheManager::CacheIterator::AppendProperty(const std::string& p,
const char* v, const char* v,
bool asString) bool asString)
{ {
@ -897,7 +900,8 @@ void cmCacheManager::CacheIterator::AppendProperty(const char* p,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCacheManager::CacheIterator::GetPropertyAsBool(const char* prop) const bool cmCacheManager::CacheIterator::GetPropertyAsBool(
const std::string& prop) const
{ {
if(const char* value = this->GetProperty(prop)) if(const char* value = this->GetProperty(prop))
{ {
@ -907,13 +911,14 @@ bool cmCacheManager::CacheIterator::GetPropertyAsBool(const char* prop) const
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmCacheManager::CacheIterator::SetProperty(const char* p, bool v) void cmCacheManager::CacheIterator::SetProperty(const std::string& p, bool v)
{ {
this->SetProperty(p, v ? "ON" : "OFF"); this->SetProperty(p, v ? "ON" : "OFF");
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmCacheManager::CacheIterator::PropertyExists(const char* prop) const bool cmCacheManager::CacheIterator::PropertyExists(
const std::string& prop) const
{ {
return this->GetProperty(prop)? true:false; return this->GetProperty(prop)? true:false;
} }

View File

@ -39,9 +39,9 @@ private:
std::string Value; std::string Value;
CacheEntryType Type; CacheEntryType Type;
cmPropertyMap Properties; cmPropertyMap Properties;
const char* GetProperty(const char*) const; const char* GetProperty(const std::string&) const;
void SetProperty(const char* property, const char* value); void SetProperty(const std::string& property, const char* value);
void AppendProperty(const char* property, const char* value, void AppendProperty(const std::string& property, const char* value,
bool asString=false); bool asString=false);
bool Initialized; bool Initialized;
CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false) CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false)
@ -53,26 +53,26 @@ public:
{ {
public: public:
void Begin(); void Begin();
bool Find(const char*); bool Find(const std::string&);
bool IsAtEnd() const; bool IsAtEnd() const;
void Next(); void Next();
const char *GetName() const { std::string GetName() const {
return this->Position->first.c_str(); } return this->Position->first; }
const char* GetProperty(const char*) const ; const char* GetProperty(const std::string&) const ;
bool GetPropertyAsBool(const char*) const ; bool GetPropertyAsBool(const std::string&) const ;
bool PropertyExists(const char*) const; bool PropertyExists(const std::string&) const;
void SetProperty(const char* property, const char* value); void SetProperty(const std::string& property, const char* value);
void AppendProperty(const char* property, const char* value, void AppendProperty(const std::string& property, const char* value,
bool asString=false); bool asString=false);
void SetProperty(const char* property, bool value); void SetProperty(const std::string& property, bool value);
const char* GetValue() const { return this->GetEntry().Value.c_str(); } std::string GetValue() const { return this->GetEntry().Value; }
bool GetValueAsBool() const; bool GetValueAsBool() const;
void SetValue(const char*); void SetValue(const char*);
CacheEntryType GetType() const { return this->GetEntry().Type; } CacheEntryType GetType() const { return this->GetEntry().Type; }
void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; } void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; }
bool Initialized() { return this->GetEntry().Initialized; } bool Initialized() { return this->GetEntry().Initialized; }
cmCacheManager &Container; cmCacheManager &Container;
std::map<cmStdString, CacheEntry>::iterator Position; std::map<std::string, CacheEntry>::iterator Position;
CacheIterator(cmCacheManager &cm) : Container(cm) { CacheIterator(cmCacheManager &cm) : Container(cm) {
this->Begin(); this->Begin();
} }
@ -108,19 +108,19 @@ public:
///! Load a cache for given makefile. Loads from ouput home. ///! Load a cache for given makefile. Loads from ouput home.
bool LoadCache(cmMakefile*); bool LoadCache(cmMakefile*);
///! Load a cache for given makefile. Loads from path/CMakeCache.txt. ///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
bool LoadCache(const char* path); bool LoadCache(const std::string& path);
bool LoadCache(const char* path, bool internal); bool LoadCache(const std::string& path, bool internal);
bool LoadCache(const char* path, bool internal, bool LoadCache(const std::string& path, bool internal,
std::set<cmStdString>& excludes, std::set<std::string>& excludes,
std::set<cmStdString>& includes); std::set<std::string>& includes);
///! Save cache for given makefile. Saves to ouput home CMakeCache.txt. ///! Save cache for given makefile. Saves to ouput home CMakeCache.txt.
bool SaveCache(cmMakefile*) ; bool SaveCache(cmMakefile*) ;
///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt ///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt
bool SaveCache(const char* path) ; bool SaveCache(const std::string& path) ;
///! Delete the cache given ///! Delete the cache given
bool DeleteCache(const char* path); bool DeleteCache(const std::string& path);
///! Print the cache to a stream ///! Print the cache to a stream
void PrintCache(std::ostream&) const; void PrintCache(std::ostream&) const;
@ -129,20 +129,20 @@ public:
cmCacheManager::CacheIterator GetCacheIterator(const char *key=0); cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
///! Remove an entry from the cache ///! Remove an entry from the cache
void RemoveCacheEntry(const char* key); void RemoveCacheEntry(const std::string& key);
///! Get the number of entries in the cache ///! Get the number of entries in the cache
int GetSize() { int GetSize() {
return static_cast<int>(this->Cache.size()); } return static_cast<int>(this->Cache.size()); }
///! Break up a line like VAR:type="value" into var, type and value ///! Break up a line like VAR:type="value" into var, type and value
static bool ParseEntry(const char* entry, static bool ParseEntry(const std::string& entry,
std::string& var, std::string& var,
std::string& value, std::string& value,
CacheEntryType& type); CacheEntryType& type);
///! Get a value from the cache given a key ///! Get a value from the cache given a key
const char* GetCacheValue(const char* key) const; const char* GetCacheValue(const std::string& key) const;
/** Get the version of CMake that wrote the cache. */ /** Get the version of CMake that wrote the cache. */
unsigned int GetCacheMajorVersion() const unsigned int GetCacheMajorVersion() const
@ -153,20 +153,20 @@ public:
protected: protected:
///! Add an entry into the cache ///! Add an entry into the cache
void AddCacheEntry(const char* key, const char* value, void AddCacheEntry(const std::string& key, const char* value,
const char* helpString, CacheEntryType type); const char* helpString, CacheEntryType type);
///! Get a cache entry object for a key ///! Get a cache entry object for a key
CacheEntry *GetCacheEntry(const char *key); CacheEntry *GetCacheEntry(const std::string& key);
///! Clean out the CMakeFiles directory if no CMakeCache.txt ///! Clean out the CMakeFiles directory if no CMakeCache.txt
void CleanCMakeFiles(const char* path); void CleanCMakeFiles(const std::string& path);
// Cache version info // Cache version info
unsigned int CacheMajorVersion; unsigned int CacheMajorVersion;
unsigned int CacheMinorVersion; unsigned int CacheMinorVersion;
private: private:
cmake* CMakeInstance; cmake* CMakeInstance;
typedef std::map<cmStdString, CacheEntry> CacheEntryMap; typedef std::map<std::string, CacheEntry> CacheEntryMap;
static void OutputHelpString(std::ostream& fout, static void OutputHelpString(std::ostream& fout,
const std::string& helpString); const std::string& helpString);
static void OutputKey(std::ostream& fout, std::string const& key); static void OutputKey(std::ostream& fout, std::string const& key);

View File

@ -124,7 +124,7 @@ public:
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */
virtual const char* GetName() const = 0; virtual std::string GetName() const = 0;
/** /**
* Enable the command. * Enable the command.
@ -166,7 +166,7 @@ public:
/** /**
* Set the error message * Set the error message
*/ */
void SetError(const char* e) void SetError(const std::string& e)
{ {
this->Error = this->GetName(); this->Error = this->GetName();
this->Error += " "; this->Error += " ";

View File

@ -49,14 +49,14 @@ void cmCommandArgumentParserHelper::SetLineFile(long line, const char* file)
this->FileName = file; this->FileName = file;
} }
char* cmCommandArgumentParserHelper::AddString(const char* str) char* cmCommandArgumentParserHelper::AddString(const std::string& str)
{ {
if ( !str || !*str ) if ( str.empty() )
{ {
return this->EmptyVariable; return this->EmptyVariable;
} }
char* stVal = new char[strlen(str)+1]; char* stVal = new char[str.size()+1];
strcpy(stVal, str); strcpy(stVal, str.c_str());
this->Variables.push_back(stVal); this->Variables.push_back(stVal);
return stVal; return stVal;
} }
@ -153,7 +153,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
{ {
return this->AddString(cmSystemTools::EscapeQuotes(value).c_str()); return this->AddString(cmSystemTools::EscapeQuotes(value).c_str());
} }
return this->AddString(value); return this->AddString(value ? value : "");
} }
char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var) char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
@ -166,7 +166,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
// then return an empty string // then return an empty string
if(!ret && this->RemoveEmpty) if(!ret && this->RemoveEmpty)
{ {
return this->AddString(ret); return this->AddString("");
} }
// if the ret was not 0, then return it // if the ret was not 0, then return it
if(ret) if(ret)

Some files were not shown because too many files have changed in this diff Show More