1 |
Douglas Thrift |
128 |
// 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 |
Douglas Thrift |
129 |
string& getAddress(void) { return address; } |
24 |
|
|
string& getPath(void) { return path; } |
25 |
|
|
string& getTitle(void) { return title; } |
26 |
|
|
vector<Page>& getChildren(void) { return children; } |
27 |
|
|
string getUrl(void) { return "http://" + address + path; } |
28 |
Douglas Thrift |
128 |
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 |
Douglas Thrift |
129 |
bool operator==(const string& thing); |
34 |
|
|
bool operator==(Page& page); |
35 |
|
|
bool operator!=(const string& thing) { return !(*this == thing); } |
36 |
|
|
bool operator!=(Page& page) { return !(*this == page); } |
37 |
|
|
bool operator<(Page& page); |
38 |
|
|
bool operator>(Page& page); |
39 |
Douglas Thrift |
128 |
// friends: |
40 |
Douglas Thrift |
129 |
friend bool operator==(const string& thing, Page& page) { return page == |
41 |
|
|
thing; } |
42 |
|
|
friend bool operator!=(const string& thing, Page& page) { return page == |
43 |
|
|
thing; } |
44 |
Douglas Thrift |
128 |
}; |
45 |
|
|
|
46 |
|
|
#endif // _Page_hpp_ |