diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-04 21:06:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:28 (GMT) |
commit | 3742bb0d324b971f63cc7e557b1cb8a9d08c5cdd (patch) | |
tree | 0259dae54801daae0f5823e335cc6b608328623d /Source/CPack | |
parent | ec97ed7d0c67b635caf3ada65541b2eaf0818a93 (diff) | |
download | CMake-3742bb0d324b971f63cc7e557b1cb8a9d08c5cdd.zip CMake-3742bb0d324b971f63cc7e557b1cb8a9d08c5cdd.tar.gz CMake-3742bb0d324b971f63cc7e557b1cb8a9d08c5cdd.tar.bz2 |
stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.h | 10 |
2 files changed, 10 insertions, 14 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index e1dd4e9..b46fd86 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -972,7 +972,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName) } //---------------------------------------------------------------------- -void cmCPackGenerator::SetOptionIfNotSet(const char* op, +void cmCPackGenerator::SetOptionIfNotSet(const std::string& op, const char* value) { const char* def = this->MakefileMap->GetDefinition(op); @@ -984,12 +984,8 @@ void cmCPackGenerator::SetOptionIfNotSet(const char* op, } //---------------------------------------------------------------------- -void cmCPackGenerator::SetOption(const char* op, const char* value) +void cmCPackGenerator::SetOption(const std::string& op, const char* value) { - if ( !op ) - { - return; - } if ( !value ) { this->MakefileMap->RemoveDefinition(op); @@ -1176,19 +1172,19 @@ int cmCPackGenerator::InitializeInternal() } //---------------------------------------------------------------------- -bool cmCPackGenerator::IsSet(const char* name) const +bool cmCPackGenerator::IsSet(const std::string& name) const { return this->MakefileMap->IsSet(name); } //---------------------------------------------------------------------- -bool cmCPackGenerator::IsOn(const char* name) const +bool cmCPackGenerator::IsOn(const std::string& name) const { return cmSystemTools::IsOn(GetOption(name)); } //---------------------------------------------------------------------- -const char* cmCPackGenerator::GetOption(const char* op) const +const char* cmCPackGenerator::GetOption(const std::string& op) const { const char* ret = this->MakefileMap->GetDefinition(op); if(!ret) diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index b1a7840..39ef64d 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -99,12 +99,12 @@ public: virtual ~cmCPackGenerator(); //! Set and get the options - void SetOption(const char* op, const char* value); - void SetOptionIfNotSet(const char* op, const char* value); - const char* GetOption(const char* op) const; + void SetOption(const std::string& op, const char* value); + void SetOptionIfNotSet(const std::string& op, const char* value); + const char* GetOption(const std::string& op) const; std::vector<std::string> GetOptions() const; - bool IsSet(const char* name) const; - bool IsOn(const char* name) const; + bool IsSet(const std::string& name) const; + bool IsOn(const std::string& name) const; //! Set the logger void SetLogger(cmCPackLog* log) { this->Logger = log; } |