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

Comparing GoogleTron/GoogleTron.cpp (file contents):
Revision 677 by douglas, 2006-03-04T07:11:04-08:00 vs.
Revision 679 by douglas, 2006-03-05T19:57:15-08:00

# Line 6 | Line 6
6  
7   #include <cxx/standard.hh>
8  
9 + #include <api/exename.hpp>
10 + #include <api/pcre/regex.hpp>
11   #include <api/process.hpp>
12   #include <app/simple.hpp>
13   #include <xml/textwriter.hpp>
# Line 16 | Line 18
18  
19   int Main(const app::Options &options)
20   {
21 <        GoogleTron tron(_B("sitemap.gz"));
21 >        cse::String sitemap(_B("sitemap.gz"));
22 >
23 >        api::Pcre::RegEx sitemap_(_B("^-sitemap=(.+)$"));
24 >
25 >        _foreach (const app::ArgumentList, arg, app::GetArguments())
26 >        {
27 >                api::Pcre::RegEx::Match match;
28 >
29 >                if (match = sitemap_(*arg))
30 >                        sitemap = match[1];
31 >                else
32 >                {
33 >                        api::Cout << _B("Usage: ") << api::GetExecutablePath().GetName() << _B(" [-sitemap=sitemap]") << ios::NewLine;
34 >
35 >                        return 1;
36 >                }
37 >        }
38 >
39 >        GoogleTron tron(sitemap);
40  
41          return 0;
42   }
# Line 42 | Line 62 | int GoogleTron::Output()
62          xml::ScopeElement urlset(writer, _B("urlset"));
63  
64          writer.SetAttribute(_B("xmlns"), _B("http://www.google.com/schemas/sitemap/0.84"));
65 +        writer.SetAttribute(_B("xmlns:xsi"), _B("http://www.w3.org/2001/XMLSchema-instance"));
66 +        writer.SetAttribute(_B("xsi:schemaLocation"), _B("http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd"));
67  
68          do
69          {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines