1 |
|
/* ============================================================================ |
2 |
|
* Douglas Thrift's Search Engine License |
3 |
|
* |
4 |
< |
* Copyright (C) 2002, Douglas Thrift. All Rights Reserved. |
4 |
> |
* Copyright (C) 2002-2004, Douglas Thrift. All Rights Reserved. |
5 |
|
* Redistribution and use in source and binary forms, with or without |
6 |
|
* modification, are permitted provided that the following conditions are met: |
7 |
|
* |
46 |
|
// |
47 |
|
// Douglas Thrift |
48 |
|
// |
49 |
< |
// Page.h |
49 |
> |
// $Id$ |
50 |
|
|
51 |
< |
#ifndef _Page_h_ |
52 |
< |
#define _Page_h_ |
51 |
> |
#ifndef _Page_hpp_ |
52 |
> |
#define _Page_hpp_ |
53 |
|
|
54 |
< |
#include "Search.h" |
55 |
< |
#include "URL.h" |
54 |
> |
#include "Search.hpp" |
55 |
> |
#include "URL.hpp" |
56 |
|
|
57 |
|
class Page : public URL |
58 |
|
{ |
59 |
|
private: |
60 |
|
unsigned size; |
61 |
< |
string title; |
62 |
< |
string description; |
63 |
< |
string text; |
61 |
> |
string title, description, text; |
62 |
|
vector<string> headings; |
63 |
|
public: |
64 |
< |
Page() { size = 0; } |
65 |
< |
Page(string& url); |
64 |
> |
Page() : size(0) {} |
65 |
> |
Page(string& url) : URL(url), size(0) {} |
66 |
|
~Page() {} |
67 |
< |
unsigned getSize() { return size; } |
68 |
< |
virtual string getTitle() { return title; } |
69 |
< |
virtual string getDescription() { return description; } |
70 |
< |
string getText() { return text; } |
71 |
< |
vector<string> getHeadings() { return headings; } |
72 |
< |
void setSize(unsigned size); |
73 |
< |
void setTitle(string& title); |
74 |
< |
void setDescription(string& description); |
75 |
< |
void setText(string& text); |
76 |
< |
void setHeadings(vector<string>& headings); |
67 |
> |
unsigned getSize() const { return size; } |
68 |
> |
virtual const string& getTitle() const { return title; } |
69 |
> |
virtual const string& getDescription() const { return description; } |
70 |
> |
const string& getText() const { return text; } |
71 |
> |
const vector<string>& getHeadings() const { return headings; } |
72 |
> |
void setSize(unsigned size) { this->size = size; } |
73 |
> |
void setTitle(const string& title) { this->title = title; } |
74 |
> |
void setDescription(const string& description) |
75 |
> |
{ this->description = description; } |
76 |
> |
void setText(const string& text) { this->text = text; } |
77 |
> |
void setHeadings(const vector<string>& headings) |
78 |
> |
{ this->headings = headings; } |
79 |
|
// friends: |
80 |
|
friend istream& operator>>(istream& is, Page& data); |
81 |
|
friend ostream& operator<<(ostream& os, Page& data); |
82 |
|
}; |
83 |
|
|
84 |
< |
#endif // _Page_h_ |
84 |
> |
#endif // _Page_hpp_ |