1 |
// Site Mapper |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#ifndef _Page_hpp_ |
8 |
#define _Page_hpp_ |
9 |
|
10 |
#include "SiteMapper.hpp" |
11 |
|
12 |
class Page |
13 |
{ |
14 |
private: |
15 |
string address; |
16 |
string path; |
17 |
string title; |
18 |
vector<Page> children; |
19 |
public: |
20 |
Page(const string& address, const string& path, const string& title); |
21 |
Page(const string& url); |
22 |
~Page() {} |
23 |
string getAddress(void) const { return address; } |
24 |
string getPath(void) const { return path; } |
25 |
string getTitle(void) const { return title; } |
26 |
vector<Page> getChildren(void) const { return children; } |
27 |
string getUrl(void) const { return "http://" + address + path; } |
28 |
void setAddress(const string& address) { this->address = address; } |
29 |
void setPath(const string& path) { this->path = path; } |
30 |
void setTitle(const string& title) { this->title = title; } |
31 |
void setChildren(vector<Page>& children) { this->children = children; } |
32 |
void setUrl(const string& url); |
33 |
bool operator==(const string& thing) const; |
34 |
bool operator==(const Page& page) const; |
35 |
bool operator!=(const string& thing) const; |
36 |
bool operator!=(const Page& page) const; |
37 |
bool operator<(const Page& page) const; |
38 |
bool operator>(const Page& page) const; |
39 |
// friends: |
40 |
friend bool operator==(const string& thing, const Page& page) { return page |
41 |
== thing; } |
42 |
friend bool operator!=(const string& thing, const Page& page) { return page |
43 |
== thing; } |
44 |
}; |
45 |
|
46 |
#endif // _Page_hpp_ |