stringapi: Use strings for AddSubdirectory paths

This commit is contained in:
Ben Boeckel 2014-02-07 15:33:35 -05:00 committed by Brad King
parent 30bc251b65
commit adcd812917
3 changed files with 13 additions and 10 deletions

View File

@ -287,7 +287,7 @@ public:
std::string const& content); std::string const& content);
/** Return whether the given binary directory is unused. */ /** Return whether the given binary directory is unused. */
bool BinaryDirectoryIsNew(const char* dir) bool BinaryDirectoryIsNew(const std::string& dir)
{ {
return this->BinaryDirectories.insert(dir).second; return this->BinaryDirectories.insert(dir).second;
} }

View File

@ -1648,7 +1648,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
} }
} }
void cmMakefile::AddSubDirectory(const char* sub, void cmMakefile::AddSubDirectory(const std::string& sub,
bool excludeFromAll, bool preorder) bool excludeFromAll, bool preorder)
{ {
// the source path must be made full if it isn't already // the source path must be made full if it isn't already
@ -1675,7 +1675,8 @@ void cmMakefile::AddSubDirectory(const char* sub,
} }
void cmMakefile::AddSubDirectory(const char* srcPath, const char *binPath, void cmMakefile::AddSubDirectory(const std::string& srcPath,
const std::string& binPath,
bool excludeFromAll, bool preorder, bool excludeFromAll, bool preorder,
bool immediate) bool immediate)
{ {
@ -4185,8 +4186,8 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmMakefile::EnforceUniqueDir(const char* srcPath, bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
const char* binPath) const const std::string& binPath) const
{ {
// Make sure the binary directory is unique. // Make sure the binary directory is unique.
cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator(); cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();

View File

@ -263,9 +263,10 @@ public:
/** /**
* Add a subdirectory to the build. * Add a subdirectory to the build.
*/ */
void AddSubDirectory(const char*, bool excludeFromAll=false, void AddSubDirectory(const std::string&, bool excludeFromAll=false,
bool preorder = false); bool preorder = false);
void AddSubDirectory(const char* fullSrcDir,const char *fullBinDir, void AddSubDirectory(const std::string& fullSrcDir,
const std::string& fullBinDir,
bool excludeFromAll, bool preorder, bool excludeFromAll, bool preorder,
bool immediate); bool immediate);
@ -430,7 +431,7 @@ public:
* recursing up the tree starting at the StartDirectory and going up until * recursing up the tree starting at the StartDirectory and going up until
* it reaches the HomeDirectory. * it reaches the HomeDirectory.
*/ */
void SetStartDirectory(const char* dir) void SetStartDirectory(const std::string& dir)
{ {
this->cmStartDirectory = dir; this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory); cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
@ -443,7 +444,7 @@ public:
{ {
return this->cmStartDirectory.c_str(); return this->cmStartDirectory.c_str();
} }
void SetStartOutputDirectory(const char* lib) void SetStartOutputDirectory(const std::string& lib)
{ {
this->StartOutputDirectory = lib; this->StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory); cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
@ -949,7 +950,8 @@ private:
bool ParseDefineFlag(std::string const& definition, bool remove); bool ParseDefineFlag(std::string const& definition, bool remove);
bool EnforceUniqueDir(const char* srcPath, const char* binPath) const; bool EnforceUniqueDir(const std::string& srcPath,
const std::string& binPath) const;
friend class cmMakeDepend; // make depend needs direct access friend class cmMakeDepend; // make depend needs direct access
// to the Sources array // to the Sources array