summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW/cmCPackIFWRepository.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWRepository.cxx')
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 45b47cd..fcb1c77 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -35,7 +35,7 @@
cmCPackIFWRepository::cmCPackIFWRepository()
: Update(None)
- , Generator(0)
+ , Generator(CM_NULLPTR)
{
}
@@ -45,16 +45,16 @@ bool cmCPackIFWRepository::IsValid() const
switch (Update) {
case None:
- valid = Url.empty() ? false : true;
+ valid = !Url.empty();
break;
case Add:
- valid = Url.empty() ? false : true;
+ valid = !Url.empty();
break;
case Remove:
- valid = Url.empty() ? false : true;
+ valid = !Url.empty();
break;
case Replace:
- valid = (OldUrl.empty() || NewUrl.empty()) ? false : true;
+ valid = !OldUrl.empty() && !NewUrl.empty();
break;
}
@@ -63,7 +63,7 @@ bool cmCPackIFWRepository::IsValid() const
const char* cmCPackIFWRepository::GetOption(const std::string& op) const
{
- return Generator ? Generator->GetOption(op) : 0;
+ return Generator ? Generator->GetOption(op) : CM_NULLPTR;
}
bool cmCPackIFWRepository::IsOn(const std::string& op) const
@@ -89,8 +89,9 @@ bool cmCPackIFWRepository::IsVersionEqual(const char* version)
bool cmCPackIFWRepository::ConfigureFromOptions()
{
// Name;
- if (Name.empty())
+ if (Name.empty()) {
return false;
+ }
std::string prefix =
"CPACK_IFW_REPOSITORY_" + cmsys::SystemTools::UpperCase(Name) + "_";
@@ -176,7 +177,7 @@ public:
bool patched;
protected:
- virtual void StartElement(const std::string& name, const char** atts)
+ void StartElement(const std::string& name, const char** atts) CM_OVERRIDE
{
xout.StartElement(name);
StartFragment(atts);
@@ -191,26 +192,29 @@ protected:
}
}
- virtual void EndElement(const std::string& name)
+ void EndElement(const std::string& name) CM_OVERRIDE
{
if (name == "Updates" && !patched) {
repository->WriteRepositoryUpdates(xout);
patched = true;
}
xout.EndElement();
- if (patched)
+ if (patched) {
return;
+ }
if (name == "Checksum") {
repository->WriteRepositoryUpdates(xout);
patched = true;
}
}
- virtual void CharacterDataHandler(const char* data, int length)
+ void CharacterDataHandler(const char* data, int length) CM_OVERRIDE
{
std::string content(data, data + length);
- if (content == "" || content == " " || content == " " || content == "\n")
+ if (content == "" || content == " " || content == " " ||
+ content == "\n") {
return;
+ }
xout.Content(content);
}
};
@@ -244,11 +248,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml()
fout.Close();
- if (!cmSystemTools::RenameFile(updatesPatchXml.data(), updatesXml.data())) {
- return false;
- }
-
- return true;
+ return cmSystemTools::RenameFile(updatesPatchXml.data(), updatesXml.data());
}
void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
@@ -336,6 +336,7 @@ void cmCPackIFWRepository::WriteRepositoryUpdates(cmXMLWriter& xout)
void cmCPackIFWRepository::WriteGeneratedByToStrim(cmXMLWriter& xout)
{
- if (Generator)
+ if (Generator) {
Generator->WriteGeneratedByToStrim(xout);
+ }
}