stringapi: Use strings for cache paths as arguments

This commit is contained in:
Ben Boeckel 2014-02-07 15:34:39 -05:00 committed by Brad King
parent adcd812917
commit f3efa3cd16
4 changed files with 16 additions and 16 deletions

View File

@ -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<cmStdString> 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<cmStdString>& excludes,
std::set<cmStdString>& 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);

View File

@ -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<cmStdString>& excludes,
std::set<cmStdString>& 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;

View File

@ -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);

View File

@ -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();