stringapi: Use strings for TryFullPath

This commit is contained in:
Ben Boeckel 2014-02-03 17:00:21 -05:00 committed by Brad King
parent 310ef08fed
commit 971eb4d56e
2 changed files with 6 additions and 5 deletions

View File

@ -164,7 +164,7 @@ bool cmSourceFile::FindFullPath(std::string* error)
} }
tryPath += this->Location.GetName(); tryPath += this->Location.GetName();
tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str(), *di); tryPath = cmSystemTools::CollapseFullPath(tryPath.c_str(), *di);
if(this->TryFullPath(tryPath.c_str(), 0)) if(this->TryFullPath(tryPath.c_str(), ""))
{ {
return true; return true;
} }
@ -217,10 +217,11 @@ bool cmSourceFile::FindFullPath(std::string* error)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmSourceFile::TryFullPath(const char* tp, const char* ext) bool cmSourceFile::TryFullPath(const std::string& path,
const std::string& ext)
{ {
std::string tryPath = tp; std::string tryPath = path;
if(ext && *ext) if(!ext.empty())
{ {
tryPath += "."; tryPath += ".";
tryPath += ext; tryPath += ext;

View File

@ -107,7 +107,7 @@ private:
bool FindFullPathFailed; bool FindFullPathFailed;
bool FindFullPath(std::string* error); bool FindFullPath(std::string* error);
bool TryFullPath(const char* tryPath, const char* ext); bool TryFullPath(const std::string& path, const std::string& ext);
void CheckExtension(); void CheckExtension();
void CheckLanguage(std::string const& ext); void CheckLanguage(std::string const& ext);