Changeset 2459
- Timestamp:
- 2001-05-22T17:06:59+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/browseaction.cpp
r2456 r2459 30 30 browseaction::browseaction(){ 31 31 32 cerr<<"initialising browseaction"<<endl;32 //cerr<<"initialising browseaction"<<endl; 33 33 34 34 cgiarginfo arg_ainfo; … … 92 92 argsinfo.addarginfo (NULL, arg_ainfo); 93 93 94 cerr<<"constructor"<<endl;94 //cerr<<"constructor"<<endl; 95 95 } 96 96 … … 197 197 request.filterResultOptions = FROID | FRmetadata; 198 198 199 //set up querystring; 200 text_t newqstring = ""; 201 format_qstring(args["bft"],newqstring,args.getintarg("bt")); 202 199 //set up browse filter string; 200 if(!args["bft"].empty()){ 201 text_t bf_string = ""; 202 format_browsestring(args["bft"],bf_string,args.getintarg("bt")); 203 cout<<"F: "<<bf_string.getcstr()<<endl; 204 } 205 203 206 //check that there is a querystring 204 207 //if(!newqstring.empty()){ -
trunk/gsdl/src/recpt/browseactiontools.cpp
r2455 r2459 26 26 27 27 #include "browseactiontools.h" 28 #include <ctype.h> 28 29 29 void format_ qstring(text_t orig, text_t& formatted, int and_or)30 void format_browsestring(text_t orig, text_t& formatted, int and_or) 30 31 { 32 33 34 text_t conj = ""; 35 36 if(and_or == 0){ conj = " | "; } 37 else { conj = " & "; } 38 text_t::const_iterator here = orig.begin(); 39 text_t::const_iterator end = orig.end(); 40 41 //while not at the end of the filter string 42 while(here!=end){ 43 //if seeing text, add it to the formatted string 44 if(!isspace(*here)){ 45 formatted.push_back(*here); 46 here++; 47 } 48 //else, if seeing spaces, check that there is following text and add 49 //the ncessary conjugation if there is. 50 else if(isspace(*here)){ 51 while(isspace(*here) && here!=end) here++; 52 if(here!=end) formatted += conj; 53 } 54 } 31 55 32 56 } 33 57 34 void set_browsefilter_options(FilterRequest_t &request, text_t & querystring,58 void set_browsefilter_options(FilterRequest_t &request, text_t &browsestring, 35 59 cgiargsclass &args) 36 60 {
Note:
See TracChangeset
for help on using the changeset viewer.