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

Comparing trunk/Search/Page.cpp (file contents):
Revision 354 by Douglas Thrift, 2004-05-26T17:44:17-07:00 vs.
Revision 355 by Douglas Thrift, 2004-06-04T04:08:28-07:00

# Line 218 | Line 218 | istream& operator>>(istream& is, Page& d
218  
219   ostream& operator<<(ostream& os, Page& data)
220   {
221 <        string address = data.getAddress();
221 >        string address(data.getAddress());
222  
223          entities(address, '&', "&amp;");
224          entities(address, '<', "&lt;");
225          entities(address, '>', "&gt;");
226  
227 <        os << " <page>\n" << "          <address>" << address << "</address>\n";
227 >        os << "\t<page>\n" << "\t\t<address>" << address << "</address>\n";
228  
229   #ifndef _OpenSSL_
230          if (data.getPort() != 80)
# Line 233 | Line 233 | ostream& operator<<(ostream& os, Page& d
233                  data.getTls()))
234   #endif
235          {
236 <                os << "         <port>" << data.getPort() << "</port>\n";
236 >                os << "\t\t<port>" << data.getPort() << "</port>\n";
237          }
238  
239   #ifdef _OpenSSL_
240          os.setf(ios::boolalpha);
241 <        os << "         <tls>" << data.getTls() << "</tls>\n";
241 >
242 >        os << "\t\t<tls>" << data.getTls() << "</tls>\n";
243   #endif
244  
245 <        string path = data.getPath();
245 >        string path(data.getPath());
246  
247          entities(path, '&', "&amp;");
248          entities(path, '<', "&lt;");
249          entities(path, '>', "&gt;");
250  
251 <        os << "         <path>" << path << "</path>\n";
252 <
252 <        os << "         <size>" << data.getSize() << "</size>\n";
251 >        os << "\t\t<path>" << path << "</path>\n\t\t<size>" << data.getSize()
252 >                << "</size>\n";
253  
254 <        if(data.getTitle() != "")
254 >        if(!data.getTitle().empty())
255          {
256 <                string title = data.getTitle();
256 >                string title(data.getTitle());
257  
258                  entities(title, '&', "&amp;");
259                  entities(title, '<', "&lt;");
260                  entities(title, '>', "&gt;");
261  
262 <                os << "         <title>" << title << "</title>\n";
262 >                os << "\t\t<title>" << title << "</title>\n";
263          }
264  
265 <        if(data.getDescription() != "")
265 >        if(!data.getDescription().empty())
266          {
267 <                string description = data.getDescription();
267 >                string description(data.getDescription());
268  
269                  entities(description, '&', "&amp;");
270                  entities(description, '<', "&lt;");
271                  entities(description, '>', "&gt;");
272  
273 <                os << "         <description>" << description << "</description>\n";
273 >                os << "\t\t<description>" << description << "</description>\n";
274          }
275  
276 <        string text = data.getText();
276 >        string text(data.getText());
277  
278          entities(text, '&', "&amp;");
279          entities(text, '<', "&lt;");
280          entities(text, '>', "&gt;");
281  
282 <        os << "         <text>" << text << "</text>\n";
282 >        os << "\t\t<text>" << text << "</text>\n";
283  
284          for (size_t index(0); index < data.getHeadings().size(); index++)
285          {
286 <                string heading = data.getHeadings()[index];
286 >                string heading(data.getHeadings()[index]);
287  
288                  entities(heading, '&', "&amp;");
289                  entities(heading, '<', "&lt;");
290                  entities(heading, '>', "&gt;");
291  
292 <                os << "         <heading>" << heading << "</heading>\n";
292 >                os << "\t\t<heading>" << heading << "</heading>\n";
293          }
294  
295 <        os << " </page>";
295 >        os << "\t</page>";
296  
297          return os;
298   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines