stringapi: Return a string reference for the configuration

This commit is contained in:
Ben Boeckel 2014-02-09 23:07:44 -05:00 committed by Brad King
parent 84fdc9921c
commit acb116e3b5
4 changed files with 5 additions and 5 deletions

View File

@ -55,8 +55,8 @@ public:
const cmake* GetCMakeInstance() const; const cmake* GetCMakeInstance() const;
cmake* GetCMakeInstance(); cmake* GetCMakeInstance();
const char* GetConfigName() const std::string const& GetConfigName() const
{ return this->ConfigName.c_str(); } { return this->ConfigName; }
/// @return whether we are processing the top CMakeLists.txt file. /// @return whether we are processing the top CMakeLists.txt file.
bool isRootMakefile() const; bool isRootMakefile() const;

View File

@ -91,7 +91,7 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const
return this->LocalGenerator->GetGlobalNinjaGenerator(); return this->LocalGenerator->GetGlobalNinjaGenerator();
} }
const char* cmNinjaTargetGenerator::GetConfigName() const std::string const& cmNinjaTargetGenerator::GetConfigName() const
{ {
return this->LocalGenerator->GetConfigName(); return this->LocalGenerator->GetConfigName();
} }

View File

@ -65,7 +65,7 @@ protected:
cmMakefile* GetMakefile() const cmMakefile* GetMakefile() const
{ return this->Makefile; } { return this->Makefile; }
const char* GetConfigName() const; std::string const& GetConfigName() const;
std::string LanguageCompilerRule(const std::string& lang) const std::string LanguageCompilerRule(const std::string& lang) const
{ return lang + "_COMPILER"; } { return lang + "_COMPILER"; }

View File

@ -76,7 +76,7 @@ public:
* final name (but could be). Otherwise the returned name is the * final name (but could be). Otherwise the returned name is the
* final name. * final name.
*/ */
const char* GetName() const { return this->Name.c_str(); } const std::string& GetName() const { return this->Name; }
/** /**
* Get the cmMakefile instance for which the source file was created. * Get the cmMakefile instance for which the source file was created.