Changeset 472 for trunk/gsdl/src/colservr/filter.cpp
- Timestamp:
- 1999-08-25T16:50:00+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/filter.cpp
r398 r472 12 12 /* 13 13 $Log$ 14 Revision 1.7 1999/08/25 04:49:33 sjboddie 15 changed FilterRequest_t::docSet into an array 16 14 17 Revision 1.6 1999/07/16 03:42:23 sjboddie 15 18 changed isApprox … … 111 114 (request.filterResultOptions & FRmetadata)) { 112 115 // copy the OIDs from the request to the response 113 text_t set::const_iterator here = request.docSet.begin();114 text_t set::const_iterator end = request.docSet.end();116 text_tarray::const_iterator here = request.docSet.begin(); 117 text_tarray::const_iterator end = request.docSet.end(); 115 118 while (here != end) { 116 119 resultdoc.OID = (*here); … … 244 247 } 245 248 249 void intersect (text_tarray &set1, const text_tarray &set2) { 250 text_tarray resultset; 251 252 text_tarray::const_iterator set1_here = set1.begin(); 253 text_tarray::const_iterator set1_end = set1.end(); 254 255 while (set1_here != set1_end) { 256 if (in_set (set2, *set1_here)) 257 resultset.push_back (*set1_here); 258 set1_here ++; 259 } 260 set1 = resultset; 261 } 246 262 247 263 // tests to see if el is in set … … 267 283 return false; 268 284 } 285 286 bool in_set (const text_tarray &set1, const text_t &el) { 287 text_t::const_iterator here = el.begin(); 288 text_t::const_iterator end = el.begin(); 289 text_t tryel, tryel_add; 290 bool first = true; 291 292 // the element is in the set if any of its parents are 293 // in the set 294 do { 295 // get next possible element to try 296 here = getdelimitstr (here, end, '.', tryel_add); 297 if (!first) tryel += "."; 298 first = false; 299 tryel += tryel_add; 300 301 // see if this element is in the set 302 text_tarray::const_iterator here = set1.begin(); 303 text_tarray::const_iterator end = set1.end(); 304 while (here != end) { 305 if (*here == tryel) break; 306 here ++; 307 } 308 if (here != end) return true; 309 } while (here != end); 310 311 return false; 312 }
Note:
See TracChangeset
for help on using the changeset viewer.