4 |
|
// |
5 |
|
// $Id$ |
6 |
|
|
7 |
+ |
#include "Matcher.hpp" |
8 |
|
#include "Page.hpp" |
9 |
|
|
10 |
|
Page::Page(const string& address, const string& path, const string& title) |
39 |
|
else |
40 |
|
{ |
41 |
|
cerr << program << ": Page.setUrl(" << url << ") failure.\n"; |
42 |
+ |
|
43 |
+ |
exit(1); |
44 |
|
} |
45 |
|
} |
46 |
+ |
|
47 |
+ |
bool Page::operator==(const string& thing) |
48 |
+ |
{ |
49 |
+ |
if (address == thing) |
50 |
+ |
{ |
51 |
+ |
return true; |
52 |
+ |
} |
53 |
+ |
else if (path == thing) |
54 |
+ |
{ |
55 |
+ |
return true; |
56 |
+ |
} |
57 |
+ |
else if (title == thing) |
58 |
+ |
{ |
59 |
+ |
return true; |
60 |
+ |
} |
61 |
+ |
|
62 |
+ |
return false; |
63 |
+ |
} |
64 |
+ |
|
65 |
+ |
bool Page::operator==(Page& page) |
66 |
+ |
{ |
67 |
+ |
if (address == page.address) |
68 |
+ |
{ |
69 |
+ |
if (path == page.path || title == page.title) return true; |
70 |
+ |
} |
71 |
+ |
|
72 |
+ |
return false; |
73 |
+ |
} |
74 |
+ |
|
75 |
+ |
bool Page::operator<(Page& page) |
76 |
+ |
{ |
77 |
+ |
if (address < page.address) if (path < page.path) return true; |
78 |
+ |
|
79 |
+ |
return false; |
80 |
+ |
} |
81 |
+ |
|
82 |
+ |
bool Page::operator>(Page& page) |
83 |
+ |
{ |
84 |
+ |
if (address > page.address) if (path > page.path) return true; |
85 |
+ |
|
86 |
+ |
return false; |
87 |
+ |
} |