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 152 by Douglas Thrift, 2004-05-29T20:00:41-07:00 vs.
Revision 153 by Douglas Thrift, 2004-05-29T20:37:48-07:00

# Line 81 | Line 81 | void SiteMapper::oldMap(const string& si
81  
82          if (list == 0) return;
83  
84 +        comment << evaluator.evaluate(support, document,
85 +                XalanDOMString("comment()").c_str())->str();
86 +
87          item = evaluator.createXPath(XalanDOMString("item").c_str());
88          address = evaluator.createXPath(XalanDOMString("link/@address").c_str());
89          link = evaluator.createXPath(XalanDOMString("link").c_str());
# Line 98 | Line 101 | void SiteMapper::oldMap(vector<Page>& pa
101   {
102          NodeRefList nodes = evaluator.selectNodeList(support, list, *item);
103  
104 <        for (int index = 0; index < nodes.getLength(); index++)
104 >        for (int index(0); index < nodes.getLength(); ++index)
105          {
106                  XalanNode* node = nodes.item(index);
107                  ostringstream url, title;
# Line 133 | Line 136 | void SiteMapper::newIndex(const string&
136          NodeRefList nodes = evaluator.selectNodeList(support, document,
137                  XalanDOMString("/index/page").c_str());
138  
139 <        for (int index = 0; index < nodes.getLength(); index++)
139 >        for (int index(0); index < nodes.getLength(); ++index)
140          {
141                  XalanNode* node = nodes.item(index);
142                  ostringstream address;
# Line 189 | Line 192 | void SiteMapper::newIndex(const string&
192  
193   bool SiteMapper::newIndex(vector<Page>& pages, Page& page)
194   {
195 <        for (unsigned index = 0; index < pages.size(); index++)
195 >        for (unsigned index(0); index < pages.size(); ++index)
196          {
197                  if (pages[index] == page.getAddress())
198                  {
# Line 229 | Line 232 | void SiteMapper::newMap(const string& si
232                  << "<?xml-stylesheet type=\"text/xsl\" href=\"stylesheets/sitemap.xsl"
233                  << "\"?>\n"
234                  << "<!DOCTYPE page SYSTEM \"stylesheets/page.dtd\">\n"
235 <                << "<!-- $Id$ -->\n"
235 >                << "<!--" << comment.str() << "-->\n"
236                  << "<page>\n"
237                  << "\t<title>Sitemap</title>\n"
238                  << "\t<section>\n"
239                  << "\t\t<list>\n";
240  
241 <        for (unsigned index = 0; index < pages.size(); index++)
241 >        for (unsigned index(0); index < pages.size(); ++index)
242          {
243                  if (newPages.find(pages[index].getAddress()) != newPages.end())
244                  {
# Line 256 | Line 259 | void SiteMapper::newMap(const string& si
259   void SiteMapper::newMap(vector<Page>& pages, const string& childOf,
260          multimap<string, Page>& newPages)
261   {
262 <        for (unsigned index = 0; index < pages.size(); index++)
262 >        for (unsigned index(0); index < pages.size(); ++index)
263          {
264                  newMap(pages[index].getChildren(), pages[index].getPath(), newPages);
265          }
266  
267 <        for (multimap<string, Page>::iterator itor = newPages.lower_bound(childOf);
267 >        for (multimap<string, Page>::iterator itor(newPages.lower_bound(childOf));
268                  itor != newPages.upper_bound(childOf); itor++)
269          {
270                  pages.push_back(itor->second);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines