- Timestamp:
- 1999-08-13T16:20:27+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mggdbmsource.cpp
r350 r460 12 12 /* 13 13 $Log$ 14 Revision 1.13 1999/08/13 04:20:27 sjboddie 15 added ability to get return all available metadata when 'fields' is empty 16 14 17 Revision 1.12 1999/07/07 06:17:47 rjmcnab 15 18 broke search_index into index+subcollection+language … … 109 112 // get the filename for the database and make sure it exists 110 113 gdbm_filename = filename_cat(collectdir,"index","text",collection); 114 115 // temporary hack for niupepa 116 if (collection == "niupepa") 117 gdbm_filename = filename_cat(collectdir,"index.new","text",collection); 118 111 119 #ifdef _LITTLE_ENDIAN 112 120 gdbm_filename += ".ldb"; … … 207 215 } 208 216 217 // if fields array is empty we want to get all available metadata 218 text_tarray tfields = fields; 219 if (tfields.empty() && !info_array.empty()) { 220 infodbclass::iterator t_info = info_array[0].begin(); 221 infodbclass::iterator e_info = info_array[0].end(); 222 while (t_info != e_info) { 223 if ((*t_info).first != "contains") 224 tfields.push_back ((*t_info).first); 225 t_info ++; 226 } 227 tfields.push_back ("hasnext"); 228 tfields.push_back ("hasprevious"); 229 } 230 209 231 // collect together the metadata 210 232 bool donenextprevtest = false; … … 212 234 MetadataInfo_t this_metadata; 213 235 text_t *pos_metadata; 214 text_tarray::const_iterator fields_here = fields.begin();215 text_tarray::const_iterator fields_end = fields.end();236 text_tarray::const_iterator fields_here = tfields.begin(); 237 text_tarray::const_iterator fields_end = tfields.end(); 216 238 while (fields_here != fields_end) { 217 239 this_metadata.clear(); … … 266 288 267 289 // fill in metadata 290 this_metadata.name = *fields_here; 268 291 if ((*fields_here == "hasnext" && hasnext) || 269 292 (*fields_here == "hasprevious" && hasprevious)) … … 273 296 274 297 } 275 else if (pos_metadata != NULL && *fields_here != "contains") 298 else if (pos_metadata != NULL && *fields_here != "contains") { 299 this_metadata.name = *fields_here; 276 300 this_metadata.values.push_back(*pos_metadata); 277 else 301 } else { 302 this_metadata.name = *fields_here; 278 303 this_metadata.values.push_back(""); 279 304 } 280 305 281 306 this_info++;
Note:
See TracChangeset
for help on using the changeset viewer.