ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/Processor.cpp
(Generate patch)

Comparing trunk/Search/Processor.cpp (file contents):
Revision 364 by douglas, 2005-12-31T20:38:31-08:00 vs.
Revision 365 by douglas, 2008-08-11T15:16:35-07:00

# Line 136 | Line 136 | bool Processor::process(HttpHandler& htt
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())
# Line 182 | Line 182 | bool Processor::process(HttpHandler& htt
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  
# Line 212 | Line 212 | bool Processor::process(HttpHandler& htt
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);
# Line 224 | Line 224 | bool Processor::process(HttpHandler& htt
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));
# Line 233 | Line 233 | bool Processor::process(HttpHandler& htt
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));
# Line 242 | Line 242 | bool Processor::process(HttpHandler& htt
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)
# Line 267 | Line 267 | bool Processor::process(HttpHandler& htt
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) + ' ';
# Line 277 | Line 277 | bool Processor::process(HttpHandler& htt
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)
# Line 354 | Line 354 | bool Processor::process(HttpHandler& htt
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines