12 |
|
setAddress(address); |
13 |
|
setPath(path); |
14 |
|
setTitle(title); |
15 |
+ |
|
16 |
+ |
tab = 0; |
17 |
|
} |
18 |
|
|
19 |
< |
Page::Page(const string& url) |
19 |
> |
Page::Page(const string& url, const string& title) |
20 |
|
{ |
21 |
|
setUrl(url); |
22 |
+ |
setTitle(title); |
23 |
+ |
|
24 |
+ |
tab = 0; |
25 |
|
} |
26 |
|
|
27 |
|
void Page::setUrl(const string& url) |
90 |
|
|
91 |
|
return false; |
92 |
|
} |
93 |
+ |
|
94 |
+ |
ostream& operator<<(ostream& output, Page& page) |
95 |
+ |
{ |
96 |
+ |
string tab(page.tab, '\t'); |
97 |
+ |
|
98 |
+ |
output << tab << "<item><link address=\"" << page.getUrl() << "\"\n" |
99 |
+ |
<< page.title << "</link>\n"; |
100 |
+ |
|
101 |
+ |
if (!page.children.empty()) |
102 |
+ |
{ |
103 |
+ |
output << tab << "\t<list>\n"; |
104 |
+ |
|
105 |
+ |
for (int index = 0; index < page.children.size(); index++) |
106 |
+ |
{ |
107 |
+ |
output << page.children[index](page.tab + 1) << '\n'; |
108 |
+ |
} |
109 |
+ |
|
110 |
+ |
output << tab << "\t</list>\n"; |
111 |
+ |
} |
112 |
+ |
|
113 |
+ |
output << tab << "</item>"; |
114 |
+ |
|
115 |
+ |
return output; |
116 |
+ |
} |