Changeset 11004


Ignore:
Timestamp:
2005-12-19T11:03:52+13:00 (18 years ago)
Author:
kjdon
Message:

get_phrases method moved to lib/phrases.h so colservr can share it

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/querytools.cpp

    r10995 r11004  
    262262}
    263263
    264 void get_phrases (const text_t &querystring, text_tarray &phrases) {
    265 
    266   phrases.erase (phrases.begin(), phrases.end());
    267   if (!querystring.empty()) {
    268    
    269     text_t::const_iterator end = querystring.end();
    270     text_t::const_iterator here = findchar (querystring.begin(), end, '"');
    271     if (here != end) {
    272       text_t tmptext;
    273       bool foundquote = false;
    274       while (here != end) {
    275     if (*here == '"') {
    276       if (foundquote) {
    277         if (!tmptext.empty()) {
    278           phrases.push_back(tmptext);
    279           tmptext.clear();
    280         }
    281         foundquote = false;
    282       } else foundquote = true;
    283     } else {
    284       if (foundquote) tmptext.push_back (*here);
    285     }
    286     ++here;
    287       }
    288     }
    289   }
    290 }
    291 
    292264// search history tool
    293265// also used for form query macros
  • trunk/gsdl/src/recpt/querytools.h

    r8357 r11004  
    4545           int startbc, int endbc, int ct);
    4646
    47 void get_phrases (const text_t &querystring, text_tarray &phrases);
    48 
    4947void add_ands(text_t& querystring, int querytype);
    5048
Note: See TracChangeset for help on using the changeset viewer.