ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/Outputter.cpp
(Generate patch)

Comparing trunk/Search/Outputter.cpp (file contents):
Revision 364 by Douglas Thrift, 2004-05-30T22:03:07-07:00 vs.
Revision 365 by douglas, 2008-08-11T15:16:35-07:00

# Line 50 | Line 50
50  
51   #include "Outputter.hpp"
52  
53 < void Outputter::output(Searcher& searcher, unsigned page)
53 > void Outputter::output(Searcher& searcher, size_t page)
54   {
55          MultiSet pagesSet(searcher.getPages());
56 <        
56 >
57          numWebpages = pagesSet.size();
58          numPages = (numWebpages + 9) / 10;
59  
# Line 100 | Line 100 | void Outputter::output(Searcher& searche
100          footer(query, page, common, searcher.getAnd(), searcher.getOr(), ignore);
101   }
102  
103 < void Outputter::header(const string& query, unsigned page, const vector<string>&
103 > void Outputter::header(const string& query, size_t page, const vector<string>&
104          common, bool and_, bool or_, const string& ignore)
105   {
106          ifstream fin(headerFile.c_str());
# Line 189 | Line 189 | void Outputter::body()
189          }
190   }
191  
192 < void Outputter::footer(const string& query, unsigned page, const vector<string>&
192 > void Outputter::footer(const string& query, size_t page, const vector<string>&
193          common, bool and_, bool or_, const string& ignore)
194   {
195          ifstream fin(footerFile.c_str());
# Line 227 | Line 227 | void Outputter::footer(const string& que
227          fin.close();
228   }
229  
230 < void Outputter::notfound(const string& query, unsigned keywords)
230 > void Outputter::notfound(const string& query, size_t keywords)
231   {
232          ifstream fin(notfoundFile.c_str());
233          string line;
# Line 244 | Line 244 | void Outputter::notfound(const string& q
244          fin.close();
245   }
246  
247 < string Outputter::pages(string query, unsigned page)
247 > string Outputter::pages(string query, size_t page)
248   {
249          entities(query, "&lt;", '<');
250          entities(query, "&gt;", '>');
# Line 302 | Line 302 | string Outputter::pages(string query, un
302          fin.close();
303          fin.clear();
304  
305 <        for (unsigned index(0); index < numPages; index++)
305 >        for (size_t index(0); index < numPages; index++)
306          {
307                  fin.open(pagesFile.c_str());
308  
# Line 370 | Line 370 | string Outputter::pages(string query, un
370          return lines;
371   }
372  
373 < string Outputter::range(unsigned page)
373 > string Outputter::range(size_t page)
374   {
375 <        unsigned bottom(page * 10 + 1), top(numWebpages > page * 10 + 10 ? page *
375 >        size_t bottom(page * 10 + 1), top(numWebpages > page * 10 + 10 ? page *
376                  10 + 10 : numWebpages);
377          ostringstream range;
378  
# Line 416 | Line 416 | string Outputter::manycommon(const vecto
416          return line;
417   }
418  
419 < void Outputter::tag(string& line, char* tag, const string& replacement)
419 > void Outputter::tag(string& line, const char* tag, const string& replacement)
420   {
421          size_t begin(0);
422  
# Line 434 | Line 434 | void Outputter::tag(string& line, char*
434          }
435   }
436  
437 < void Outputter::conditional(string& line, ifstream& fin, char* tag, bool
437 > void Outputter::conditional(string& line, ifstream& fin, const char* tag, bool
438          condition)
439   {
440 <        unsigned begin(0);
440 >        size_t begin(0);
441  
442          while (begin < line.length())
443          {
444 <                unsigned start(line.find(tag, begin)), finish(line.find("<?endif?>",
444 >                size_t start(line.find(tag, begin)), finish(line.find("<?endif?>",
445                          start));
446  
447                  if (start == string::npos) break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines