diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-22 00:05:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:37 (GMT) |
commit | b3bf31a5488a19ea3c357e346b882a2ca84c63b6 (patch) | |
tree | 42cb81b5ec3c7888ef4f75e68f767f3992c4ec4f /Source/CTest/cmCTestHG.cxx | |
parent | 5af95c396dc780c04444f549b957c2cba7c75309 (diff) | |
download | CMake-b3bf31a5488a19ea3c357e346b882a2ca84c63b6.zip CMake-b3bf31a5488a19ea3c357e346b882a2ca84c63b6.tar.gz CMake-b3bf31a5488a19ea3c357e346b882a2ca84c63b6.tar.bz2 |
stringapi: Miscellaneous char* parameters
Diffstat (limited to 'Source/CTest/cmCTestHG.cxx')
-rw-r--r-- | Source/CTest/cmCTestHG.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx index 5bf9949..0f79d68 100644 --- a/Source/CTest/cmCTestHG.cxx +++ b/Source/CTest/cmCTestHG.cxx @@ -189,10 +189,10 @@ private: return true; } - virtual void StartElement(const char* name, const char** atts) + virtual void StartElement(const std::string& name, const char** atts) { this->CData.clear(); - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->Rev = Revision(); if(const char* rev = this->FindAttribute(atts, "revision")) @@ -208,29 +208,29 @@ private: this->CData.insert(this->CData.end(), data, data+length); } - virtual void EndElement(const char* name) + virtual void EndElement(const std::string& name) { - if(strcmp(name, "logentry") == 0) + if(name == "logentry") { this->HG->DoRevision(this->Rev, this->Changes); } - else if(strcmp(name, "author") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "author") { this->Rev.Author.assign(&this->CData[0], this->CData.size()); } - else if ( strcmp(name, "email") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "email") { this->Rev.EMail.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "date") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "date") { this->Rev.Date.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "msg") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "msg") { this->Rev.Log.assign(&this->CData[0], this->CData.size()); } - else if(strcmp(name, "files") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "files") { std::vector<std::string> paths = this->SplitCData(); for(unsigned int i = 0; i < paths.size(); ++i) @@ -242,7 +242,7 @@ private: this->Changes.push_back(this->CurChange); } } - else if(strcmp(name, "file_adds") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "file_adds") { std::string added_paths(this->CData.begin(), this->CData.end()); for(unsigned int i = 0; i < this->Changes.size(); ++i) @@ -253,7 +253,7 @@ private: } } } - else if(strcmp(name, "file_dels") == 0 && !this->CData.empty()) + else if(!this->CData.empty() && name == "file_dels") { std::string added_paths(this->CData.begin(), this->CData.end()); for(unsigned int i = 0; i < this->Changes.size(); ++i) |