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

Comparing trunk/Search/Outputer.cpp (file contents):
Revision 28 by douglas, 2003-01-02T19:42:33-08:00 vs.
Revision 205 by douglas, 2003-07-17T00:03:08-07:00

# Line 46 | Line 46
46   //
47   // Douglas Thrift
48   //
49 < // Outputer.cpp
49 > // $Id: Outputer.cpp,v 1.8 2003/07/17 07:03:08 douglas Exp $
50  
51   #include "Outputer.h"
52  
# Line 86 | Line 86 | void Outputer::output(Searcher& searcher
86  
87          if (debug)
88          {
89 <                cerr << "query = " << (this->query ? "true" : "false") << "\n"
90 <                        << "results = " << (results ? "true" : "false") << "\n"
89 >                cerr << "query = " << this->query << "\n"
90 >                        << "results = " << results << "\n"
91                          << "time = " << duration() << "\n";
92          }
93  
# Line 132 | Line 132 | void Outputer::header(const string& quer
132                  conditional(line, fin, "<?ifcommon?>", common.size() == 1);
133                  conditional(line, fin, "<?ifmanycommon?>", common.size() > 1);
134  
135 +                tag(line, "<?version?>", programName + ' ' + programVersion + ' ' +
136 +                        platform());
137                  tag(line, "<?query?>", query);
138                  tag(line, "<?range?>", range(page));
139                  tag(line, "<?total?>", total());
# Line 141 | Line 143 | void Outputer::header(const string& quer
143                  tag(line, "<?common?>", common[0]);
144                  tag(line, "<?manycommon?>", manycommon(common));
145  
146 <                cout << line << "\n";
146 >                cout << line << (fin.good() ? "\n" : "");
147          }
148  
149          fin.close();
# Line 192 | Line 194 | void Outputer::body()
194                          tag(line, "<?description?>", description);
195                          tag(line, "<?size?>", size);
196  
197 <                        cout << line << "\n";
197 >                        cout << line << (fin.good() ? "\n" : "");
198                  }
199  
200                  fin.close();
# Line 217 | Line 219 | void Outputer::footer(const string& quer
219                  conditional(line, fin, "<?ifcommon?>", common.size() == 1);
220                  conditional(line, fin, "<?ifmanycommon?>", common.size() > 1);
221  
222 + #ifndef _OpenSSL_
223 +                tag(line, "<?version?>", programName + ' ' + programVersion + ' ' +
224 +                        platform());
225 + #else
226 +                tag(line, "<?version?>", programName + ' ' + programVersion + ' ' +
227 +                        platform() + ' ' + openssl());
228 + #endif
229                  tag(line, "<?query?>", query);
230                  tag(line, "<?range?>", range(page));
231                  tag(line, "<?total?>", total());
# Line 226 | Line 235 | void Outputer::footer(const string& quer
235                  tag(line, "<?common?>", common[0]);
236                  tag(line, "<?manycommon?>", manycommon(common));
237  
238 <                cout << line << "\n";
238 >                cout << line << (fin.good() ? "\n" : "");
239          }
240  
241          fin.close();
# Line 245 | Line 254 | void Outputer::notfound(const string& qu
254  
255                  tag(line, "<?query?>", query);
256  
257 <                cout << line << "\n";
257 >                cout << line << (fin.good() ? "\n" : "");
258          }
259  
260          fin.close();
# Line 310 | Line 319 | string Outputer::pages(string query, uns
319                  tag(line, "<?query?>", query);
320                  tag(line, "<?previous?>", previous);
321  
322 <                lines += line + "\n";
322 >                lines += line + (fin.good() ? "\n" : "");
323          }
324  
325          fin.close();
# Line 359 | Line 368 | string Outputer::pages(string query, uns
368                                  tag(line, "<?num?>", num);
369                          }
370  
371 <                        lines += line + "\n";
371 >                        lines += line + (fin.good() ? "\n" : "");
372                  }
373  
374                  fin.close();
# Line 387 | Line 396 | string Outputer::pages(string query, uns
396                  tag(line, "<?query?>", query);
397                  tag(line, "<?next?>", next);
398  
399 <                lines += line + "\n";
399 >                lines += line + (fin.good() ? "\n" : "");
400          }
401  
402          fin.close();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines