summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroup.cxx
diff options
context:
space:
mode:
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;
}