| 137 | } |
| 138 | |
| 139 | bool Collection::matchesGeomString(const string& geom) const |
| 140 | { |
| 141 | if (geomStringsMatch(getActiveExcludeGeom(), geom, true)) |
| 142 | { |
| 143 | return false; |
| 144 | } |
| 145 | if (geomStringsMatch(getActiveIncludeGeom(), geom)) |
| 146 | { |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | std::set<CollectionPtr> includedSet; |
| 151 | vector<CollectionPtr> includedVec = getIncludeCollections(); |
| 152 | for (size_t i = 0; i < includedVec.size(); i++) |
| 153 | { |
| 154 | CollectionPtr collection = includedVec[i]; |
| 155 | if (includedSet.count(collection)) |
| 156 | { |
| 157 | throw ExceptionFoundCycle("Encountered a cycle in collection: " + getName()); |
| 158 | } |
| 159 | includedSet.insert(collection); |
| 160 | vector<CollectionPtr> appendVec = collection->getIncludeCollections(); |
| 161 | includedVec.insert(includedVec.end(), appendVec.begin(), appendVec.end()); |
| 162 | } |
| 163 | for (ConstCollectionPtr collection : includedSet) |
| 164 | { |
| 165 | if (collection->matchesGeomString(geom)) |
| 166 | { |
| 167 | return true; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | return false; |
| 172 | } |
| 173 | |
| 174 | bool Collection::validate(string* message) const |
| 175 | { |
no test coverage detected