From f3efa3cd160d9957437168627689720bb953bb2b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 7 Feb 2014 15:34:39 -0500 Subject: stringapi: Use strings for cache paths as arguments --- Source/cmCacheManager.cxx | 12 ++++++------ Source/cmCacheManager.h | 12 ++++++------ Source/cmMakefile.cxx | 4 ++-- Source/cmMakefile.h | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 7a71482..141fde5 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -82,12 +82,12 @@ 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 emptySet; @@ -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,7 +193,7 @@ void cmCacheManager::CleanCMakeFiles(const char* path) } } -bool cmCacheManager::LoadCache(const char* path, +bool cmCacheManager::LoadCache(const std::string& path, bool internal, std::set& excludes, std::set& includes) @@ -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"; @@ -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); diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index 7a61394..14cb1d9 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -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, + bool LoadCache(const std::string& path); + bool LoadCache(const std::string& path, bool internal); + bool LoadCache(const std::string& path, bool internal, std::set& excludes, std::set& 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; @@ -159,7 +159,7 @@ protected: ///! Get a cache entry object for a 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; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1df64dd..e059dd3 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2956,7 +2956,7 @@ cmMakefile::LexicalPushPop::~LexicalPushPop() this->Makefile->PopFunctionBlockerBarrier(this->ReportError); } -void cmMakefile::SetHomeDirectory(const char* dir) +void cmMakefile::SetHomeDirectory(const std::string& dir) { this->cmHomeDirectory = dir; cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory); @@ -2967,7 +2967,7 @@ void cmMakefile::SetHomeDirectory(const char* dir) } } -void cmMakefile::SetHomeOutputDirectory(const char* lib) +void cmMakefile::SetHomeOutputDirectory(const std::string& lib) { this->HomeOutputDirectory = lib; cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory); diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 4019372..4b9c548 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -401,12 +401,12 @@ public: * CMakeLists files by recursing up the tree starting at the StartDirectory * and going up until it reaches the HomeDirectory. */ - void SetHomeDirectory(const char* dir); + void SetHomeDirectory(const std::string& dir); const char* GetHomeDirectory() const { return this->cmHomeDirectory.c_str(); } - void SetHomeOutputDirectory(const char* lib); + void SetHomeOutputDirectory(const std::string& lib); const char* GetHomeOutputDirectory() const { return this->HomeOutputDirectory.c_str(); -- cgit v0.12