136 |
|
{ |
137 |
|
http.getline(line); |
138 |
|
|
139 |
< |
unsigned begin(0), startComment(0); |
139 |
> |
size_t begin(0), startComment(0); |
140 |
|
|
141 |
|
while (begin < line.length()) |
142 |
|
{ |
143 |
< |
unsigned open(line.find('<', begin)), close(line.find('>', begin)); |
143 |
> |
size_t open(line.find('<', begin)), close(line.find('>', begin)); |
144 |
|
string next; |
145 |
|
|
146 |
|
while (close == string::npos && http.good()) |
182 |
|
lowerTag.find("name=\"robots\"") != string::npos || |
183 |
|
lowerTag.find("name='robots'") != string::npos) |
184 |
|
{ |
185 |
< |
unsigned start(lowerTag.find("content=\"") + 9), |
185 |
> |
size_t start(lowerTag.find("content=\"") + 9), |
186 |
|
finish(lowerTag.find('\"', start)); |
187 |
|
string robots(lowerTag.substr(start, finish - start)); |
188 |
|
|
212 |
|
|| lowerTag.find("name=\"description\"") != string::npos |
213 |
|
|| lowerTag.find("name='description'") != string::npos) |
214 |
|
{ |
215 |
< |
unsigned start(lowerTag.find("content=\"") + 9), |
215 |
> |
size_t start(lowerTag.find("content=\"") + 9), |
216 |
|
finish(lowerTag.find('\"', start)); |
217 |
|
|
218 |
|
description = tag.substr(start, finish - start); |
224 |
|
{ |
225 |
|
if (lowerTag.find("href=\"") != string::npos) |
226 |
|
{ |
227 |
< |
unsigned start(lowerTag.find("href=\"") + 6), |
227 |
> |
size_t start(lowerTag.find("href=\"") + 6), |
228 |
|
finish(lowerTag.find('\"', start)); |
229 |
|
string link(getLink(tag.substr(start, finish - |
230 |
|
start), url)); |
233 |
|
} |
234 |
|
else if (lowerTag.find("href='") != string::npos) |
235 |
|
{ |
236 |
< |
unsigned start(lowerTag.find("href='") + 6), |
236 |
> |
size_t start(lowerTag.find("href='") + 6), |
237 |
|
finish(lowerTag.find('\'', start)); |
238 |
|
string link(getLink(tag.substr(start, finish - |
239 |
|
start), url)); |
242 |
|
} |
243 |
|
else if (lowerTag.find("href=") != string::npos) |
244 |
|
{ |
245 |
< |
unsigned start(lowerTag.find("href=") + 5), |
245 |
> |
size_t start(lowerTag.find("href=") + 5), |
246 |
|
finish(lowerTag.find(' ', start)); |
247 |
|
|
248 |
|
if (finish < close) |
267 |
|
{ |
268 |
|
if (lowerTag.find("alt=\"") != string::npos) |
269 |
|
{ |
270 |
< |
unsigned start(lowerTag.find("alt=\"") + 5), |
270 |
> |
size_t start(lowerTag.find("alt=\"") + 5), |
271 |
|
finish(lowerTag.find('\"', start)); |
272 |
|
|
273 |
|
text += tag.substr(start, finish - start) + ' '; |
277 |
|
} |
278 |
|
else if (lowerTag.find("alt=") != string::npos) |
279 |
|
{ |
280 |
< |
unsigned start(lowerTag.find("alt=") + 4), |
280 |
> |
size_t start(lowerTag.find("alt=") + 4), |
281 |
|
finish(lowerTag.find(' ', start)); |
282 |
|
|
283 |
|
if (finish < close) |
354 |
|
return answer; |
355 |
|
} |
356 |
|
|
357 |
< |
string Processor::getTag(const string& line, unsigned open, unsigned close) |
357 |
> |
string Processor::getTag(const string& line, size_t open, size_t close) |
358 |
|
{ |
359 |
|
return line.substr(open + 1, close - open - 1); |
360 |
|
} |