42 |
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
43 |
|
* ============================================================================ |
44 |
|
*/ |
45 |
< |
// Douglas Thrift's Search Engine Outputer |
45 |
> |
// Douglas Thrift's Search Engine Outputter |
46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// $Id: Outputer.h,v 1.5 2004/01/01 23:00:34 douglas Exp $ |
49 |
> |
// $Id$ |
50 |
|
|
51 |
< |
#ifndef _Outputer_h_ |
52 |
< |
#define _Outputer_h_ |
51 |
> |
#ifndef _Outputter_hpp_ |
52 |
> |
#define _Outputter_hpp_ |
53 |
|
|
54 |
< |
#include "Search.h" |
55 |
< |
#include "Searcher.h" |
54 |
> |
#include "Search.hpp" |
55 |
> |
#include "Searcher.hpp" |
56 |
|
|
57 |
< |
class Outputer |
57 |
> |
class Outputter |
58 |
|
{ |
59 |
|
private: |
60 |
< |
string headerFile; |
61 |
< |
string bodyFile; |
62 |
< |
string footerFile; |
63 |
< |
string notfoundFile; |
64 |
< |
string pagesFile; |
65 |
< |
bool query; |
66 |
< |
bool results; |
60 |
> |
string headerFile, bodyFile, footerFile, notfoundFile, pagesFile; |
61 |
> |
bool query, results; |
62 |
|
double time; |
63 |
|
vector<Ranker> webpages; |
64 |
< |
unsigned numWebpages; |
65 |
< |
unsigned numPages; |
66 |
< |
void header(const string& query, unsigned page, vector<string> common, bool |
67 |
< |
and_, bool or_, const string& ignore); |
64 |
> |
unsigned numWebpages, numPages; |
65 |
> |
void header(const string& query, unsigned page, |
66 |
> |
const vector<string>& common, bool and_, bool or_, |
67 |
> |
const string& ignore); |
68 |
|
void body(); |
69 |
< |
void footer(const string& query, unsigned page, vector<string> common, bool |
70 |
< |
and_, bool or_, const string& ignore); |
69 |
> |
void footer(const string& query, unsigned page, |
70 |
> |
const vector<string>& common, bool and_, bool or_, |
71 |
> |
const string& ignore); |
72 |
|
void notfound(const string& query, unsigned keywords); |
73 |
|
string pages(string query, unsigned page); |
74 |
|
string range(unsigned page); |
75 |
|
string total(); |
76 |
|
string duration(); |
77 |
< |
string manycommon(vector<string> common); |
77 |
> |
string manycommon(const vector<string>& common); |
78 |
|
void tag(string& line, char* tag, const string& replacement); |
79 |
|
void conditional(string& line, ifstream& fin, char* tag, bool condition); |
80 |
|
public: |
81 |
< |
Outputer(const string& headerFile, const string& bodyFile, const string& |
82 |
< |
footerFile, const string& notfoundFile, const string& pagesFile); |
83 |
< |
~Outputer() {} |
81 |
> |
Outputter(const string& headerFile, const string& bodyFile, |
82 |
> |
const string& footerFile, const string& notfoundFile, |
83 |
> |
const string& pagesFile) : headerFile(headerFile), bodyFile(bodyFile), |
84 |
> |
footerFile(footerFile), notfoundFile(notfoundFile), |
85 |
> |
pagesFile(pagesFile) {} |
86 |
> |
~Outputter() {} |
87 |
|
void output(Searcher& searcher, unsigned page); |
88 |
|
}; |
89 |
|
|
90 |
< |
#endif // _Outputer_h_ |
90 |
> |
#endif // _Outputter_hpp_ |