67 |
|
return false; |
68 |
|
} |
69 |
|
|
70 |
< |
bool Page::operator==(Page& page) |
70 |
> |
bool Page::operator==(Matcher& matcher) |
71 |
> |
{ |
72 |
> |
if (address == matcher) |
73 |
> |
{ |
74 |
> |
return true; |
75 |
> |
} |
76 |
> |
else if (path == matcher) |
77 |
> |
{ |
78 |
> |
return true; |
79 |
> |
} |
80 |
> |
else if (title == matcher) |
81 |
> |
{ |
82 |
> |
return true; |
83 |
> |
} |
84 |
> |
|
85 |
> |
return false; |
86 |
> |
} |
87 |
> |
|
88 |
> |
bool Page::operator==(const Page& page) const |
89 |
|
{ |
90 |
|
if (address == page.address) |
91 |
|
{ |
95 |
|
return false; |
96 |
|
} |
97 |
|
|
98 |
< |
bool Page::operator<(Page& page) |
98 |
> |
bool Page::operator<(const Page& page) const |
99 |
|
{ |
100 |
< |
if (address < page.address) if (path < page.path) return true; |
100 |
> |
if (address == page.address) |
101 |
> |
{ |
102 |
> |
return path < page.path; |
103 |
> |
} |
104 |
|
|
105 |
< |
return false; |
105 |
> |
return address < page.address; |
106 |
|
} |
107 |
|
|
108 |
< |
bool Page::operator>(Page& page) |
108 |
> |
bool Page::operator>(const Page& page) const |
109 |
|
{ |
110 |
< |
if (address > page.address) if (path > page.path) return true; |
110 |
> |
if (address == page.address) |
111 |
> |
{ |
112 |
> |
return path > page.path; |
113 |
> |
} |
114 |
|
|
115 |
< |
return false; |
115 |
> |
return address > page.address; |
116 |
|
} |
117 |
|
|
118 |
|
ostream& operator<<(ostream& output, Page& page) |
126 |
|
{ |
127 |
|
output << tab << "\t<list>\n"; |
128 |
|
|
129 |
< |
for (int index = 0; index < page.children.size(); index++) |
129 |
> |
for (unsigned index = 0; index < page.children.size(); index++) |
130 |
|
{ |
131 |
|
output << page.children[index](page.tab + 1) << '\n'; |
132 |
|
} |