diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Source/cmVisualStudioWCEPlatformParser.cxx | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2 |
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/cmVisualStudioWCEPlatformParser.cxx')
-rw-r--r-- | Source/cmVisualStudioWCEPlatformParser.cxx | 110 |
1 files changed, 39 insertions, 71 deletions
diff --git a/Source/cmVisualStudioWCEPlatformParser.cxx b/Source/cmVisualStudioWCEPlatformParser.cxx index b6ee754..4f5e7c0 100644 --- a/Source/cmVisualStudioWCEPlatformParser.cxx +++ b/Source/cmVisualStudioWCEPlatformParser.cxx @@ -21,15 +21,12 @@ int cmVisualStudioWCEPlatformParser::ParseVersion(const char* version) const std::string vckey = registryBase + "\\Setup\\VC;ProductDir"; const std::string vskey = registryBase + "\\Setup\\VS;ProductDir"; - if(!cmSystemTools::ReadRegistryValue(vckey.c_str(), - this->VcInstallDir, - cmSystemTools::KeyWOW64_32) || - !cmSystemTools::ReadRegistryValue(vskey.c_str(), - this->VsInstallDir, - cmSystemTools::KeyWOW64_32)) - { + if (!cmSystemTools::ReadRegistryValue(vckey.c_str(), this->VcInstallDir, + cmSystemTools::KeyWOW64_32) || + !cmSystemTools::ReadRegistryValue(vskey.c_str(), this->VsInstallDir, + cmSystemTools::KeyWOW64_32)) { return 0; - } + } cmSystemTools::ConvertToUnixSlashes(this->VcInstallDir); cmSystemTools::ConvertToUnixSlashes(this->VsInstallDir); this->VcInstallDir.append("/"); @@ -43,10 +40,9 @@ int cmVisualStudioWCEPlatformParser::ParseVersion(const char* version) std::string cmVisualStudioWCEPlatformParser::GetOSVersion() const { - if (this->OSMinorVersion.empty()) - { + if (this->OSMinorVersion.empty()) { return OSMajorVersion; - } + } return OSMajorVersion + "." + OSMinorVersion; } @@ -55,10 +51,9 @@ const char* cmVisualStudioWCEPlatformParser::GetArchitectureFamily() const { std::map<std::string, std::string>::const_iterator it = this->Macros.find("ARCHFAM"); - if (it != this->Macros.end()) - { + if (it != this->Macros.end()) { return it->second.c_str(); - } + } return 0; } @@ -66,98 +61,71 @@ const char* cmVisualStudioWCEPlatformParser::GetArchitectureFamily() const void cmVisualStudioWCEPlatformParser::StartElement(const std::string& name, const char** attributes) { - if(this->FoundRequiredName) - { + if (this->FoundRequiredName) { return; - } + } this->CharacterData = ""; - if(name == "PlatformData") - { + if (name == "PlatformData") { this->PlatformName = ""; this->OSMajorVersion = ""; this->OSMinorVersion = ""; this->Macros.clear(); - } + } - if(name == "Macro") - { + if (name == "Macro") { std::string macroName; std::string macroValue; - for(const char** attr = attributes; *attr; attr += 2) - { - if(strcmp(attr[0], "Name") == 0) - { + for (const char** attr = attributes; *attr; attr += 2) { + if (strcmp(attr[0], "Name") == 0) { macroName = attr[1]; - } - else if(strcmp(attr[0], "Value") == 0) - { + } else if (strcmp(attr[0], "Value") == 0) { macroValue = attr[1]; - } } + } - if(!macroName.empty()) - { + if (!macroName.empty()) { this->Macros[macroName] = macroValue; - } } - else if(name == "Directories") - { - for(const char** attr = attributes; *attr; attr += 2) - { - if(strcmp(attr[0], "Include") == 0) - { + } else if (name == "Directories") { + for (const char** attr = attributes; *attr; attr += 2) { + if (strcmp(attr[0], "Include") == 0) { this->Include = attr[1]; - } - else if(strcmp(attr[0], "Library") == 0) - { + } else if (strcmp(attr[0], "Library") == 0) { this->Library = attr[1]; - } - else if(strcmp(attr[0], "Path") == 0) - { + } else if (strcmp(attr[0], "Path") == 0) { this->Path = attr[1]; - } } } + } } void cmVisualStudioWCEPlatformParser::EndElement(const std::string& name) { - if(!this->RequiredName) - { - if(name == "PlatformName") - { + if (!this->RequiredName) { + if (name == "PlatformName") { this->AvailablePlatforms.push_back(this->CharacterData); - } - return; } + return; + } - if(this->FoundRequiredName) - { + if (this->FoundRequiredName) { return; - } + } - if(name == "PlatformName") - { + if (name == "PlatformName") { this->PlatformName = this->CharacterData; - } - else if(name == "OSMajorVersion") - { + } else if (name == "OSMajorVersion") { this->OSMajorVersion = this->CharacterData; - } - else if(name == "OSMinorVersion") - { - this->OSMinorVersion = this->CharacterData; - } - else if(name == "Platform") - { - if(this->PlatformName == this->RequiredName) - { + } else if (name == "OSMinorVersion") { + this->OSMinorVersion = this->CharacterData; + } else if (name == "Platform") { + if (this->PlatformName == this->RequiredName) { this->FoundRequiredName = true; - } } + } } void cmVisualStudioWCEPlatformParser::CharacterDataHandler(const char* data, @@ -167,7 +135,7 @@ void cmVisualStudioWCEPlatformParser::CharacterDataHandler(const char* data, } std::string cmVisualStudioWCEPlatformParser::FixPaths( - const std::string& paths) const + const std::string& paths) const { std::string ret = paths; cmSystemTools::ReplaceString(ret, "$(PATH)", "%PATH%"); |