ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/SiteMapper/SiteMapper.cpp
(Generate patch)

Comparing SiteMapper/SiteMapper.cpp (file contents):
Revision 143 by Douglas Thrift, 2004-03-31T22:55:16-08:00 vs.
Revision 152 by Douglas Thrift, 2004-05-29T20:00:41-07:00

# Line 13 | Line 13
13   #include "Page.hpp"
14  
15   string program;
16 < bool debug = false;
16 > bool debug(false);
17  
18   int main(int argc, char* argv[])
19   {
# Line 21 | Line 21 | int main(int argc, char* argv[])
21  
22          string siteIndex, siteMap;
23  
24 <        for (int index = 1; index < argc; index++)
24 >        for (int index(1); index < argc; index++)
25          {
26                  string arg(argv[index]);
27                  Matcher matcher;
# Line 223 | Line 223 | bool SiteMapper::newIndex(vector<Page>&
223  
224   void SiteMapper::newMap(const string& siteMap)
225   {
226 +        ofstream fout(siteMap.c_str());
227 +
228 +        fout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
229 +                << "<?xml-stylesheet type=\"text/xsl\" href=\"stylesheets/sitemap.xsl"
230 +                << "\"?>\n"
231 +                << "<!DOCTYPE page SYSTEM \"stylesheets/page.dtd\">\n"
232 +                << "<!-- $Id$ -->\n"
233 +                << "<page>\n"
234 +                << "\t<title>Sitemap</title>\n"
235 +                << "\t<section>\n"
236 +                << "\t\t<list>\n";
237 +
238          for (unsigned index = 0; index < pages.size(); index++)
239          {
240                  if (newPages.find(pages[index].getAddress()) != newPages.end())
# Line 231 | Line 243 | void SiteMapper::newMap(const string& si
243                                  newPages.find(pages[index].getAddress())->second);
244                  }
245  
246 <                cout << pages[index] << '\n';
246 >                fout << pages[index](3) << '\n';
247          }
248 +
249 +        fout << "\t\t</list>\n"
250 +                << "\t</section>\n"
251 +                << "</page>\n";
252 +
253 +        fout.close();
254   }
255  
256   void SiteMapper::newMap(vector<Page>& pages, const string& childOf,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines