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 198 by douglas, 2003-07-11T00:54:47-07:00 vs.
Revision 199 by douglas, 2003-07-15T00:22:06-07:00

# Line 46 | Line 46
46   //
47   // Douglas Thrift
48   //
49 < // $Id: Page.cpp,v 1.3 2003/07/11 07:54:47 douglas Exp $
49 > // $Id: Page.cpp,v 1.4 2003/07/15 07:22:06 douglas Exp $
50  
51   #include "Page.h"
52  
# Line 108 | Line 108 | istream& operator>>(istream& is, Page& d
108                                  unsigned start = line.find("<port>") + 6;
109                                  unsigned finish = line.find("</port>", start);
110  
111 <                                data.setPort(strtoul(line.substr(start, finish -
112 <                                        start).c_str(), 0, 0));
111 >                                istringstream buffer(line.substr(start, finish - start));
112 >                                unsigned port;
113 >
114 >                                buffer >> port;
115 >
116 >                                data.setPort(port);
117 >                        }
118 > #ifdef _OpenSSL_
119 >                        else if (line.find("            <tls>") == 0)
120 >                        {
121 >                                unsigned start = line.find("<tls>") + 5;
122 >                                unsigned finish = line.find("</tls>", start);
123 >
124 >                                istringstream buffer(line.substr(start, finish - start));
125 >                                bool tls;
126 >
127 >                                buffer.setf(ios_base::boolalpha);
128 >                                buffer >> tls;
129 >
130 >                                data.setTls(tls);
131                          }
132 + #endif
133                          else if (line.find("            <path>") == 0)
134                          {
135                                  unsigned start = line.find("<path>") + 6;
# Line 129 | Line 148 | istream& operator>>(istream& is, Page& d
148                                  unsigned start = line.find("<size>") + 6;
149                                  unsigned finish = line.find("</size>", start);
150  
151 <                                data.setSize(strtoul(line.substr(start, finish -
152 <                                        start).c_str(), 0, 0));
151 >                                istringstream buffer(line.substr(start, finish - start));
152 >                                unsigned size;
153 >
154 >                                buffer >> size;
155 >
156 >                                data.setSize(size);
157                          }
158                          else if (line.find("            <title>") == 0)
159                          {
# Line 222 | Line 245 | ostream& operator<<(ostream& os, Page& d
245  
246          os << " <page>\n" << "          <address>" << address << "</address>\n";
247  
248 + #ifndef _OpenSSL_
249          if (data.getPort() != 80)
250 + #else
251 +        if (data.getPort() != 80 && !data.getTls())
252 + #endif
253          {
254                  os << "         <port>" << data.getPort() << "</port>\n";
255          }
256  
257 + #ifdef _OpenSSL_
258 +        os.setf(ios::boolalpha);
259 +        os << "         <tls>" << data.getTls() << "</tls>\n";
260 + #endif
261 +
262          string path = data.getPath();
263  
264          entities(path, '&', "&amp;");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines