Changeset 472 for trunk/gsdl/src
- Timestamp:
- 1999-08-25T16:50:00+12:00 (25 years ago)
- Location:
- trunk/gsdl/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/collectserver.cpp
r466 r472 13 13 /* 14 14 $Log$ 15 Revision 1.13 1999/08/25 04:50:00 sjboddie 16 changed FilterRequest_t::docSet into an array 17 15 18 Revision 1.12 1999/08/20 01:05:41 sjboddie 16 19 fixed a bug (or created another one) … … 199 202 // translate any ".fc", ".pr" etc. stuff in the docSet 200 203 text_t translatedOID; 201 text_t settranslatedOIDs;202 text_t set::iterator doc_here = request.docSet.begin();203 text_t set::iterator doc_end = request.docSet.end();204 text_tarray translatedOIDs; 205 text_tarray::iterator doc_here = request.docSet.begin(); 206 text_tarray::iterator doc_end = request.docSet.end(); 204 207 while (doc_here != doc_end) { 205 208 if (needs_translating (*doc_here)) { … … 215 218 source_here++; 216 219 } 217 translatedOIDs. insert(translatedOID);220 translatedOIDs.push_back (translatedOID); 218 221 } else { 219 translatedOIDs. insert(*doc_here);222 translatedOIDs.push_back (*doc_here); 220 223 } 221 224 doc_here ++; -
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 } -
trunk/gsdl/src/colservr/filter.h
r249 r472 113 113 void intersect (text_tset &set1, const text_tset &set2); 114 114 void intersect (text_tarray &set1, const text_tset &set2); 115 void intersect (text_tarray &set1, const text_tarray &set2); 115 116 116 117 // tests to see if el is in set 117 118 bool in_set (const text_tset &set1, const text_t &el); 119 bool in_set (const text_tarray &set1, const text_t &el); 118 120 119 121 #endif -
trunk/gsdl/src/recpt/OIDtools.cpp
r445 r472 12 12 /* 13 13 $Log$ 14 Revision 1.14 1999/08/25 04:45:25 sjboddie 15 changed FilterRequest_t::docSet into an array 16 14 17 Revision 1.13 1999/08/10 22:44:06 sjboddie 15 18 altered the get_contents function so it's now passed metadata … … 115 118 bool get_info (const text_t &OID, const text_t &collection, 116 119 const text_tarray &metadata, bool getParents, 117 recptproto *collectproto, FilterResponse_t &response,120 recptproto *collectproto, FilterResponse_t &response, 118 121 ostream &logout) { 119 122 … … 127 130 request.getParents = getParents; 128 131 request.fields = metadata; 129 request.docSet. insert(OID);132 request.docSet.push_back (OID); 130 133 131 134 collectproto->filter (collection, request, response, err, logout); … … 143 146 bool get_info (const text_tarray &OIDs, const text_t &collection, 144 147 const text_tarray &metadata, bool getParents, 145 recptproto *collectproto, FilterResponse_t &response,148 recptproto *collectproto, FilterResponse_t &response, 146 149 ostream &logout) { 147 150 … … 157 160 request.fields = metadata; 158 161 159 text_tarray::const_iterator thisOID = OIDs.begin(); 160 text_tarray::const_iterator endOID = OIDs.end(); 161 while (thisOID != endOID) { 162 request.docSet.insert (*thisOID); 163 thisOID ++; 164 } 162 request.docSet = OIDs; 165 163 166 164 collectproto->filter (collection, request, response, err, logout); -
trunk/gsdl/src/recpt/OIDtools.h
r445 r472 37 37 bool get_info (const text_tarray &OIDs, const text_t &collection, 38 38 const text_tarray &metadata, bool getParents, 39 recptproto *collectproto, FilterResponse_t &response,39 recptproto *collectproto, FilterResponse_t &response, 40 40 ostream &logout); 41 41 -
trunk/gsdl/src/recpt/comtypes.h
r459 r472 209 209 text_t filterName; 210 210 OptionValue_tarray filterOptions; 211 text_t setdocSet; // empty if not used211 text_tarray docSet; // empty if not used 212 212 int filterResultOptions; // use the FR* defines above 213 213
Note:
See TracChangeset
for help on using the changeset viewer.