summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroup.cxx
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2016-05-16 14:34:04 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-16 20:05:19 (GMT)
commitd9fd2f5402eeaa345691313658e02b51038f570b (patch)
treedca71b9a7e267f4c6300da3eb770415381726785 /Source/cmSourceGroup.cxx
parent82df6deaafb36cbbfd450202bb20b320f637751a (diff)
downloadCMake-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/cmSourceGroup.cxx')
-rw-r--r--Source/cmSourceGroup.cxx70
1 files changed, 28 insertions, 42 deletions
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 34b4315..c09d596 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -18,15 +18,15 @@ public:
};
cmSourceGroup::cmSourceGroup(const char* name, const char* regex,
- const char* parentName): Name(name)
+ const char* parentName)
+ : Name(name)
{
this->Internal = new cmSourceGroupInternals;
this->SetGroupRegex(regex);
- if(parentName)
- {
+ if (parentName) {
this->FullName = parentName;
this->FullName += "\\";
- }
+ }
this->FullName += this->Name;
}
@@ -57,14 +57,11 @@ cmSourceGroup& cmSourceGroup::operator=(cmSourceGroup const& r)
void cmSourceGroup::SetGroupRegex(const char* regex)
{
- if(regex)
- {
+ if (regex) {
this->GroupRegex.compile(regex);
- }
- else
- {
+ } else {
this->GroupRegex.compile("^$");
- }
+ }
}
void cmSourceGroup::AddGroupFile(const std::string& name)
@@ -90,10 +87,9 @@ bool cmSourceGroup::MatchesRegex(const char* name)
bool cmSourceGroup::MatchesFiles(const char* name)
{
std::set<std::string>::const_iterator i = this->GroupFiles.find(name);
- if(i != this->GroupFiles.end())
- {
+ if (i != this->GroupFiles.end()) {
return true;
- }
+ }
return false;
}
@@ -112,7 +108,7 @@ void cmSourceGroup::AddChild(cmSourceGroup child)
this->Internal->GroupChildren.push_back(child);
}
-cmSourceGroup *cmSourceGroup::LookupChild(const char* name) const
+cmSourceGroup* cmSourceGroup::LookupChild(const char* name) const
{
// initializing iterators
std::vector<cmSourceGroup>::const_iterator iter =
@@ -121,22 +117,20 @@ cmSourceGroup *cmSourceGroup::LookupChild(const char* name) const
this->Internal->GroupChildren.end();
// st
- for(;iter!=end; ++iter)
- {
+ for (; iter != end; ++iter) {
std::string sgName = iter->GetName();
// look if descenened is the one were looking for
- if(sgName == name)
- {
+ if (sgName == name) {
return const_cast<cmSourceGroup*>(&(*iter)); // if it so return it
- }
}
+ }
// if no child with this name was found return NULL
return NULL;
}
-cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name)
+cmSourceGroup* cmSourceGroup::MatchChildrenFiles(const char* name)
{
// initializing iterators
std::vector<cmSourceGroup>::iterator iter =
@@ -144,23 +138,19 @@ cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name)
std::vector<cmSourceGroup>::iterator end =
this->Internal->GroupChildren.end();
- if(this->MatchesFiles(name))
- {
+ if (this->MatchesFiles(name)) {
return this;
- }
- for(;iter!=end;++iter)
- {
- cmSourceGroup *result = iter->MatchChildrenFiles(name);
- if(result)
- {
+ }
+ for (; iter != end; ++iter) {
+ cmSourceGroup* result = iter->MatchChildrenFiles(name);
+ if (result) {
return result;
- }
}
+ }
return 0;
}
-
-cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name)
+cmSourceGroup* cmSourceGroup::MatchChildrenRegex(const char* name)
{
// initializing iterators
std::vector<cmSourceGroup>::iterator iter =
@@ -168,24 +158,20 @@ cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name)
std::vector<cmSourceGroup>::iterator end =
this->Internal->GroupChildren.end();
- for(;iter!=end; ++iter)
- {
- cmSourceGroup *result = iter->MatchChildrenRegex(name);
- if(result)
- {
+ for (; iter != end; ++iter) {
+ cmSourceGroup* result = iter->MatchChildrenRegex(name);
+ if (result) {
return result;
- }
}
- if(this->MatchesRegex(name))
- {
+ }
+ if (this->MatchesRegex(name)) {
return this;
- }
+ }
return 0;
}
-std::vector<cmSourceGroup> const&
-cmSourceGroup::GetGroupChildren() const
+std::vector<cmSourceGroup> const& cmSourceGroup::GetGroupChildren() const
{
return this->Internal->GroupChildren;
}