diff options
author | Brad King <brad.king@kitware.com> | 2008-05-16 20:56:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-05-16 20:56:41 (GMT) |
commit | 10db44a81d7be2ebd93c7fb1b70883d62c421723 (patch) | |
tree | ddb8cae9ff9eb79733d7eb54b5fc8b1d637e0903 /Source/cmSourceGroup.cxx | |
parent | f43748e1dd656a4b9c5f2d59ece64618a51efba5 (diff) | |
download | CMake-10db44a81d7be2ebd93c7fb1b70883d62c421723.zip CMake-10db44a81d7be2ebd93c7fb1b70883d62c421723.tar.gz CMake-10db44a81d7be2ebd93c7fb1b70883d62c421723.tar.bz2 |
COMP: Fix build with concept checking of STL.
- Fix cmSourceGroup to not use std::vector with an incomplete type.
Diffstat (limited to 'Source/cmSourceGroup.cxx')
-rw-r--r-- | Source/cmSourceGroup.cxx | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index f98eeef..d64ba3e 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -16,13 +16,47 @@ =========================================================================*/ #include "cmSourceGroup.h" +class cmSourceGroupInternals +{ +public: + std::vector<cmSourceGroup> GroupChildren; +}; + //---------------------------------------------------------------------------- cmSourceGroup::cmSourceGroup(const char* name, const char* regex): Name(name) { + this->Internal = new cmSourceGroupInternals; this->SetGroupRegex(regex); } //---------------------------------------------------------------------------- +cmSourceGroup::~cmSourceGroup() +{ + delete this->Internal; +} + +//---------------------------------------------------------------------------- +cmSourceGroup::cmSourceGroup(cmSourceGroup const& r) +{ + this->Name = r.Name; + this->GroupRegex = r.GroupRegex; + this->GroupFiles = r.GroupFiles; + this->SourceFiles = r.SourceFiles; + this->Internal = new cmSourceGroupInternals(*r.Internal); +} + +//---------------------------------------------------------------------------- +cmSourceGroup& cmSourceGroup::operator=(cmSourceGroup const& r) +{ + this->Name = r.Name; + this->GroupRegex = r.GroupRegex; + this->GroupFiles = r.GroupFiles; + this->SourceFiles = r.SourceFiles; + *(this->Internal) = *(r.Internal); + return *this; +} + +//---------------------------------------------------------------------------- void cmSourceGroup::SetGroupRegex(const char* regex) { if(regex) @@ -85,15 +119,17 @@ std::vector<const cmSourceFile*>& cmSourceGroup::GetSourceFiles() //---------------------------------------------------------------------------- void cmSourceGroup::AddChild(cmSourceGroup child) { - this->GroupChildren.push_back(child); + this->Internal->GroupChildren.push_back(child); } //---------------------------------------------------------------------------- cmSourceGroup *cmSourceGroup::lookupChild(const char* name) { // initializing iterators - std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin(); - std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end(); + std::vector<cmSourceGroup>::iterator iter = + this->Internal->GroupChildren.begin(); + std::vector<cmSourceGroup>::iterator end = + this->Internal->GroupChildren.end(); // st for(;iter!=end; ++iter) @@ -114,8 +150,10 @@ cmSourceGroup *cmSourceGroup::lookupChild(const char* name) cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name) { // initializing iterators - std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin(); - std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end(); + std::vector<cmSourceGroup>::iterator iter = + this->Internal->GroupChildren.begin(); + std::vector<cmSourceGroup>::iterator end = + this->Internal->GroupChildren.end(); if(this->MatchesFiles(name)) { @@ -136,8 +174,10 @@ cmSourceGroup *cmSourceGroup::MatchChildrenFiles(const char *name) cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name) { // initializing iterators - std::vector<cmSourceGroup>::iterator iter = this->GroupChildren.begin(); - std::vector<cmSourceGroup>::iterator end = this->GroupChildren.end(); + std::vector<cmSourceGroup>::iterator iter = + this->Internal->GroupChildren.begin(); + std::vector<cmSourceGroup>::iterator end = + this->Internal->GroupChildren.end(); if(this->MatchesRegex(name)) { @@ -154,7 +194,8 @@ cmSourceGroup *cmSourceGroup::MatchChildrenRegex(const char *name) return 0; } -std::vector<cmSourceGroup> cmSourceGroup::GetGroupChildren() const +std::vector<cmSourceGroup> const& +cmSourceGroup::GetGroupChildren() const { - return this->GroupChildren; + return this->Internal->GroupChildren; } |