Merge topic 'dev/string-apis'
b633b263
CPackWiX: Fix test to build with expected config191f25e2
stringapi: Prevent a NULL dereference in WiX219d6ad6
speedup: Avoid excess iterator dereferencescaaad357
speedup: Cache strings for comparisons7abf4e31
stringapi: Use strings for dependency information94fc63e2
stringapi: Use strings for cache iterator values85fc9f26
stringapi: Command names6557382d
stringapi: Use strings for program paths1a1b737c
stringapi: Use strings for generator names24b5e93d
stringapi: Use strings for directories11ed3e2c
stringapi: Add string overload for the Def structb3bf31a5
stringapi: Miscellaneous char* parameters5af95c39
typo: Match argument name with the header2b17626e
stringapi: Pass strings as install directories in CPack3def29da
stringapi: Use strings for feature argumentsacb116e3
stringapi: Return a string reference for the configuration ...
This commit is contained in:
commit
ad9f0d831e
|
@ -987,7 +987,7 @@ function(CUDA_COMPUTE_BUILD_PATH path build_path)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# This recipie is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# This recipe is from cmLocalGenerator::CreateSafeUniqueObjectFileName in the
|
||||
# CMake source.
|
||||
|
||||
# Remove leading /
|
||||
|
|
|
@ -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(name_str == "CPackWiXPatch")
|
||||
if(name == "CPackWiXPatch")
|
||||
{
|
||||
State = BEGIN_FRAGMENTS;
|
||||
}
|
||||
|
@ -50,7 +49,7 @@ void cmWIXPatchParser::StartElement(const char *name, const char **atts)
|
|||
}
|
||||
else if(State == BEGIN_FRAGMENTS)
|
||||
{
|
||||
if(name_str == "CPackWiXFragment")
|
||||
if(name == "CPackWiXFragment")
|
||||
{
|
||||
State = INSIDE_FRAGMENT;
|
||||
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(name_str == "CPackWiXFragment")
|
||||
if(name == "CPackWiXFragment")
|
||||
{
|
||||
State = BEGIN_FRAGMENTS;
|
||||
ElementStack.clear();
|
||||
|
|
|
@ -43,11 +43,11 @@ public:
|
|||
cmWIXPatchParser(fragment_map_t& Fragments, cmCPackLog* logger);
|
||||
|
||||
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);
|
||||
|
||||
virtual void EndElement(const char *name);
|
||||
virtual void EndElement(const std::string& name);
|
||||
virtual void ReportError(int line, int column, const char* msg);
|
||||
|
||||
void ReportValidationError(std::string const& message);
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
#include <string>
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
|
||||
unsigned long cmCPackComponent::GetInstalledSize(
|
||||
const std::string& installDir) const
|
||||
{
|
||||
if (this->TotalSize != 0)
|
||||
{
|
||||
|
@ -37,7 +38,7 @@ unsigned long cmCPackComponent::GetInstalledSize(const char* installDir) const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
unsigned long
|
||||
cmCPackComponent::GetInstalledSizeInKbytes(const char* installDir) const
|
||||
cmCPackComponent::GetInstalledSizeInKbytes(const std::string& installDir) const
|
||||
{
|
||||
unsigned long result = (GetInstalledSize(installDir) + 512) / 1024;
|
||||
return result? result : 1;
|
||||
|
|
|
@ -94,11 +94,11 @@ public:
|
|||
/// Get the total installed size of all of the files in this
|
||||
/// component, in bytes. installDir is the directory into which the
|
||||
/// 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
|
||||
/// kilobytes.
|
||||
unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
|
||||
unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
|
||||
|
||||
private:
|
||||
mutable unsigned long TotalSize;
|
||||
|
|
|
@ -254,7 +254,7 @@ int cmCPackGenerator::InstallProject()
|
|||
// If the project is a CMAKE project then run pre-install
|
||||
// and then read the cmake_install script to run it
|
||||
if ( !this->InstallProjectViaInstallCMakeProjects(
|
||||
setDestDir, bareTempInstallDirectory.c_str()) )
|
||||
setDestDir, bareTempInstallDirectory) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ int cmCPackGenerator::InstallProject()
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackGenerator::InstallProjectViaInstallCommands(
|
||||
bool setDestDir, const char* tempInstallDirectory)
|
||||
bool setDestDir, const std::string& tempInstallDirectory)
|
||||
{
|
||||
(void) setDestDir;
|
||||
const char* installCommands = this->GetOption("CPACK_INSTALL_COMMANDS");
|
||||
|
@ -312,7 +312,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
||||
bool setDestDir, const char* tempInstallDirectory)
|
||||
bool setDestDir, const std::string& tempInstallDirectory)
|
||||
{
|
||||
(void)setDestDir;
|
||||
(void)tempInstallDirectory;
|
||||
|
@ -349,7 +349,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
|||
return 0;
|
||||
}
|
||||
std::vector<std::string>::iterator it;
|
||||
const char* tempDir = tempInstallDirectory;
|
||||
const std::string& tempDir = tempInstallDirectory;
|
||||
for ( it = installDirectoriesVector.begin();
|
||||
it != installDirectoriesVector.end();
|
||||
++it )
|
||||
|
@ -457,7 +457,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackGenerator::InstallProjectViaInstallScript(
|
||||
bool setDestDir, const char* tempInstallDirectory)
|
||||
bool setDestDir, const std::string& tempInstallDirectory)
|
||||
{
|
||||
const char* cmakeScripts
|
||||
= this->GetOption("CPACK_INSTALL_SCRIPT");
|
||||
|
@ -499,7 +499,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
|
|||
}
|
||||
else
|
||||
{
|
||||
this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory);
|
||||
this->SetOption("CMAKE_INSTALL_PREFIX", tempInstallDirectory.c_str());
|
||||
|
||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,
|
||||
"- Using non-DESTDIR install... (this->SetOption)" << std::endl);
|
||||
|
@ -509,9 +509,9 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
|
|||
}
|
||||
|
||||
this->SetOptionIfNotSet("CMAKE_CURRENT_BINARY_DIR",
|
||||
tempInstallDirectory);
|
||||
tempInstallDirectory.c_str());
|
||||
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
|
||||
tempInstallDirectory);
|
||||
tempInstallDirectory.c_str());
|
||||
int res = this->MakefileMap->ReadListFile(0, installScript.c_str());
|
||||
if ( cmSystemTools::GetErrorOccuredFlag() || !res )
|
||||
{
|
||||
|
@ -524,7 +524,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||
bool setDestDir, const char* baseTempInstallDirectory)
|
||||
bool setDestDir, const std::string& baseTempInstallDirectory)
|
||||
{
|
||||
const char* cmakeProjects
|
||||
= this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS");
|
||||
|
@ -623,7 +623,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|||
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
|
||||
= this->MakefileMap->GetCMakeInstance()->CreateGlobalGenerator(
|
||||
cmakeGenerator);
|
||||
|
@ -822,9 +823,9 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
|||
<< "'" << std::endl);
|
||||
}
|
||||
|
||||
if ( buildConfig && *buildConfig )
|
||||
if (!buildConfig.empty())
|
||||
{
|
||||
mf->AddDefinition("BUILD_TYPE", buildConfig);
|
||||
mf->AddDefinition("BUILD_TYPE", buildConfig.c_str());
|
||||
}
|
||||
std::string installComponentLowerCase
|
||||
= 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* 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 )
|
||||
{
|
||||
this->MakefileMap->RemoveDefinition(op);
|
||||
|
@ -1092,7 +1089,7 @@ int cmCPackGenerator::DoPackage()
|
|||
* may update this during PackageFiles.
|
||||
* (either putting several names or updating the provided one)
|
||||
*/
|
||||
packageFileNames.push_back(tempPackageFileName);
|
||||
packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
|
||||
toplevel = tempDirectory;
|
||||
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->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);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCPackGenerator::IsOn(const char* name) const
|
||||
bool cmCPackGenerator::IsOn(const std::string& name) const
|
||||
{
|
||||
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);
|
||||
if(!ret)
|
||||
|
@ -1486,8 +1483,8 @@ bool cmCPackGenerator::WantsComponentInstallation() const
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
cmCPackInstallationType*
|
||||
cmCPackGenerator::GetInstallationType(const char *projectName,
|
||||
const char *name)
|
||||
cmCPackGenerator::GetInstallationType(const std::string& projectName,
|
||||
const std::string& name)
|
||||
{
|
||||
(void) projectName;
|
||||
bool hasInstallationType = this->InstallationTypes.count(name) != 0;
|
||||
|
@ -1518,7 +1515,8 @@ cmCPackGenerator::GetInstallationType(const char *projectName,
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
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;
|
||||
cmCPackComponent *component = &this->Components[name];
|
||||
|
@ -1586,7 +1584,7 @@ cmCPackGenerator::GetComponent(const char *projectName, const char *name)
|
|||
++installTypesIt)
|
||||
{
|
||||
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*
|
||||
cmCPackGenerator::GetComponentGroup(const char *projectName, const char *name)
|
||||
cmCPackGenerator::GetComponentGroup(const std::string& projectName,
|
||||
const std::string& name)
|
||||
{
|
||||
(void) projectName;
|
||||
std::string macroPrefix = "CPACK_COMPONENT_GROUP_"
|
||||
|
|
|
@ -90,7 +90,7 @@ public:
|
|||
/**
|
||||
* Initialize generator
|
||||
*/
|
||||
int Initialize(const char* name, cmMakefile* mf);
|
||||
int Initialize(const std::string& name, cmMakefile* mf);
|
||||
|
||||
/**
|
||||
* Construct generator
|
||||
|
@ -99,12 +99,12 @@ public:
|
|||
virtual ~cmCPackGenerator();
|
||||
|
||||
//! Set and get the options
|
||||
void SetOption(const char* op, const char* value);
|
||||
void SetOptionIfNotSet(const char* op, const char* value);
|
||||
const char* GetOption(const char* op) const;
|
||||
void SetOption(const std::string& op, const char* value);
|
||||
void SetOptionIfNotSet(const std::string& op, const char* value);
|
||||
const char* GetOption(const std::string& op) const;
|
||||
std::vector<std::string> GetOptions() const;
|
||||
bool IsSet(const char* name) const;
|
||||
bool IsOn(const char* name) const;
|
||||
bool IsSet(const std::string& name) const;
|
||||
bool IsOn(const std::string& name) const;
|
||||
|
||||
//! Set the logger
|
||||
void SetLogger(cmCPackLog* log) { this->Logger = log; }
|
||||
|
@ -190,13 +190,13 @@ protected:
|
|||
|
||||
//! Run install commands if specified
|
||||
virtual int InstallProjectViaInstallCommands(
|
||||
bool setDestDir, const char* tempInstallDirectory);
|
||||
bool setDestDir, const std::string& tempInstallDirectory);
|
||||
virtual int InstallProjectViaInstallScript(
|
||||
bool setDestDir, const char* tempInstallDirectory);
|
||||
bool setDestDir, const std::string& tempInstallDirectory);
|
||||
virtual int InstallProjectViaInstalledDirectories(
|
||||
bool setDestDir, const char* tempInstallDirectory);
|
||||
bool setDestDir, const std::string& tempInstallDirectory);
|
||||
virtual int InstallProjectViaInstallCMakeProjects(
|
||||
bool setDestDir, const char* tempInstallDirectory);
|
||||
bool setDestDir, const std::string& tempInstallDirectory);
|
||||
|
||||
/**
|
||||
* The various level of support of
|
||||
|
@ -245,12 +245,14 @@ protected:
|
|||
* @return true if component installation is supported and wanted.
|
||||
*/
|
||||
virtual bool WantsComponentInstallation() const;
|
||||
virtual cmCPackInstallationType* GetInstallationType(const char *projectName,
|
||||
const char* name);
|
||||
virtual cmCPackComponent* GetComponent(const char *projectName,
|
||||
const char* name);
|
||||
virtual cmCPackComponentGroup* GetComponentGroup(const char *projectName,
|
||||
const char* name);
|
||||
virtual cmCPackInstallationType* GetInstallationType(
|
||||
const std::string& projectName,
|
||||
const std::string& name);
|
||||
virtual cmCPackComponent* GetComponent(const std::string& projectName,
|
||||
const std::string& name);
|
||||
virtual cmCPackComponentGroup* GetComponentGroup(
|
||||
const std::string& projectName,
|
||||
const std::string& name);
|
||||
|
||||
cmSystemTools::OutputOption GeneratorVerbose;
|
||||
std::string Name;
|
||||
|
|
|
@ -151,7 +151,8 @@ cmCPackGeneratorFactory::~cmCPackGeneratorFactory()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(const char* name)
|
||||
cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(
|
||||
const std::string& name)
|
||||
{
|
||||
cmCPackGenerator* gen = this->NewGeneratorInternal(name);
|
||||
if ( !gen )
|
||||
|
@ -165,12 +166,8 @@ cmCPackGenerator* cmCPackGeneratorFactory::NewGenerator(const char* name)
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
cmCPackGenerator* cmCPackGeneratorFactory::NewGeneratorInternal(
|
||||
const char* name)
|
||||
const std::string& name)
|
||||
{
|
||||
if ( !name )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
cmCPackGeneratorFactory::t_GeneratorCreatorsMap::iterator it
|
||||
= this->GeneratorCreators.find(name);
|
||||
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,
|
||||
CreateGeneratorCall* createGenerator)
|
||||
{
|
||||
if ( !name || !createGenerator )
|
||||
if ( !createGenerator )
|
||||
{
|
||||
cmCPack_Log(this->Logger, cmCPackLog::LOG_ERROR,
|
||||
"Cannot register generator" << std::endl);
|
||||
|
|
|
@ -31,26 +31,26 @@ public:
|
|||
~cmCPackGeneratorFactory();
|
||||
|
||||
//! Get the generator
|
||||
cmCPackGenerator* NewGenerator(const char* name);
|
||||
cmCPackGenerator* NewGenerator(const std::string& name);
|
||||
void DeleteGenerator(cmCPackGenerator* gen);
|
||||
|
||||
typedef cmCPackGenerator* CreateGeneratorCall();
|
||||
|
||||
void RegisterGenerator(const char* name,
|
||||
void RegisterGenerator(const std::string& name,
|
||||
const char* generatorDescription,
|
||||
CreateGeneratorCall* createGenerator);
|
||||
|
||||
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
|
||||
{ return this->GeneratorDescriptions; }
|
||||
|
||||
private:
|
||||
cmCPackGenerator* NewGeneratorInternal(const char* name);
|
||||
cmCPackGenerator* NewGeneratorInternal(const std::string& name);
|
||||
std::vector<cmCPackGenerator*> Generators;
|
||||
|
||||
typedef std::map<cmStdString, CreateGeneratorCall*> t_GeneratorCreatorsMap;
|
||||
typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
|
||||
t_GeneratorCreatorsMap GeneratorCreators;
|
||||
DescriptionsMap GeneratorDescriptions;
|
||||
cmCPackLog* Logger;
|
||||
|
|
|
@ -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 cpackVar = "CPACK_RESOURCE_FILE_" + uname;
|
||||
|
@ -271,8 +271,8 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const char* name)
|
|||
*/
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
|
||||
const char* dir, const char* outputFileName /* = 0 */,
|
||||
bool cmCPackOSXX11Generator::CopyResourcePlistFile(const std::string& name,
|
||||
const std::string& dir, const char* outputFileName /* = 0 */,
|
||||
bool copyOnly /* = false */)
|
||||
{
|
||||
std::string inFName = "CPack.";
|
||||
|
@ -288,7 +288,7 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(const char* name,
|
|||
|
||||
if ( !outputFileName )
|
||||
{
|
||||
outputFileName = name;
|
||||
outputFileName = name.c_str();
|
||||
}
|
||||
|
||||
std::string destFileName = dir;
|
||||
|
|
|
@ -37,8 +37,9 @@ protected:
|
|||
virtual const char* GetPackagingInstallPrefix();
|
||||
virtual const char* GetOutputExtension() { return ".dmg"; }
|
||||
|
||||
//bool CopyCreateResourceFile(const char* name, const char* dir);
|
||||
bool CopyResourcePlistFile(const char* name, const char* dir,
|
||||
//bool CopyCreateResourceFile(const std::string& name,
|
||||
// const std::string& dir);
|
||||
bool CopyResourcePlistFile(const std::string& name, const std::string& dir,
|
||||
const char* outputFileName = 0, bool copyOnly = false);
|
||||
std::string InstallPrefix;
|
||||
};
|
||||
|
|
|
@ -43,14 +43,14 @@ bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
int cmCPackPackageMakerGenerator::CopyInstallScript(const char* resdir,
|
||||
const char* script,
|
||||
const char* name)
|
||||
int cmCPackPackageMakerGenerator::CopyInstallScript(const std::string& resdir,
|
||||
const std::string& script,
|
||||
const std::string& name)
|
||||
{
|
||||
std::string dst = resdir;
|
||||
dst += "/";
|
||||
dst += name;
|
||||
cmSystemTools::CopyFileAlways(script, dst.c_str());
|
||||
cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
|
||||
cmSystemTools::SetPermissions(dst.c_str(),0777);
|
||||
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
|
||||
"copy script : " << script << "\ninto " << dst.c_str() <<
|
||||
|
@ -553,8 +553,9 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
|
||||
const char* dirName)
|
||||
bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(
|
||||
const std::string& name,
|
||||
const std::string& dirName)
|
||||
{
|
||||
std::string uname = cmSystemTools::UpperCase(name);
|
||||
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()
|
||||
<< " not specified. It should point to "
|
||||
<< (name ? name : "(NULL)")
|
||||
<< (!name.empty() ? name : "<empty>")
|
||||
<< ".rtf, " << name
|
||||
<< ".html, or " << name << ".txt file" << std::endl);
|
||||
return false;
|
||||
|
@ -571,7 +572,7 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
|
|||
if ( !cmSystemTools::FileExists(inFileName) )
|
||||
{
|
||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find "
|
||||
<< (name ? name : "(NULL)")
|
||||
<< (!name.empty() ? name : "<empty>")
|
||||
<< " resource file: " << inFileName << std::endl);
|
||||
return false;
|
||||
}
|
||||
|
@ -600,12 +601,13 @@ bool cmCPackPackageMakerGenerator::CopyCreateResourceFile(const char* name,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(const char* name,
|
||||
const char* outName)
|
||||
bool cmCPackPackageMakerGenerator::CopyResourcePlistFile(
|
||||
const std::string& name,
|
||||
const char* outName)
|
||||
{
|
||||
if (!outName)
|
||||
{
|
||||
outName = name;
|
||||
outName = name.c_str();
|
||||
}
|
||||
|
||||
std::string inFName = "CPack.";
|
||||
|
|
|
@ -38,9 +38,9 @@ public:
|
|||
virtual bool SupportsComponentInstallation() const;
|
||||
|
||||
protected:
|
||||
int CopyInstallScript(const char* resdir,
|
||||
const char* script,
|
||||
const char* name);
|
||||
int CopyInstallScript(const std::string& resdir,
|
||||
const std::string& script,
|
||||
const std::string& name);
|
||||
virtual int InitializeInternal();
|
||||
int PackageFiles();
|
||||
virtual const char* GetOutputExtension() { return ".dmg"; }
|
||||
|
@ -51,8 +51,9 @@ protected:
|
|||
// CPACK_RESOURCE_FILE_${NAME} (where ${NAME} is the uppercased
|
||||
// version of name) specifies the input file to use for this file,
|
||||
// which will be configured via ConfigureFile.
|
||||
bool CopyCreateResourceFile(const char* name, const char *dirName);
|
||||
bool CopyResourcePlistFile(const char* name, const char* outName = 0);
|
||||
bool CopyCreateResourceFile(const std::string& name,
|
||||
const std::string& dirName);
|
||||
bool CopyResourcePlistFile(const std::string& name, const char* outName = 0);
|
||||
|
||||
// Run PackageMaker with the given command line, which will (if
|
||||
// successful) produce the given package file. Returns true if
|
||||
|
|
|
@ -68,7 +68,7 @@ int cpackUnknownArgument(const char*, void*)
|
|||
//----------------------------------------------------------------------------
|
||||
struct cpackDefinitions
|
||||
{
|
||||
typedef std::map<cmStdString, cmStdString> MapType;
|
||||
typedef std::map<std::string, std::string> MapType;
|
||||
MapType Map;
|
||||
cmCPackLog *Log;
|
||||
};
|
||||
|
|
|
@ -225,35 +225,35 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char**)
|
||||
virtual void StartElement(const std::string& name, const char**)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "log") == 0)
|
||||
if(name == "log")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
this->Changes.clear();
|
||||
}
|
||||
// affected-files can contain blocks of
|
||||
// modified, unknown, renamed, kind-changed, removed, conflicts, added
|
||||
else if(strcmp(name, "modified") == 0
|
||||
|| strcmp(name, "renamed") == 0
|
||||
|| strcmp(name, "kind-changed") == 0)
|
||||
else if(name == "modified"
|
||||
|| name == "renamed"
|
||||
|| name == "kind-changed")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange.Action = 'M';
|
||||
}
|
||||
else if(strcmp(name, "added") == 0)
|
||||
else if(name == "added")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange = 'A';
|
||||
}
|
||||
else if(strcmp(name, "removed") == 0)
|
||||
else if(name == "removed")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange = 'D';
|
||||
}
|
||||
else if(strcmp(name, "unknown") == 0
|
||||
|| strcmp(name, "conflicts") == 0)
|
||||
else if(name == "unknown"
|
||||
|| name == "conflicts")
|
||||
{
|
||||
// Should not happen here
|
||||
this->CurChange = Change();
|
||||
|
@ -265,27 +265,27 @@ private:
|
|||
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);
|
||||
}
|
||||
else if((strcmp(name, "file") == 0 || strcmp(name, "directory") == 0)
|
||||
&& !this->CData.empty())
|
||||
else if(!this->CData.empty() &&
|
||||
(name == "file" || name == "directory"))
|
||||
{
|
||||
this->CurChange.Path.assign(&this->CData[0], this->CData.size());
|
||||
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
|
||||
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
|
||||
this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1);
|
||||
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
|
||||
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());
|
||||
if(this->EmailRegex.find(this->Rev.Author))
|
||||
|
@ -294,15 +294,15 @@ private:
|
|||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ bool cmCTestBZR::UpdateImpl()
|
|||
{
|
||||
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)
|
||||
|
||||
|
@ -418,7 +418,7 @@ bool cmCTestBZR::UpdateImpl()
|
|||
bzr_update.push_back(this->CommandLineTool.c_str());
|
||||
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)
|
||||
{
|
||||
bzr_update.push_back(ai->c_str());
|
||||
|
|
|
@ -54,7 +54,7 @@ protected:
|
|||
std::string &cmakeOutString,
|
||||
std::string &cwd, cmake *cm);
|
||||
|
||||
cmStdString Output;
|
||||
std::string Output;
|
||||
|
||||
std::string BuildGenerator;
|
||||
std::string BuildGeneratorToolset;
|
||||
|
|
|
@ -101,8 +101,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
|||
}
|
||||
if ( this->GlobalGenerator )
|
||||
{
|
||||
if ( strcmp(this->GlobalGenerator->GetName(),
|
||||
cmakeGeneratorName) != 0 )
|
||||
if ( this->GlobalGenerator->GetName() != cmakeGeneratorName )
|
||||
{
|
||||
delete this->GlobalGenerator;
|
||||
this->GlobalGenerator = 0;
|
||||
|
@ -130,8 +129,9 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
|||
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
|
||||
std::string buildCommand
|
||||
= this->GlobalGenerator->
|
||||
GenerateCMakeBuildCommand(cmakeBuildTarget, cmakeBuildConfiguration,
|
||||
cmakeBuildAdditionalFlags, true);
|
||||
GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
|
||||
cmakeBuildConfiguration,
|
||||
cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
"SetMakeCommand:"
|
||||
<< buildCommand.c_str() << "\n");
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
/**
|
||||
* 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,
|
||||
cmExecutionStatus &status);
|
||||
|
|
|
@ -380,7 +380,7 @@ int cmCTestBuildHandler::ProcessHandler()
|
|||
|
||||
// Create lists of regular expression strings for errors, error exceptions,
|
||||
// warnings and warning exceptions.
|
||||
std::vector<cmStdString>::size_type cc;
|
||||
std::vector<std::string>::size_type cc;
|
||||
for ( cc = 0; cmCTestErrorMatches[cc]; cc ++ )
|
||||
{
|
||||
this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
|
||||
|
@ -400,7 +400,7 @@ int cmCTestBuildHandler::ProcessHandler()
|
|||
}
|
||||
|
||||
// Pre-compile regular expressions objects for all regular expressions
|
||||
std::vector<cmStdString>::iterator it;
|
||||
std::vector<std::string>::iterator it;
|
||||
|
||||
#define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \
|
||||
regexes.clear(); \
|
||||
|
@ -602,7 +602,7 @@ void cmCTestBuildHandler::GenerateXMLLaunched(std::ostream& os)
|
|||
// Sort XML fragments in chronological order.
|
||||
cmFileTimeComparison ftc;
|
||||
FragmentCompare fragmentCompare(&ftc);
|
||||
typedef std::set<cmStdString, FragmentCompare> Fragments;
|
||||
typedef std::set<std::string, FragmentCompare> Fragments;
|
||||
Fragments fragments(fragmentCompare);
|
||||
|
||||
// Identify fragments on disk.
|
||||
|
@ -889,7 +889,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
|
|||
int* retVal, const char* dir, int timeout, std::ostream& ofs)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
|
@ -897,7 +897,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
argv.push_back(a->c_str());
|
||||
|
@ -1133,7 +1133,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
|
|||
errorwarning.PostContext = "";
|
||||
|
||||
// Copy pre-context to report
|
||||
std::deque<cmStdString>::iterator pcit;
|
||||
std::deque<std::string>::iterator pcit;
|
||||
for ( pcit = this->PreContext.begin();
|
||||
pcit != this->PreContext.end();
|
||||
++pcit )
|
||||
|
|
|
@ -97,10 +97,10 @@ private:
|
|||
double StartBuildTime;
|
||||
double EndBuildTime;
|
||||
|
||||
std::vector<cmStdString> CustomErrorMatches;
|
||||
std::vector<cmStdString> CustomErrorExceptions;
|
||||
std::vector<cmStdString> CustomWarningMatches;
|
||||
std::vector<cmStdString> CustomWarningExceptions;
|
||||
std::vector<std::string> CustomErrorMatches;
|
||||
std::vector<std::string> CustomErrorExceptions;
|
||||
std::vector<std::string> CustomWarningMatches;
|
||||
std::vector<std::string> CustomWarningExceptions;
|
||||
std::vector<std::string> ReallyCustomWarningMatches;
|
||||
std::vector<std::string> ReallyCustomWarningExceptions;
|
||||
std::vector<cmCTestCompileErrorWarningRex> ErrorWarningFileLineRegex;
|
||||
|
@ -121,8 +121,8 @@ private:
|
|||
size_t BuildOutputLogSize;
|
||||
std::vector<char> CurrentProcessingLine;
|
||||
|
||||
cmStdString SimplifySourceDir;
|
||||
cmStdString SimplifyBuildDir;
|
||||
std::string SimplifySourceDir;
|
||||
std::string SimplifyBuildDir;
|
||||
size_t OutputLineCounter;
|
||||
typedef std::vector<cmCTestBuildErrorWarning> t_ErrorsAndWarningsVector;
|
||||
t_ErrorsAndWarningsVector ErrorsAndWarnings;
|
||||
|
@ -130,7 +130,7 @@ private:
|
|||
size_t PostContextCount;
|
||||
size_t MaxPreContext;
|
||||
size_t MaxPostContext;
|
||||
std::deque<cmStdString> PreContext;
|
||||
std::deque<std::string> PreContext;
|
||||
|
||||
int TotalErrors;
|
||||
int TotalWarnings;
|
||||
|
|
|
@ -99,7 +99,7 @@ bool cmCTestCVS::UpdateImpl()
|
|||
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.
|
||||
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("-z3");
|
||||
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)
|
||||
{
|
||||
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"
|
||||
" " << 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)
|
||||
{
|
||||
this->WriteXMLDirectory(xml, di->first, di->second);
|
||||
|
|
|
@ -32,8 +32,8 @@ private:
|
|||
virtual bool WriteXMLUpdates(std::ostream& xml);
|
||||
|
||||
// Update status for files in each directory.
|
||||
class Directory: public std::map<cmStdString, PathStatus> {};
|
||||
std::map<cmStdString, Directory> Dirs;
|
||||
class Directory: public std::map<std::string, PathStatus> {};
|
||||
std::map<std::string, Directory> Dirs;
|
||||
|
||||
std::string ComputeBranchFlag(std::string const& dir);
|
||||
void LoadRevisions(std::string const& file, const char* branchFlag,
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -56,7 +56,7 @@ protected:
|
|||
};
|
||||
|
||||
bool LabelsMentioned;
|
||||
std::set<cmStdString> Labels;
|
||||
std::set<std::string> Labels;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -363,7 +363,7 @@ int cmCTestCoverageHandler::ProcessHandler()
|
|||
|
||||
// setup the regex exclude stuff
|
||||
this->CustomCoverageExcludeRegex.clear();
|
||||
std::vector<cmStdString>::iterator rexIt;
|
||||
std::vector<std::string>::iterator rexIt;
|
||||
for ( rexIt = this->CustomCoverageExclude.begin();
|
||||
rexIt != this->CustomCoverageExclude.end();
|
||||
++ rexIt )
|
||||
|
@ -713,7 +713,7 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
|
|||
this->CustomCoverageExclude);
|
||||
this->CTest->PopulateCustomVector(mf, "CTEST_EXTRA_COVERAGE_GLOB",
|
||||
this->ExtraCoverageGlobs);
|
||||
std::vector<cmStdString>::iterator it;
|
||||
std::vector<std::string>::iterator it;
|
||||
for ( it = this->CustomCoverageExclude.begin();
|
||||
it != this->CustomCoverageExclude.end();
|
||||
++ it )
|
||||
|
@ -989,8 +989,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
|
|||
<< "--------------------------------------------------------------"
|
||||
<< std::endl);
|
||||
|
||||
std::vector<cmStdString> lines;
|
||||
std::vector<cmStdString>::iterator line;
|
||||
std::vector<std::string> lines;
|
||||
std::vector<std::string>::iterator line;
|
||||
|
||||
cmSystemTools::Split(output.c_str(), lines);
|
||||
|
||||
|
@ -1504,7 +1504,7 @@ namespace
|
|||
//----------------------------------------------------------------------
|
||||
int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
|
||||
cmCTestCoverageHandlerContainer* cont,
|
||||
std::set<cmStdString>& coveredFileNames,
|
||||
std::set<std::string>& coveredFileNames,
|
||||
std::vector<std::string>& files,
|
||||
std::vector<std::string>& filesFullPath)
|
||||
{
|
||||
|
@ -1545,7 +1545,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
|
|||
outputFile.c_str() << std::endl);
|
||||
return 0;
|
||||
}
|
||||
std::map<cmStdString, cmStdString> fileMap;
|
||||
std::map<std::string, std::string> fileMap;
|
||||
std::vector<std::string>::iterator fp = filesFullPath.begin();
|
||||
for(std::vector<std::string>::iterator f = files.begin();
|
||||
f != files.end(); ++f, ++fp)
|
||||
|
@ -1558,7 +1558,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
|
|||
std::string lineIn;
|
||||
bool valid = false; // are we in a valid output file
|
||||
int line = 0; // line of the current file
|
||||
cmStdString file;
|
||||
std::string file;
|
||||
while(cmSystemTools::GetLineFromStream(fin, lineIn))
|
||||
{
|
||||
bool startFile = false;
|
||||
|
@ -1593,7 +1593,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
|
|||
}
|
||||
count++; // move on one
|
||||
}
|
||||
std::map<cmStdString, cmStdString>::iterator
|
||||
std::map<std::string, std::string>::iterator
|
||||
i = fileMap.find(file);
|
||||
// if the file should be covered write out the header for that file
|
||||
if(i != fileMap.end())
|
||||
|
@ -1758,7 +1758,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
|
|||
outputFile.c_str() << std::endl);
|
||||
return 0;
|
||||
}
|
||||
std::set<cmStdString> coveredFileNames;
|
||||
std::set<std::string> coveredFileNames;
|
||||
while(cmSystemTools::GetLineFromStream(fin, stdline))
|
||||
{
|
||||
// if we have a line of output from stdout
|
||||
|
@ -2105,10 +2105,10 @@ void cmCTestCoverageHandler::WriteXMLLabels(std::ostream& os,
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
void
|
||||
cmCTestCoverageHandler::SetLabelFilter(std::set<cmStdString> const& labels)
|
||||
cmCTestCoverageHandler::SetLabelFilter(std::set<std::string> const& labels)
|
||||
{
|
||||
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)
|
||||
{
|
||||
this->LabelFilter.insert(this->GetLabelId(*li));
|
||||
|
@ -2158,7 +2158,7 @@ std::set<std::string> cmCTestCoverageHandler::FindUncoveredFiles(
|
|||
{
|
||||
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)
|
||||
{
|
||||
cmsys::Glob gl;
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
void PopulateCustomVectors(cmMakefile *mf);
|
||||
|
||||
/** Report coverage only for sources with these labels. */
|
||||
void SetLabelFilter(std::set<cmStdString> const& labels);
|
||||
void SetLabelFilter(std::set<std::string> const& labels);
|
||||
|
||||
private:
|
||||
bool ShouldIDoCoverage(const char* file, const char* srcDir,
|
||||
|
@ -81,7 +81,7 @@ private:
|
|||
int HandleBullseyeCoverage(cmCTestCoverageHandlerContainer* cont);
|
||||
int RunBullseyeSourceSummary(cmCTestCoverageHandlerContainer* cont);
|
||||
int RunBullseyeCoverageBranch(cmCTestCoverageHandlerContainer* cont,
|
||||
std::set<cmStdString>& coveredFileNames,
|
||||
std::set<std::string>& coveredFileNames,
|
||||
std::vector<std::string>& files,
|
||||
std::vector<std::string>& filesFullPath);
|
||||
|
||||
|
@ -112,19 +112,19 @@ private:
|
|||
|
||||
std::set<std::string> FindUncoveredFiles(
|
||||
cmCTestCoverageHandlerContainer* cont);
|
||||
std::vector<cmStdString> CustomCoverageExclude;
|
||||
std::vector<std::string> CustomCoverageExclude;
|
||||
std::vector<cmsys::RegularExpression> CustomCoverageExcludeRegex;
|
||||
std::vector<cmStdString> ExtraCoverageGlobs;
|
||||
std::vector<std::string> ExtraCoverageGlobs;
|
||||
|
||||
|
||||
// Map from source file to label ids.
|
||||
class LabelSet: public std::set<int> {};
|
||||
typedef std::map<cmStdString, LabelSet> LabelMapType;
|
||||
typedef std::map<std::string, LabelSet> LabelMapType;
|
||||
LabelMapType SourceLabels;
|
||||
LabelMapType TargetDirs;
|
||||
|
||||
// Map from label name to label id.
|
||||
typedef std::map<cmStdString, int> LabelIdMapType;
|
||||
typedef std::map<std::string, int> LabelIdMapType;
|
||||
LabelIdMapType LabelIdMap;
|
||||
std::vector<std::string> Labels;
|
||||
int GetLabelId(std::string const& label);
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -179,8 +179,8 @@ bool cmCTestGIT::UpdateByFetchAndReset()
|
|||
{
|
||||
opts = this->CTest->GetCTestConfiguration("GITUpdateOptions");
|
||||
}
|
||||
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<cmStdString>::const_iterator ai = args.begin();
|
||||
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<std::string>::const_iterator ai = args.begin();
|
||||
ai != args.end(); ++ai)
|
||||
{
|
||||
git_fetch.push_back(ai->c_str());
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
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)
|
||||
{
|
||||
this->SetOption(op, value);
|
||||
if ( !op )
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ( !value )
|
||||
{
|
||||
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
|
||||
= this->Options.find(op);
|
||||
|
|
|
@ -71,12 +71,12 @@ public:
|
|||
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 SetOption(const char* op, const char* value);
|
||||
const char* GetOption(const char* op);
|
||||
void SetPersistentOption(const std::string& op, const char* value);
|
||||
void SetOption(const std::string& op, const char* value);
|
||||
const char* GetOption(const std::string& op);
|
||||
|
||||
void SetCommand(cmCTestCommand* command)
|
||||
{
|
||||
|
|
|
@ -132,7 +132,7 @@ bool cmCTestGlobalVC::WriteXMLUpdates(std::ostream& 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)
|
||||
{
|
||||
this->WriteXMLDirectory(xml, di->first, di->second);
|
||||
|
|
|
@ -39,8 +39,8 @@ protected:
|
|||
};
|
||||
|
||||
// Update status for files in each directory.
|
||||
class Directory: public std::map<cmStdString, File> {};
|
||||
std::map<cmStdString, Directory> Dirs;
|
||||
class Directory: public std::map<std::string, File> {};
|
||||
std::map<std::string, Directory> Dirs;
|
||||
|
||||
// Old and new repository revisions.
|
||||
std::string OldRevision;
|
||||
|
|
|
@ -149,8 +149,8 @@ bool cmCTestHG::UpdateImpl()
|
|||
{
|
||||
opts = this->CTest->GetCTestConfiguration("HGUpdateOptions");
|
||||
}
|
||||
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<cmStdString>::const_iterator ai = args.begin();
|
||||
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<std::string>::const_iterator ai = args.begin();
|
||||
ai != args.end(); ++ai)
|
||||
{
|
||||
hg_update.push_back(ai->c_str());
|
||||
|
@ -189,10 +189,10 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
if(const char* rev = this->FindAttribute(atts, "revision"))
|
||||
|
@ -208,29 +208,29 @@ private:
|
|||
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);
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
else if(strcmp(name, "files") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "files")
|
||||
{
|
||||
std::vector<std::string> paths = this->SplitCData();
|
||||
for(unsigned int i = 0; i < paths.size(); ++i)
|
||||
|
@ -242,7 +242,7 @@ private:
|
|||
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());
|
||||
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());
|
||||
for(unsigned int i = 0; i < this->Changes.size(); ++i)
|
||||
|
|
|
@ -567,7 +567,7 @@ void cmCTestLaunch::WriteXMLLabels(std::ostream& fxml)
|
|||
fxml << "\n";
|
||||
fxml << "\t\t<!-- Interested parties -->\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)
|
||||
{
|
||||
fxml << "\t\t\t<Label>" << cmXMLSafe(*li) << "</Label>\n";
|
||||
|
|
|
@ -73,7 +73,7 @@ private:
|
|||
bool HaveErr;
|
||||
|
||||
// Labels associated with the build rule.
|
||||
std::set<cmStdString> Labels;
|
||||
std::set<std::string> Labels;
|
||||
void LoadLabels();
|
||||
bool SourceMatches(std::string const& lhs,
|
||||
std::string const& rhs);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -49,21 +49,15 @@ class cmBoundsCheckerParser : public cmXMLParser
|
|||
{
|
||||
public:
|
||||
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);
|
||||
}
|
||||
if(strcmp(name, "ResourceLeak") == 0)
|
||||
{
|
||||
this->Errors.push_back(cmCTestMemCheckHandler::MLK);
|
||||
}
|
||||
if(strcmp(name, "Error") == 0)
|
||||
{
|
||||
this->ParseError(atts);
|
||||
}
|
||||
if(strcmp(name, "Dangling Pointer") == 0)
|
||||
else if(name == "Error" ||
|
||||
name == "Dangling Pointer")
|
||||
{
|
||||
this->ParseError(atts);
|
||||
}
|
||||
|
@ -79,7 +73,7 @@ public:
|
|||
ostr << "\n";
|
||||
this->Log += ostr.str();
|
||||
}
|
||||
void EndElement(const char* )
|
||||
void EndElement(const std::string& )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -246,8 +240,8 @@ int cmCTestMemCheckHandler::PostProcessHandler()
|
|||
void cmCTestMemCheckHandler::GenerateTestCommand(
|
||||
std::vector<std::string>& args, int test)
|
||||
{
|
||||
std::vector<cmStdString>::size_type pp;
|
||||
cmStdString index;
|
||||
std::vector<std::string>::size_type pp;
|
||||
std::string index;
|
||||
cmOStringStream stream;
|
||||
std::string memcheckcommand
|
||||
= cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
|
||||
|
@ -255,9 +249,9 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
|
|||
index = stream.str();
|
||||
for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ )
|
||||
{
|
||||
cmStdString arg = this->MemoryTesterDynamicOptions[pp];
|
||||
cmStdString::size_type pos = arg.find("??");
|
||||
if (pos != cmStdString::npos)
|
||||
std::string arg = this->MemoryTesterDynamicOptions[pp];
|
||||
std::string::size_type pos = arg.find("??");
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
arg.replace(pos, 2, index);
|
||||
}
|
||||
|
@ -580,7 +574,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
|
|||
return false;
|
||||
}
|
||||
|
||||
std::vector<cmStdString>::size_type cc;
|
||||
std::vector<std::string>::size_type cc;
|
||||
for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ )
|
||||
{
|
||||
this->MemoryTesterGlobalResults[cc] = 0;
|
||||
|
@ -627,7 +621,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
|
|||
const std::string& str, std::string& log,
|
||||
int* results)
|
||||
{
|
||||
std::vector<cmStdString> lines;
|
||||
std::vector<std::string> lines;
|
||||
cmSystemTools::Split(str.c_str(), lines);
|
||||
cmOStringStream ostr;
|
||||
log = "";
|
||||
|
@ -636,7 +630,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
|
|||
|
||||
int defects = 0;
|
||||
|
||||
for( std::vector<cmStdString>::iterator i = lines.begin();
|
||||
for( std::vector<std::string>::iterator i = lines.begin();
|
||||
i != lines.end(); ++i)
|
||||
{
|
||||
int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT;
|
||||
|
@ -681,7 +675,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
|
|||
const std::string& str, std::string& log,
|
||||
int* results)
|
||||
{
|
||||
std::vector<cmStdString> lines;
|
||||
std::vector<std::string> lines;
|
||||
cmSystemTools::Split(str.c_str(), lines);
|
||||
bool unlimitedOutput = false;
|
||||
if(str.find("CTEST_FULL_OUTPUT") != str.npos ||
|
||||
|
@ -864,10 +858,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
|
|||
{
|
||||
log = "";
|
||||
double sttime = cmSystemTools::GetTime();
|
||||
std::vector<cmStdString> lines;
|
||||
std::vector<std::string> lines;
|
||||
cmSystemTools::Split(str.c_str(), lines);
|
||||
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 ++ )
|
||||
{
|
||||
if(lines[cc] == BOUNDS_CHECKER_MARKER)
|
||||
|
@ -923,7 +917,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
|
|||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
"PostProcessBoundsCheckerTest for : "
|
||||
<< res.Name.c_str() << std::endl);
|
||||
cmStdString ofile = testOutputFileName(test);
|
||||
std::string ofile = testOutputFileName(test);
|
||||
if ( ofile.empty() )
|
||||
{
|
||||
return;
|
||||
|
@ -979,7 +973,7 @@ void
|
|||
cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
|
||||
int test)
|
||||
{
|
||||
cmStdString ofile = testOutputFileName(test);
|
||||
std::string ofile = testOutputFileName(test);
|
||||
|
||||
if ( ofile.empty() )
|
||||
{
|
||||
|
@ -1000,15 +994,15 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res,
|
|||
}
|
||||
}
|
||||
|
||||
cmStdString
|
||||
std::string
|
||||
cmCTestMemCheckHandler::testOutputFileName(int test)
|
||||
{
|
||||
cmStdString index;
|
||||
std::string index;
|
||||
cmOStringStream stream;
|
||||
stream << test;
|
||||
index = stream.str();
|
||||
cmStdString ofile = this->MemoryTesterOutputFile;
|
||||
cmStdString::size_type pos = ofile.find("??");
|
||||
std::string ofile = this->MemoryTesterOutputFile;
|
||||
std::string::size_type pos = ofile.find("??");
|
||||
ofile.replace(pos, 2, index);
|
||||
|
||||
if ( !cmSystemTools::FileExists(ofile.c_str()) )
|
||||
|
|
|
@ -89,8 +89,8 @@ private:
|
|||
std::string BoundsCheckerDPBDFile;
|
||||
std::string BoundsCheckerXMLFile;
|
||||
std::string MemoryTester;
|
||||
std::vector<cmStdString> MemoryTesterDynamicOptions;
|
||||
std::vector<cmStdString> MemoryTesterOptions;
|
||||
std::vector<std::string> MemoryTesterDynamicOptions;
|
||||
std::vector<std::string> MemoryTesterOptions;
|
||||
int MemoryTesterStyle;
|
||||
std::string MemoryTesterOutputFile;
|
||||
int MemoryTesterGlobalResults[NO_MEMORY_FAULT];
|
||||
|
@ -103,8 +103,8 @@ private:
|
|||
*/
|
||||
void GenerateDartOutput(std::ostream& os);
|
||||
|
||||
std::vector<cmStdString> CustomPreMemCheck;
|
||||
std::vector<cmStdString> CustomPostMemCheck;
|
||||
std::vector<std::string> CustomPreMemCheck;
|
||||
std::vector<std::string> CustomPostMemCheck;
|
||||
|
||||
//! Parse Valgrind/Purify/Bounds Checker result out of the output
|
||||
//string. After running, log holds the output and results hold the
|
||||
|
@ -127,7 +127,7 @@ private:
|
|||
int test);
|
||||
|
||||
///! generate the output filename for the given test index
|
||||
cmStdString testOutputFileName(int test);
|
||||
std::string testOutputFileName(int test);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -369,7 +369,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
|
|||
|
||||
// Write list of failed tests
|
||||
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)
|
||||
{
|
||||
fout << i->c_str() << "\n";
|
||||
|
|
|
@ -41,8 +41,8 @@ public:
|
|||
void PrintTestList();
|
||||
void PrintLabels();
|
||||
|
||||
void SetPassFailVectors(std::vector<cmStdString>* passed,
|
||||
std::vector<cmStdString>* failed)
|
||||
void SetPassFailVectors(std::vector<std::string>* passed,
|
||||
std::vector<std::string>* failed)
|
||||
{
|
||||
this->Passed = passed;
|
||||
this->Failed = failed;
|
||||
|
@ -107,9 +107,9 @@ protected:
|
|||
PropertiesMap Properties;
|
||||
std::map<int, bool> TestRunningMap;
|
||||
std::map<int, bool> TestFinishMap;
|
||||
std::map<int, cmStdString> TestOutput;
|
||||
std::vector<cmStdString>* Passed;
|
||||
std::vector<cmStdString>* Failed;
|
||||
std::map<int, std::string> TestOutput;
|
||||
std::vector<std::string>* Passed;
|
||||
std::vector<std::string>* Failed;
|
||||
std::vector<std::string> LastTestsFailed;
|
||||
std::set<std::string> LockedResources;
|
||||
std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults;
|
||||
|
|
|
@ -346,10 +346,10 @@ void cmCTestP4::SetP4Options(std::vector<char const*> &CommandOptions)
|
|||
//The CTEST_P4_OPTIONS variable adds additional Perforce command line
|
||||
//options before the main command
|
||||
std::string opts = this->CTest->GetCTestConfiguration("P4Options");
|
||||
std::vector<cmStdString> args =
|
||||
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)
|
||||
{
|
||||
P4Options.push_back(ai->c_str());
|
||||
|
@ -538,8 +538,8 @@ bool cmCTestP4::UpdateImpl()
|
|||
{
|
||||
opts = this->CTest->GetCTestConfiguration("P4UpdateOptions");
|
||||
}
|
||||
std::vector<cmStdString> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<cmStdString>::const_iterator ai = args.begin();
|
||||
std::vector<std::string> args = cmSystemTools::ParseArguments(opts.c_str());
|
||||
for(std::vector<std::string>::const_iterator ai = args.begin();
|
||||
ai != args.end(); ++ai)
|
||||
{
|
||||
p4_sync.push_back(ai->c_str());
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -277,7 +277,7 @@ bool cmCTestSVN::UpdateImpl()
|
|||
{
|
||||
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.
|
||||
if(this->CTest->GetTestModel() == cmCTest::NIGHTLY)
|
||||
|
@ -287,7 +287,7 @@ bool cmCTestSVN::UpdateImpl()
|
|||
|
||||
std::vector<char const*> svn_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)
|
||||
{
|
||||
svn_update.push_back(ai->c_str());
|
||||
|
@ -314,9 +314,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
|
|||
std::string userOptions =
|
||||
this->CTest->GetCTestConfiguration("SVNOptions");
|
||||
|
||||
std::vector<cmStdString> parsedUserOptions =
|
||||
std::vector<std::string> parsedUserOptions =
|
||||
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)
|
||||
{
|
||||
args.push_back(i->c_str());
|
||||
|
@ -361,10 +361,10 @@ private:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
this->Rev.SVNInfo = &SVNRepo;
|
||||
|
@ -374,7 +374,7 @@ private:
|
|||
}
|
||||
this->Changes.clear();
|
||||
}
|
||||
else if(strcmp(name, "path") == 0)
|
||||
else if(name == "path")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
if(const char* action = this->FindAttribute(atts, "action"))
|
||||
|
@ -389,28 +389,28 @@ private:
|
|||
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);
|
||||
}
|
||||
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 new_path = SVNRepo.BuildLocalPath( orig_path );
|
||||
this->CurChange.Path.assign(new_path);
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
|
|||
cmSystemTools::GetCTestCommand() << "\n");
|
||||
|
||||
// now pass through all the other arguments
|
||||
std::vector<cmStdString> &initArgs =
|
||||
std::vector<std::string> &initArgs =
|
||||
this->CTest->GetInitialCommandLineArguments();
|
||||
//*** need to make sure this does not have the current script ***
|
||||
for(size_t i=1; i < initArgs.size(); ++i)
|
||||
|
@ -766,7 +766,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
|
|||
|
||||
// do an initial cvs update as required
|
||||
command = this->UpdateCmd;
|
||||
std::vector<cmStdString>::iterator it;
|
||||
std::vector<std::string>::iterator it;
|
||||
for (it = this->ExtraUpdates.begin();
|
||||
it != this->ExtraUpdates.end();
|
||||
++ it )
|
||||
|
|
|
@ -138,26 +138,26 @@ private:
|
|||
// Try to remove the binary directory once
|
||||
static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
|
||||
|
||||
std::vector<cmStdString> ConfigurationScripts;
|
||||
std::vector<std::string> ConfigurationScripts;
|
||||
std::vector<bool> ScriptProcessScope;
|
||||
|
||||
bool Backup;
|
||||
bool EmptyBinDir;
|
||||
bool EmptyBinDirOnce;
|
||||
|
||||
cmStdString SourceDir;
|
||||
cmStdString BinaryDir;
|
||||
cmStdString BackupSourceDir;
|
||||
cmStdString BackupBinaryDir;
|
||||
cmStdString CTestRoot;
|
||||
cmStdString CVSCheckOut;
|
||||
cmStdString CTestCmd;
|
||||
cmStdString UpdateCmd;
|
||||
cmStdString CTestEnv;
|
||||
cmStdString InitialCache;
|
||||
cmStdString CMakeCmd;
|
||||
cmStdString CMOutFile;
|
||||
std::vector<cmStdString> ExtraUpdates;
|
||||
std::string SourceDir;
|
||||
std::string BinaryDir;
|
||||
std::string BackupSourceDir;
|
||||
std::string BackupBinaryDir;
|
||||
std::string CTestRoot;
|
||||
std::string CVSCheckOut;
|
||||
std::string CTestCmd;
|
||||
std::string UpdateCmd;
|
||||
std::string CTestEnv;
|
||||
std::string InitialCache;
|
||||
std::string CMakeCmd;
|
||||
std::string CMOutFile;
|
||||
std::vector<std::string> ExtraUpdates;
|
||||
|
||||
double MinimumInterval;
|
||||
double ContinuousDuration;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
|
|||
if (notesFilesVariable)
|
||||
{
|
||||
std::vector<std::string> notesFiles;
|
||||
std::vector<cmStdString> newNotesFiles;
|
||||
cmCTest::VectorOfStrings newNotesFiles;
|
||||
cmSystemTools::ExpandListArgument(notesFilesVariable,notesFiles);
|
||||
std::vector<std::string>::iterator it;
|
||||
for ( it = notesFiles.begin();
|
||||
|
@ -89,7 +89,7 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
|
|||
if (extraFilesVariable)
|
||||
{
|
||||
std::vector<std::string> extraFiles;
|
||||
std::vector<cmStdString> newExtraFiles;
|
||||
cmCTest::VectorOfStrings newExtraFiles;
|
||||
cmSystemTools::ExpandListArgument(extraFilesVariable,extraFiles);
|
||||
std::vector<std::string>::iterator it;
|
||||
for ( it = extraFiles.begin();
|
||||
|
@ -222,7 +222,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
|
|||
|
||||
if(this->ArgumentDoing == ArgumentDoingFiles)
|
||||
{
|
||||
cmStdString filename(arg);
|
||||
std::string filename(arg);
|
||||
if(cmSystemTools::FileExists(filename.c_str()))
|
||||
{
|
||||
this->Files.insert(filename);
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -68,10 +68,10 @@ private:
|
|||
return val;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CurrentValue.clear();
|
||||
if(strcmp(name, "cdash") == 0)
|
||||
if(name == "cdash")
|
||||
{
|
||||
this->CDashVersion = this->FindAttribute(atts, "version");
|
||||
}
|
||||
|
@ -82,9 +82,9 @@ private:
|
|||
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());
|
||||
if(status == "OK" || status == "SUCCESS")
|
||||
|
@ -100,15 +100,15 @@ private:
|
|||
this->Status = STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "filename") == 0)
|
||||
else if(name == "filename")
|
||||
{
|
||||
this->Filename = this->GetCurrentValue();
|
||||
}
|
||||
else if(strcmp(name, "md5") == 0)
|
||||
else if(name == "md5")
|
||||
{
|
||||
this->MD5 = this->GetCurrentValue();
|
||||
}
|
||||
else if(strcmp(name, "message") == 0)
|
||||
else if(name == "message")
|
||||
{
|
||||
this->Message = this->GetCurrentValue();
|
||||
}
|
||||
|
@ -170,10 +170,10 @@ void cmCTestSubmitHandler::Initialize()
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url)
|
||||
bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
@ -217,12 +217,12 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
|||
|
||||
::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
|
||||
|
||||
cmStdString local_file = *file;
|
||||
std::string local_file = *file;
|
||||
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
||||
{
|
||||
local_file = localprefix + "/" + *file;
|
||||
}
|
||||
cmStdString upload_as
|
||||
std::string upload_as
|
||||
= url + "/" + remoteprefix + cmSystemTools::GetFilenameName(*file);
|
||||
|
||||
struct stat st;
|
||||
|
@ -324,10 +324,10 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const cmStdString& localprefix,
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
// Uploading files is simpler
|
||||
bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url)
|
||||
bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url)
|
||||
{
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
|
@ -336,8 +336,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|||
|
||||
/* In windows, this will init the winsock stuff */
|
||||
::curl_global_init(CURL_GLOBAL_ALL);
|
||||
cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
||||
cmStdString curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
|
||||
std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
||||
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
|
||||
std::vector<std::string> args;
|
||||
cmSystemTools::ExpandListArgument(curlopt.c_str(), args);
|
||||
bool verifyPeerOff = false;
|
||||
|
@ -354,7 +354,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|||
verifyHostOff = true;
|
||||
}
|
||||
}
|
||||
cmStdString::size_type kk;
|
||||
std::string::size_type kk;
|
||||
cmCTest::SetOfStrings::const_iterator 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_VERBOSE, 1);
|
||||
|
||||
cmStdString local_file = *file;
|
||||
std::string local_file = *file;
|
||||
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
||||
{
|
||||
local_file = localprefix + "/" + *file;
|
||||
}
|
||||
cmStdString remote_file
|
||||
std::string remote_file
|
||||
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
||||
|
||||
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to "
|
||||
<< remote_file.c_str() << std::endl;
|
||||
|
||||
cmStdString ofile = "";
|
||||
std::string ofile = "";
|
||||
for ( kk = 0; kk < remote_file.size(); kk ++ )
|
||||
{
|
||||
char c = remote_file[kk];
|
||||
|
@ -448,8 +448,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
|
|||
ofile.append(hexCh);
|
||||
}
|
||||
}
|
||||
cmStdString upload_as
|
||||
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
|
||||
std::string upload_as
|
||||
= url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
|
||||
+ "FileName=" + ofile;
|
||||
|
||||
upload_as += "&MD5=";
|
||||
|
@ -666,9 +666,9 @@ void cmCTestSubmitHandler
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url)
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url)
|
||||
{
|
||||
CURL *curl;
|
||||
char error_buffer[1024];
|
||||
|
@ -721,10 +721,10 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|||
::curl_easy_setopt(curl, CURLOPT_FILE, (void *)&chunk);
|
||||
::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
|
||||
|
||||
cmStdString rfile
|
||||
std::string rfile
|
||||
= remoteprefix + cmSystemTools::GetFilenameName(*file);
|
||||
cmStdString ofile = "";
|
||||
cmStdString::iterator kk;
|
||||
std::string ofile = "";
|
||||
std::string::iterator kk;
|
||||
for ( kk = rfile.begin(); kk < rfile.end(); ++ kk)
|
||||
{
|
||||
char c = *kk;
|
||||
|
@ -747,8 +747,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|||
ofile.append(hexCh);
|
||||
}
|
||||
}
|
||||
cmStdString turl
|
||||
= url + ((url.find("?",0) == cmStdString::npos) ? "?" : "&")
|
||||
std::string turl
|
||||
= url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
|
||||
+ "xmlfile=" + ofile;
|
||||
*this->LogFile << "Trigger url: " << turl.c_str() << std::endl;
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
|
||||
|
@ -805,11 +805,11 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmCTestSubmitHandler::SubmitUsingSCP(
|
||||
const cmStdString& scp_command,
|
||||
const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url)
|
||||
const std::string& scp_command,
|
||||
const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url)
|
||||
{
|
||||
if ( !scp_command.size() || !localprefix.size() ||
|
||||
!files.size() || !remoteprefix.size() || !url.size() )
|
||||
|
@ -906,10 +906,10 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmCTestSubmitHandler::SubmitUsingCP(
|
||||
const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& destination)
|
||||
const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& destination)
|
||||
{
|
||||
if ( !localprefix.size() ||
|
||||
!files.size() || !remoteprefix.size() || !destination.size() )
|
||||
|
@ -947,17 +947,17 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
#if defined(CTEST_USE_XMLRPC)
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url)
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url)
|
||||
{
|
||||
xmlrpc_env env;
|
||||
char ctestString[] = "CTest";
|
||||
std::string ctestVersionString = cmVersion::GetCMakeVersion();
|
||||
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. */
|
||||
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
|
||||
|
@ -973,7 +973,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|||
{
|
||||
xmlrpc_value *result;
|
||||
|
||||
cmStdString local_file = *file;
|
||||
std::string local_file = *file;
|
||||
if ( !cmSystemTools::FileExists(local_file.c_str()) )
|
||||
{
|
||||
local_file = localprefix + "/" + *file;
|
||||
|
@ -1045,10 +1045,10 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
|
|||
return true;
|
||||
}
|
||||
#else
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&,
|
||||
std::set<cmStdString> const&,
|
||||
cmStdString const&,
|
||||
cmStdString const&)
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(std::string const&,
|
||||
std::set<std::string> const&,
|
||||
std::string const&,
|
||||
std::string const&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1085,7 +1085,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|||
}
|
||||
if ( getenv("HTTP_PROXY_TYPE") )
|
||||
{
|
||||
cmStdString type = getenv("HTTP_PROXY_TYPE");
|
||||
std::string type = getenv("HTTP_PROXY_TYPE");
|
||||
// HTTP/SOCKS4/SOCKS5
|
||||
if ( type == "HTTP" )
|
||||
{
|
||||
|
@ -1122,7 +1122,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|||
}
|
||||
if ( getenv("FTP_PROXY_TYPE") )
|
||||
{
|
||||
cmStdString type = getenv("FTP_PROXY_TYPE");
|
||||
std::string type = getenv("FTP_PROXY_TYPE");
|
||||
// HTTP/SOCKS4/SOCKS5
|
||||
if ( type == "HTTP" )
|
||||
{
|
||||
|
@ -1178,7 +1178,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|||
this->CTest->AddIfExists(cmCTest::PartTest, "Test.xml");
|
||||
if(this->CTest->AddIfExists(cmCTest::PartCoverage, "Coverage.xml"))
|
||||
{
|
||||
cmCTest::VectorOfStrings gfiles;
|
||||
std::vector<std::string> gfiles;
|
||||
std::string gpath
|
||||
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
|
||||
std::string::size_type glen = gpath.size() + 1;
|
||||
|
@ -1247,7 +1247,7 @@ int cmCTestSubmitHandler::ProcessHandler()
|
|||
}
|
||||
this->SetLogFile(&ofs);
|
||||
|
||||
cmStdString dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
||||
std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
|
||||
|
||||
if ( dropMethod == "" || dropMethod == "ftp" )
|
||||
{
|
||||
|
|
|
@ -47,33 +47,33 @@ private:
|
|||
/**
|
||||
* Submit file using various ways
|
||||
*/
|
||||
bool SubmitUsingFTP(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool SubmitUsingHTTP(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool SubmitUsingSCP(const cmStdString& scp_command,
|
||||
const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool SubmitUsingFTP(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
bool SubmitUsingHTTP(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
bool SubmitUsingSCP(const std::string& scp_command,
|
||||
const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
bool SubmitUsingCP( const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool SubmitUsingCP( const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
bool TriggerUsingHTTP(const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool TriggerUsingHTTP(const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
bool SubmitUsingXMLRPC(const cmStdString& localprefix,
|
||||
const std::set<cmStdString>& files,
|
||||
const cmStdString& remoteprefix,
|
||||
const cmStdString& url);
|
||||
bool SubmitUsingXMLRPC(const std::string& localprefix,
|
||||
const std::set<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
|
||||
|
||||
|
@ -82,10 +82,10 @@ private:
|
|||
std::string GetSubmitResultsPrefix();
|
||||
|
||||
class ResponseParser;
|
||||
cmStdString HTTPProxy;
|
||||
std::string HTTPProxy;
|
||||
int HTTPProxyType;
|
||||
cmStdString HTTPProxyAuth;
|
||||
cmStdString FTPProxy;
|
||||
std::string HTTPProxyAuth;
|
||||
std::string FTPProxy;
|
||||
int FTPProxyType;
|
||||
std::ostream* LogFile;
|
||||
bool SubmitPart[cmCTest::PartCount];
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -157,7 +157,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -243,7 +243,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -287,7 +287,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
@ -540,8 +540,8 @@ int cmCTestTestHandler::ProcessHandler()
|
|||
this->StartLogFile((this->MemCheck ? "DynamicAnalysis" : "Test"), mLogFile);
|
||||
this->LogFile = &mLogFile;
|
||||
|
||||
std::vector<cmStdString> passed;
|
||||
std::vector<cmStdString> failed;
|
||||
std::vector<std::string> passed;
|
||||
std::vector<std::string> failed;
|
||||
int total;
|
||||
|
||||
//start the real time clock
|
||||
|
@ -569,7 +569,7 @@ int cmCTestTestHandler::ProcessHandler()
|
|||
{
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, 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)
|
||||
{
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "\t" << *j
|
||||
|
@ -661,8 +661,8 @@ void cmCTestTestHandler::PrintLabelSummary()
|
|||
cmCTestTestHandler::ListOfTests::iterator it = this->TestList.begin();
|
||||
cmCTestTestHandler::TestResultsVector::iterator ri =
|
||||
this->TestResults.begin();
|
||||
std::map<cmStdString, double> labelTimes;
|
||||
std::set<cmStdString> labels;
|
||||
std::map<std::string, double> labelTimes;
|
||||
std::set<std::string> labels;
|
||||
// initialize maps
|
||||
std::string::size_type maxlen = 0;
|
||||
for(; it != this->TestList.end(); ++it)
|
||||
|
@ -702,7 +702,7 @@ void cmCTestTestHandler::PrintLabelSummary()
|
|||
{
|
||||
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)
|
||||
{
|
||||
std::string label = *i;
|
||||
|
@ -1050,8 +1050,8 @@ bool cmCTestTestHandler::GetValue(const char* tag,
|
|||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
|
||||
std::vector<cmStdString> &failed)
|
||||
void cmCTestTestHandler::ProcessDirectory(std::vector<std::string> &passed,
|
||||
std::vector<std::string> &failed)
|
||||
{
|
||||
this->ComputeTestList();
|
||||
this->StartTest = this->CTest->CurrentTime();
|
||||
|
@ -1216,7 +1216,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
|
|||
<< "name=\"Command Line\"><Value>"
|
||||
<< cmXMLSafe(result->FullCommandLine)
|
||||
<< "</Value></NamedMeasurement>\n";
|
||||
std::map<cmStdString,cmStdString>::iterator measureIt;
|
||||
std::map<std::string,std::string>::iterator measureIt;
|
||||
for ( measureIt = result->Properties->Measurements.begin();
|
||||
measureIt != result->Properties->Measurements.end();
|
||||
++ 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 )
|
||||
{
|
||||
int retVal = 0;
|
||||
|
@ -2112,7 +2112,7 @@ bool cmCTestTestHandler::SetTestsProperties(
|
|||
const std::vector<std::string>& args)
|
||||
{
|
||||
std::vector<std::string>::const_iterator it;
|
||||
std::vector<cmStdString> tests;
|
||||
std::vector<std::string> tests;
|
||||
bool found = false;
|
||||
for ( it = args.begin(); it != args.end(); ++ it )
|
||||
{
|
||||
|
@ -2137,7 +2137,7 @@ bool cmCTestTestHandler::SetTestsProperties(
|
|||
break;
|
||||
}
|
||||
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 )
|
||||
{
|
||||
cmCTestTestHandler::ListOfTests::iterator rtit;
|
||||
|
@ -2319,7 +2319,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
|
|||
}
|
||||
if ( this->MemCheck )
|
||||
{
|
||||
std::vector<cmStdString>::iterator it;
|
||||
std::vector<std::string>::iterator it;
|
||||
bool found = false;
|
||||
for ( it = this->CustomTestsIgnore.begin();
|
||||
it != this->CustomTestsIgnore.end(); ++ it )
|
||||
|
@ -2339,7 +2339,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
|
|||
}
|
||||
else
|
||||
{
|
||||
std::vector<cmStdString>::iterator it;
|
||||
std::vector<std::string>::iterator it;
|
||||
bool found = false;
|
||||
for ( it = this->CustomTestsIgnore.begin();
|
||||
it != this->CustomTestsIgnore.end(); ++ it )
|
||||
|
|
|
@ -87,8 +87,8 @@ public:
|
|||
// ctest -j N will break for that feature
|
||||
struct cmCTestTestProperties
|
||||
{
|
||||
cmStdString Name;
|
||||
cmStdString Directory;
|
||||
std::string Name;
|
||||
std::string Directory;
|
||||
std::vector<std::string> Args;
|
||||
std::vector<std::string> RequiredFiles;
|
||||
std::vector<std::string> Depends;
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
std::string> > ErrorRegularExpressions;
|
||||
std::vector<std::pair<cmsys::RegularExpression,
|
||||
std::string> > RequiredRegularExpressions;
|
||||
std::map<cmStdString, cmStdString> Measurements;
|
||||
std::map<std::string, std::string> Measurements;
|
||||
bool IsInBasedOnREOptions;
|
||||
bool WillFail;
|
||||
float Cost;
|
||||
|
@ -162,7 +162,7 @@ protected:
|
|||
virtual int PreProcessHandler();
|
||||
virtual int PostProcessHandler();
|
||||
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 WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result);
|
||||
|
@ -177,7 +177,7 @@ protected:
|
|||
typedef std::vector<cmCTestTestResult> TestResultsVector;
|
||||
TestResultsVector TestResults;
|
||||
|
||||
std::vector<cmStdString> CustomTestsIgnore;
|
||||
std::vector<std::string> CustomTestsIgnore;
|
||||
std::string StartTest;
|
||||
std::string EndTest;
|
||||
unsigned int StartTestTime;
|
||||
|
@ -210,8 +210,8 @@ private:
|
|||
/**
|
||||
* Run the tests for a directory and any subdirectories
|
||||
*/
|
||||
void ProcessDirectory(std::vector<cmStdString> &passed,
|
||||
std::vector<cmStdString> &failed);
|
||||
void ProcessDirectory(std::vector<std::string> &passed,
|
||||
std::vector<std::string> &failed);
|
||||
|
||||
/**
|
||||
* Get the list of tests in directory and subdirectories.
|
||||
|
@ -251,8 +251,8 @@ private:
|
|||
void ExpandTestsToRunInformation(size_t numPossibleTests);
|
||||
void ExpandTestsToRunInformationForRerunFailed();
|
||||
|
||||
std::vector<cmStdString> CustomPreTest;
|
||||
std::vector<cmStdString> CustomPostTest;
|
||||
std::vector<std::string> CustomPreTest;
|
||||
std::vector<std::string> CustomPostTest;
|
||||
|
||||
std::vector<int> TestsToRun;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
|
|||
{
|
||||
if(this->ArgumentDoing == ArgumentDoingFiles)
|
||||
{
|
||||
cmStdString filename(arg);
|
||||
std::string filename(arg);
|
||||
if(cmSystemTools::FileExists(filename.c_str()))
|
||||
{
|
||||
this->Files.insert(filename);
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@ bool cmCTestVC::InitialCheckout(const char* command)
|
|||
}
|
||||
|
||||
// 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;
|
||||
for(std::vector<cmStdString>::const_iterator ai = args.begin();
|
||||
for(std::vector<std::string>::const_iterator ai = args.begin();
|
||||
ai != args.end(); ++ai)
|
||||
{
|
||||
vc_co.push_back(ai->c_str());
|
||||
|
|
|
@ -182,7 +182,7 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
|
|||
// ( file , entry ) = "number_executed:timing_info"
|
||||
// ^COVERAGE("%RSEL","init",8,"FOR_LOOP",1)=1
|
||||
// ( file , entry, line, IGNORE ) =number_executed
|
||||
std::vector<cmStdString> args;
|
||||
std::vector<std::string> args;
|
||||
std::string::size_type pos = line.find('(', 0);
|
||||
// if no ( is found, then return line has no coverage
|
||||
if(pos == std::string::npos)
|
||||
|
|
|
@ -140,7 +140,7 @@ bool cmParseMumpsCoverage::LoadPackages(const char* d)
|
|||
bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
|
||||
std::string& filepath)
|
||||
{
|
||||
std::map<cmStdString, cmStdString>::iterator i =
|
||||
std::map<std::string, std::string>::iterator i =
|
||||
this->RoutineToDirectory.find(routine);
|
||||
if(i != this->RoutineToDirectory.end())
|
||||
{
|
||||
|
|
|
@ -44,7 +44,7 @@ protected:
|
|||
bool FindMumpsFile(std::string const& routine,
|
||||
std::string& filepath);
|
||||
protected:
|
||||
std::map<cmStdString, cmStdString> RoutineToDirectory;
|
||||
std::map<std::string, std::string> RoutineToDirectory;
|
||||
cmCTestCoverageHandlerContainer& Coverage;
|
||||
cmCTest* CTest;
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ bool cmParsePHPCoverage::ReadUntil(std::istream& in, char until)
|
|||
return true;
|
||||
}
|
||||
bool cmParsePHPCoverage::ReadCoverageArray(std::istream& in,
|
||||
cmStdString const& fileName)
|
||||
std::string const& fileName)
|
||||
{
|
||||
cmCTestCoverageHandlerContainer::SingleFileCoverageVector& coverageVector
|
||||
= this->Coverage.TotalCoverage[fileName];
|
||||
|
@ -166,7 +166,7 @@ bool cmParsePHPCoverage::ReadFileInformation(std::istream& in)
|
|||
// read the string data
|
||||
in.read(s, size-1);
|
||||
s[size-1] = 0;
|
||||
cmStdString fileName = s;
|
||||
std::string fileName = s;
|
||||
delete [] s;
|
||||
// read close quote
|
||||
if(in.get(c) && c != '"')
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
bool ReadArraySize(std::istream& in, int& size);
|
||||
bool ReadFileInformation(std::istream& in);
|
||||
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);
|
||||
cmCTestCoverageHandlerContainer& Coverage;
|
||||
cmCTest* CTest;
|
||||
|
|
|
@ -20,9 +20,9 @@ public:
|
|||
|
||||
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;
|
||||
while(true)
|
||||
|
@ -57,7 +57,7 @@ protected:
|
|||
++tagCount;
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "line") == 0)
|
||||
else if(name == "line")
|
||||
{
|
||||
int tagCount = 0;
|
||||
int curNumber = -1;
|
||||
|
@ -85,7 +85,7 @@ protected:
|
|||
}
|
||||
}
|
||||
|
||||
virtual void EndElement(const char*) {}
|
||||
virtual void EndElement(const std::string&) {}
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
#include "cmCursesDummyWidget.h"
|
||||
#include "../cmSystemTools.h"
|
||||
|
||||
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
|
||||
int labelwidth,
|
||||
int entrywidth) :
|
||||
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
||||
const std::string& key,
|
||||
int labelwidth,
|
||||
int entrywidth) :
|
||||
Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
|
||||
{
|
||||
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
|
||||
|
@ -31,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
|
|||
}
|
||||
|
||||
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)
|
||||
: Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
|
||||
{
|
||||
|
@ -50,7 +51,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
|||
{
|
||||
case cmCacheManager::BOOL:
|
||||
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);
|
||||
}
|
||||
|
@ -93,7 +94,8 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
|||
}
|
||||
break;
|
||||
case cmCacheManager::UNINITIALIZED:
|
||||
cmSystemTools::Error("Found an undefined variable: ", it.GetName());
|
||||
cmSystemTools::Error("Found an undefined variable: ",
|
||||
it.GetName().c_str());
|
||||
break;
|
||||
default:
|
||||
// TODO : put warning message here
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
class cmCursesCacheEntryComposite
|
||||
{
|
||||
public:
|
||||
cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth);
|
||||
cmCursesCacheEntryComposite(const char* key,
|
||||
cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
|
||||
int entrywidth);
|
||||
cmCursesCacheEntryComposite(const std::string& key,
|
||||
const cmCacheManager::CacheIterator& it,
|
||||
bool isNew, int labelwidth, int entrywidth);
|
||||
~cmCursesCacheEntryComposite();
|
||||
|
|
|
@ -84,9 +84,9 @@ cmCursesMainForm::~cmCursesMainForm()
|
|||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key)
|
|||
std::vector<cmCursesCacheEntryComposite*>::iterator it;
|
||||
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
|
||||
{
|
||||
if (!strcmp(key, (*it)->Key.c_str()))
|
||||
if (key == (*it)->Key)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void cmCursesMainForm::InitializeUI()
|
|||
this->CMakeInstance->GetCacheManager()->NewIterator();
|
||||
!i.IsAtEnd(); i.Next())
|
||||
{
|
||||
const char* key = i.GetName();
|
||||
std::string key = i.GetName();
|
||||
if ( i.GetType() == cmCacheManager::INTERNAL ||
|
||||
i.GetType() == cmCacheManager::STATIC ||
|
||||
i.GetType() == cmCacheManager::UNINITIALIZED )
|
||||
|
@ -168,7 +168,7 @@ void cmCursesMainForm::InitializeUI()
|
|||
this->CMakeInstance->GetCacheManager()->NewIterator();
|
||||
!i.IsAtEnd(); i.Next())
|
||||
{
|
||||
const char* key = i.GetName();
|
||||
std::string key = i.GetName();
|
||||
if ( i.GetType() == cmCacheManager::INTERNAL ||
|
||||
i.GetType() == cmCacheManager::STATIC ||
|
||||
i.GetType() == cmCacheManager::UNINITIALIZED )
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
* Returns true if an entry with the given key is in the
|
||||
* list of current composites.
|
||||
*/
|
||||
bool LookForCacheEntry(const char* key);
|
||||
bool LookForCacheEntry(const std::string& key);
|
||||
|
||||
enum {
|
||||
MIN_WIDTH = 65,
|
||||
|
|
|
@ -89,7 +89,7 @@ void cmCursesOptionsWidget::PreviousOption()
|
|||
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->SetValue(value);
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
// when this widget has focus. Returns true if the input was
|
||||
// handled.
|
||||
virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
|
||||
void SetOption(const char*);
|
||||
void SetOption(const std::string&);
|
||||
void AddOption(std::string const &);
|
||||
void NextOption();
|
||||
void PreviousOption();
|
||||
|
|
|
@ -57,7 +57,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
|
|||
{
|
||||
glob = cstr + "*";
|
||||
}
|
||||
std::vector<cmStdString> dirs;
|
||||
std::vector<std::string> dirs;
|
||||
|
||||
cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0));
|
||||
if ( this->CurrentIndex < dirs.size() )
|
||||
|
|
|
@ -195,7 +195,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
|
|||
return true;
|
||||
}
|
||||
|
||||
void cmCursesStringWidget::SetString(const char* value)
|
||||
void cmCursesStringWidget::SetString(const std::string& value)
|
||||
{
|
||||
this->SetValue(value);
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
/**
|
||||
* Set/Get the string.
|
||||
*/
|
||||
void SetString(const char* value);
|
||||
void SetString(const std::string& value);
|
||||
const char* GetString();
|
||||
virtual const char* GetValue();
|
||||
|
||||
|
|
|
@ -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;
|
||||
set_field_buffer(this->Field, 0, value);
|
||||
set_field_buffer(this->Field, 0, value.c_str());
|
||||
}
|
||||
|
||||
const char* cmCursesWidget::GetValue()
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
* Set/Get the value (setting the value also changes the contents
|
||||
* of the field buffer).
|
||||
*/
|
||||
virtual void SetValue(const char* value);
|
||||
virtual void SetValue(const std::string& value);
|
||||
virtual const char* GetValue();
|
||||
|
||||
/**
|
||||
|
|
|
@ -111,7 +111,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
|
|||
cmCacheManager::CacheIterator itm = cachem->NewIterator();
|
||||
if ( itm.Find("CMAKE_HOME_DIRECTORY"))
|
||||
{
|
||||
setSourceDirectory(QString::fromLocal8Bit(itm.GetValue()));
|
||||
setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str()));
|
||||
}
|
||||
if ( itm.Find("CMAKE_GENERATOR"))
|
||||
{
|
||||
|
@ -201,11 +201,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps)
|
|||
}
|
||||
|
||||
QCMakeProperty prop;
|
||||
prop.Key = QString::fromLocal8Bit(i.GetName());
|
||||
prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
|
||||
int idx = props.indexOf(prop);
|
||||
if(idx == -1)
|
||||
{
|
||||
toremove.append(QString::fromLocal8Bit(i.GetName()));
|
||||
toremove.append(QString::fromLocal8Bit(i.GetName().c_str()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -286,15 +286,15 @@ QCMakePropertyList QCMake::properties() const
|
|||
}
|
||||
|
||||
QCMakeProperty prop;
|
||||
prop.Key = QString::fromLocal8Bit(i.GetName());
|
||||
prop.Key = QString::fromLocal8Bit(i.GetName().c_str());
|
||||
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");
|
||||
|
||||
if(i.GetType() == cmCacheManager::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)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
protected:
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
/**
|
||||
* The name of the command as specified in CMakeList.txt.
|
||||
*/
|
||||
virtual const char* GetName() const
|
||||
virtual std::string GetName() const
|
||||
{return "add_custom_target";}
|
||||
|
||||
cmTypeMacro(cmAddCustomTargetCommand, cmCommand);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
private:
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -44,7 +44,7 @@ bool cmBuildCommand
|
|||
// Parse remaining arguments.
|
||||
const char* configuration = 0;
|
||||
const char* project_name = 0;
|
||||
const char* target = 0;
|
||||
std::string target;
|
||||
enum Doing { DoingNone, DoingConfiguration, DoingProjectName, DoingTarget };
|
||||
Doing doing = DoingNone;
|
||||
for(unsigned int i=1; i < args.size(); ++i)
|
||||
|
@ -74,7 +74,7 @@ bool cmBuildCommand
|
|||
else if(doing == DoingTarget)
|
||||
{
|
||||
doing = DoingNone;
|
||||
target = args[i].c_str();
|
||||
target = args[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ bool cmBuildCommand
|
|||
|
||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||
->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration,
|
||||
0, true);
|
||||
"", true);
|
||||
|
||||
this->Makefile->AddDefinition(variable, makecommand.c_str());
|
||||
|
||||
|
@ -136,8 +136,8 @@ bool cmBuildCommand
|
|||
}
|
||||
|
||||
std::string makecommand = this->Makefile->GetLocalGenerator()
|
||||
->GetGlobalGenerator()->GenerateCMakeBuildCommand(0, configType.c_str(),
|
||||
0, true);
|
||||
->GetGlobalGenerator()->GenerateCMakeBuildCommand("", configType.c_str(),
|
||||
"", true);
|
||||
|
||||
if(cacheValue)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
};
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
virtual cmCommand* Clone() { return new cmBuildNameCommand; }
|
||||
virtual bool InitialPass(std::vector<std::string> const& args,
|
||||
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 IsDiscouraged() const { return true; }
|
||||
};
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
/**
|
||||
* 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";
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
/**
|
||||
* 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);
|
||||
private:
|
||||
|
|
|
@ -1153,7 +1153,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
|||
int* retVal, const char* dir, int timeout, std::ostream& ofs)
|
||||
{
|
||||
// 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)
|
||||
{
|
||||
|
@ -1161,7 +1161,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string* output,
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
if ( !this->OpenOutputFile(this->CurrentTag, "Notes.xml", ofs) )
|
||||
|
@ -1658,7 +1658,7 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
|
|||
return 1;
|
||||
}
|
||||
|
||||
std::vector<cmStdString> files;
|
||||
VectorOfStrings files;
|
||||
|
||||
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 tarFile = file + "_temp.tar.gz";
|
||||
std::vector<cmStdString> files;
|
||||
std::vector<std::string> files;
|
||||
files.push_back(file);
|
||||
|
||||
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();
|
||||
it != files.end();
|
||||
++ it )
|
||||
|
@ -1749,7 +1749,7 @@ bool cmCTest::SubmitExtraFiles(const char* cfiles)
|
|||
return 1;
|
||||
}
|
||||
|
||||
std::vector<cmStdString> files;
|
||||
VectorOfStrings files;
|
||||
|
||||
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)
|
||||
{
|
||||
i++;
|
||||
this->AddCTestConfigurationOverwrite(args[i].c_str());
|
||||
this->AddCTestConfigurationOverwrite(args[i]);
|
||||
}
|
||||
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,
|
||||
VectorOfStrings& vec)
|
||||
void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
|
||||
std::vector<std::string>& vec)
|
||||
{
|
||||
if ( !def)
|
||||
{
|
||||
return;
|
||||
}
|
||||
const char* dval = mf->GetDefinition(def);
|
||||
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);
|
||||
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) !=
|
||||
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("=");
|
||||
if ( epos == overStr.npos )
|
||||
{
|
||||
|
@ -2877,7 +2869,7 @@ void cmCTest::SetConfigType(const char* ct)
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf,
|
||||
const char* dconfig, const char* cmake_var)
|
||||
const char* dconfig, const std::string& cmake_var)
|
||||
{
|
||||
const char* ctvar;
|
||||
ctvar = mf->GetDefinition(cmake_var);
|
||||
|
@ -2900,7 +2892,7 @@ bool cmCTest::RunCommand(
|
|||
const char* dir,
|
||||
double timeout)
|
||||
{
|
||||
std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
|
||||
std::vector<std::string> args = cmSystemTools::ParseArguments(command);
|
||||
|
||||
if(args.size() < 1)
|
||||
{
|
||||
|
@ -2908,7 +2900,7 @@ bool cmCTest::RunCommand(
|
|||
}
|
||||
|
||||
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)
|
||||
{
|
||||
argv.push_back(a->c_str());
|
||||
|
|
|
@ -70,8 +70,8 @@ public:
|
|||
{
|
||||
PartInfo(): Enabled(false) {}
|
||||
|
||||
void SetName(const char* name) { this->Name = name; }
|
||||
const char* GetName() const { return this->Name.c_str(); }
|
||||
void SetName(const std::string& name) { this->Name = name; }
|
||||
const std::string& GetName() const { return this->Name; }
|
||||
|
||||
void Enable() { this->Enabled = true; }
|
||||
operator bool() const { return this->Enabled; }
|
||||
|
@ -101,8 +101,8 @@ public:
|
|||
if the string does not name a valid part. */
|
||||
Part GetPartFromName(const char* name);
|
||||
|
||||
typedef std::vector<cmStdString> VectorOfStrings;
|
||||
typedef std::set<cmStdString> SetOfStrings;
|
||||
typedef std::vector<cmsys::String> VectorOfStrings;
|
||||
typedef std::set<std::string> SetOfStrings;
|
||||
|
||||
///! Process Command line arguments
|
||||
int Run(std::vector<std::string> &, std::string* output = 0);
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
std::string GetTestModelString();
|
||||
static int GetTestModelFromString(const char* 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 EmptyCTestConfiguration();
|
||||
|
||||
|
@ -185,9 +185,9 @@ public:
|
|||
//! Set the notes files to be created.
|
||||
void SetNotesFiles(const char* notes);
|
||||
|
||||
void PopulateCustomVector(cmMakefile* mf, const char* definition,
|
||||
VectorOfStrings& vec);
|
||||
void PopulateCustomInteger(cmMakefile* mf, const char* def,
|
||||
void PopulateCustomVector(cmMakefile* mf, const std::string& definition,
|
||||
std::vector<std::string>& vec);
|
||||
void PopulateCustomInteger(cmMakefile* mf, const std::string& def,
|
||||
int& val);
|
||||
|
||||
///! Get the current time as string
|
||||
|
@ -332,7 +332,7 @@ public:
|
|||
* Set the CTest variable from CMake variable
|
||||
*/
|
||||
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
|
||||
static std::string MakeURLSafe(const std::string&);
|
||||
|
@ -349,14 +349,14 @@ public:
|
|||
|
||||
//! Add overwrite to ctest configuration.
|
||||
// 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
|
||||
int GenerateNotesFile(const std::vector<cmStdString> &files);
|
||||
int GenerateNotesFile(const VectorOfStrings &files);
|
||||
|
||||
//! Submit extra files to the server
|
||||
bool SubmitExtraFiles(const char* files);
|
||||
bool SubmitExtraFiles(const std::vector<cmStdString> &files);
|
||||
bool SubmitExtraFiles(const VectorOfStrings &files);
|
||||
|
||||
//! Set the output log file name
|
||||
void SetOutputLogFileName(const char* name);
|
||||
|
@ -391,7 +391,7 @@ public:
|
|||
//! Read the custom configuration files and apply them to the current ctest
|
||||
int ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf);
|
||||
|
||||
std::vector<cmStdString> &GetInitialCommandLineArguments()
|
||||
std::vector<std::string> &GetInitialCommandLineArguments()
|
||||
{ return this->InitialCommandLineArguments; };
|
||||
|
||||
//! Set the track to submit to
|
||||
|
@ -447,13 +447,13 @@ private:
|
|||
void DetermineNextDayStop();
|
||||
|
||||
// these are helper classes
|
||||
typedef std::map<cmStdString,cmCTestGenericHandler*> t_TestingHandlers;
|
||||
typedef std::map<std::string,cmCTestGenericHandler*> t_TestingHandlers;
|
||||
t_TestingHandlers TestingHandlers;
|
||||
|
||||
bool ShowOnly;
|
||||
|
||||
//! Map of configuration properties
|
||||
typedef std::map<cmStdString, cmStdString> CTestConfigurationMap;
|
||||
typedef std::map<std::string, std::string> CTestConfigurationMap;
|
||||
|
||||
std::string CTestConfigFile;
|
||||
// TODO: The ctest configuration should be a hierarchy of
|
||||
|
@ -463,7 +463,7 @@ private:
|
|||
CTestConfigurationMap CTestConfiguration;
|
||||
CTestConfigurationMap CTestConfigurationOverwrites;
|
||||
PartInfo Parts[PartCount];
|
||||
typedef std::map<cmStdString, Part> PartMapType;
|
||||
typedef std::map<std::string, Part> PartMapType;
|
||||
PartMapType PartMap;
|
||||
|
||||
std::string CurrentTag;
|
||||
|
@ -556,7 +556,7 @@ private:
|
|||
int DartVersion;
|
||||
bool DropSiteCDash;
|
||||
|
||||
std::vector<cmStdString> InitialCommandLineArguments;
|
||||
std::vector<std::string> InitialCommandLineArguments;
|
||||
|
||||
int SubmitIndex;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
bool cmCacheManager::LoadCache(const char* path,
|
||||
bool cmCacheManager::LoadCache(const std::string& path,
|
||||
bool internal)
|
||||
{
|
||||
std::set<cmStdString> emptySet;
|
||||
std::set<std::string> 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& value)
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ static bool ParseEntryWithoutType(const char* entry,
|
|||
return flag;
|
||||
}
|
||||
|
||||
bool cmCacheManager::ParseEntry(const char* entry,
|
||||
bool cmCacheManager::ParseEntry(const std::string& entry,
|
||||
std::string& var,
|
||||
std::string& value,
|
||||
CacheEntryType& type)
|
||||
|
@ -178,7 +178,7 @@ bool cmCacheManager::ParseEntry(const char* entry,
|
|||
return flag;
|
||||
}
|
||||
|
||||
void cmCacheManager::CleanCMakeFiles(const char* path)
|
||||
void cmCacheManager::CleanCMakeFiles(const std::string& path)
|
||||
{
|
||||
std::string glob = path;
|
||||
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,
|
||||
std::set<cmStdString>& excludes,
|
||||
std::set<cmStdString>& includes)
|
||||
std::set<std::string>& excludes,
|
||||
std::set<std::string>& includes)
|
||||
{
|
||||
std::string cacheFile = path;
|
||||
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;
|
||||
cacheFile += "/CMakeCache.txt";
|
||||
|
@ -500,7 +500,7 @@ bool cmCacheManager::SaveCache(const char* path)
|
|||
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)
|
||||
{
|
||||
const CacheEntry& ce = (*i).second;
|
||||
|
@ -578,7 +578,7 @@ bool cmCacheManager::SaveCache(const char* path)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool cmCacheManager::DeleteCache(const char* path)
|
||||
bool cmCacheManager::DeleteCache(const std::string& path)
|
||||
{
|
||||
std::string cacheFile = path;
|
||||
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);
|
||||
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);
|
||||
if(i != this->Cache.end())
|
||||
|
@ -676,7 +677,7 @@ cmCacheManager::CacheIterator cmCacheManager::GetCacheIterator(
|
|||
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);
|
||||
if(i != this->Cache.end() &&
|
||||
|
@ -692,7 +693,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
|
|||
{
|
||||
out << "=================================================" << 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)
|
||||
{
|
||||
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* helpString,
|
||||
CacheEntryType type)
|
||||
|
@ -767,7 +768,7 @@ void cmCacheManager::CacheIterator::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);
|
||||
return !this->IsAtEnd();
|
||||
|
@ -807,13 +808,13 @@ bool cmCacheManager::CacheIterator::GetValueAsBool() const
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
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];
|
||||
}
|
||||
else if(strcmp(prop, "VALUE") == 0)
|
||||
else if(prop == "VALUE")
|
||||
{
|
||||
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)
|
||||
{
|
||||
if(strcmp(prop, "TYPE") == 0)
|
||||
if(prop == "TYPE")
|
||||
{
|
||||
this->Type = cmCacheManager::StringToType(value? value : "STRING");
|
||||
}
|
||||
else if(strcmp(prop, "VALUE") == 0)
|
||||
else if(prop == "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,
|
||||
bool asString)
|
||||
{
|
||||
if(strcmp(prop, "TYPE") == 0)
|
||||
if(prop == "TYPE")
|
||||
{
|
||||
this->Type = cmCacheManager::StringToType(value? value : "STRING");
|
||||
}
|
||||
else if(strcmp(prop, "VALUE") == 0)
|
||||
else if(prop == "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())
|
||||
{
|
||||
|
@ -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())
|
||||
{
|
||||
|
@ -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,
|
||||
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))
|
||||
{
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmCacheManager::CacheIterator::PropertyExists(const char* prop) const
|
||||
bool cmCacheManager::CacheIterator::PropertyExists(
|
||||
const std::string& prop) const
|
||||
{
|
||||
return this->GetProperty(prop)? true:false;
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ private:
|
|||
std::string Value;
|
||||
CacheEntryType Type;
|
||||
cmPropertyMap Properties;
|
||||
const char* GetProperty(const char*) const;
|
||||
void SetProperty(const char* property, const char* value);
|
||||
void AppendProperty(const char* property, const char* value,
|
||||
const char* GetProperty(const std::string&) const;
|
||||
void SetProperty(const std::string& property, const char* value);
|
||||
void AppendProperty(const std::string& property, const char* value,
|
||||
bool asString=false);
|
||||
bool Initialized;
|
||||
CacheEntry() : Value(""), Type(UNINITIALIZED), Initialized(false)
|
||||
|
@ -53,26 +53,26 @@ public:
|
|||
{
|
||||
public:
|
||||
void Begin();
|
||||
bool Find(const char*);
|
||||
bool Find(const std::string&);
|
||||
bool IsAtEnd() const;
|
||||
void Next();
|
||||
const char *GetName() const {
|
||||
return this->Position->first.c_str(); }
|
||||
const char* GetProperty(const char*) const ;
|
||||
bool GetPropertyAsBool(const char*) const ;
|
||||
bool PropertyExists(const char*) const;
|
||||
void SetProperty(const char* property, const char* value);
|
||||
void AppendProperty(const char* property, const char* value,
|
||||
std::string GetName() const {
|
||||
return this->Position->first; }
|
||||
const char* GetProperty(const std::string&) const ;
|
||||
bool GetPropertyAsBool(const std::string&) const ;
|
||||
bool PropertyExists(const std::string&) const;
|
||||
void SetProperty(const std::string& property, const char* value);
|
||||
void AppendProperty(const std::string& property, const char* value,
|
||||
bool asString=false);
|
||||
void SetProperty(const char* property, bool value);
|
||||
const char* GetValue() const { return this->GetEntry().Value.c_str(); }
|
||||
void SetProperty(const std::string& property, bool value);
|
||||
std::string GetValue() const { return this->GetEntry().Value; }
|
||||
bool GetValueAsBool() const;
|
||||
void SetValue(const char*);
|
||||
CacheEntryType GetType() const { return this->GetEntry().Type; }
|
||||
void SetType(CacheEntryType ty) { this->GetEntry().Type = ty; }
|
||||
bool Initialized() { return this->GetEntry().Initialized; }
|
||||
cmCacheManager &Container;
|
||||
std::map<cmStdString, CacheEntry>::iterator Position;
|
||||
std::map<std::string, CacheEntry>::iterator Position;
|
||||
CacheIterator(cmCacheManager &cm) : Container(cm) {
|
||||
this->Begin();
|
||||
}
|
||||
|
@ -108,19 +108,19 @@ public:
|
|||
///! Load a cache for given makefile. Loads from ouput home.
|
||||
bool LoadCache(cmMakefile*);
|
||||
///! Load a cache for given makefile. Loads from path/CMakeCache.txt.
|
||||
bool LoadCache(const char* path);
|
||||
bool LoadCache(const char* path, bool internal);
|
||||
bool LoadCache(const char* path, bool internal,
|
||||
std::set<cmStdString>& excludes,
|
||||
std::set<cmStdString>& includes);
|
||||
bool LoadCache(const std::string& path);
|
||||
bool LoadCache(const std::string& path, bool internal);
|
||||
bool LoadCache(const std::string& path, bool internal,
|
||||
std::set<std::string>& excludes,
|
||||
std::set<std::string>& includes);
|
||||
|
||||
///! Save cache for given makefile. Saves to ouput home CMakeCache.txt.
|
||||
bool SaveCache(cmMakefile*) ;
|
||||
///! 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
|
||||
bool DeleteCache(const char* path);
|
||||
bool DeleteCache(const std::string& path);
|
||||
|
||||
///! Print the cache to a stream
|
||||
void PrintCache(std::ostream&) const;
|
||||
|
@ -129,20 +129,20 @@ public:
|
|||
cmCacheManager::CacheIterator GetCacheIterator(const char *key=0);
|
||||
|
||||
///! 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
|
||||
int GetSize() {
|
||||
return static_cast<int>(this->Cache.size()); }
|
||||
|
||||
///! 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& value,
|
||||
CacheEntryType& type);
|
||||
|
||||
///! 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. */
|
||||
unsigned int GetCacheMajorVersion() const
|
||||
|
@ -153,20 +153,20 @@ public:
|
|||
|
||||
protected:
|
||||
///! 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);
|
||||
|
||||
///! 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
|
||||
void CleanCMakeFiles(const char* path);
|
||||
void CleanCMakeFiles(const std::string& path);
|
||||
|
||||
// Cache version info
|
||||
unsigned int CacheMajorVersion;
|
||||
unsigned int CacheMinorVersion;
|
||||
private:
|
||||
cmake* CMakeInstance;
|
||||
typedef std::map<cmStdString, CacheEntry> CacheEntryMap;
|
||||
typedef std::map<std::string, CacheEntry> CacheEntryMap;
|
||||
static void OutputHelpString(std::ostream& fout,
|
||||
const std::string& helpString);
|
||||
static void OutputKey(std::ostream& fout, std::string const& key);
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
/**
|
||||
* 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.
|
||||
|
@ -166,7 +166,7 @@ public:
|
|||
/**
|
||||
* Set the error message
|
||||
*/
|
||||
void SetError(const char* e)
|
||||
void SetError(const std::string& e)
|
||||
{
|
||||
this->Error = this->GetName();
|
||||
this->Error += " ";
|
||||
|
|
|
@ -49,14 +49,14 @@ void cmCommandArgumentParserHelper::SetLineFile(long line, const char* 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;
|
||||
}
|
||||
char* stVal = new char[strlen(str)+1];
|
||||
strcpy(stVal, str);
|
||||
char* stVal = new char[str.size()+1];
|
||||
strcpy(stVal, str.c_str());
|
||||
this->Variables.push_back(stVal);
|
||||
return stVal;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
|
|||
{
|
||||
return this->AddString(cmSystemTools::EscapeQuotes(value).c_str());
|
||||
}
|
||||
return this->AddString(value);
|
||||
return this->AddString(value ? value : "");
|
||||
}
|
||||
|
||||
char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
|
||||
|
@ -166,7 +166,7 @@ char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var)
|
|||
// then return an empty string
|
||||
if(!ret && this->RemoveEmpty)
|
||||
{
|
||||
return this->AddString(ret);
|
||||
return this->AddString("");
|
||||
}
|
||||
// if the ret was not 0, then return it
|
||||
if(ret)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue