From acb116e3b52362b41988aa27eeb593dd2e7194c0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sun, 9 Feb 2014 23:07:44 -0500 Subject: stringapi: Return a string reference for the configuration --- Source/cmLocalNinjaGenerator.h | 4 ++-- Source/cmNinjaTargetGenerator.cxx | 2 +- Source/cmNinjaTargetGenerator.h | 2 +- Source/cmSourceFileLocation.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h index 8b26806..2d870fb 100644 --- a/Source/cmLocalNinjaGenerator.h +++ b/Source/cmLocalNinjaGenerator.h @@ -55,8 +55,8 @@ public: const cmake* GetCMakeInstance() const; cmake* GetCMakeInstance(); - const char* GetConfigName() const - { return this->ConfigName.c_str(); } + std::string const& GetConfigName() const + { return this->ConfigName; } /// @return whether we are processing the top CMakeLists.txt file. bool isRootMakefile() const; diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 1c43cb3..78ff4e4 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -91,7 +91,7 @@ cmGlobalNinjaGenerator* cmNinjaTargetGenerator::GetGlobalGenerator() const return this->LocalGenerator->GetGlobalNinjaGenerator(); } -const char* cmNinjaTargetGenerator::GetConfigName() const +std::string const& cmNinjaTargetGenerator::GetConfigName() const { return this->LocalGenerator->GetConfigName(); } diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index b3b37a4..c2e1947 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -65,7 +65,7 @@ protected: cmMakefile* GetMakefile() const { return this->Makefile; } - const char* GetConfigName() const; + std::string const& GetConfigName() const; std::string LanguageCompilerRule(const std::string& lang) const { return lang + "_COMPILER"; } diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h index 64b8c1f..c83e8c0 100644 --- a/Source/cmSourceFileLocation.h +++ b/Source/cmSourceFileLocation.h @@ -76,7 +76,7 @@ public: * final name (but could be). Otherwise the returned name is the * 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. -- cgit v0.12