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 127 by Douglas Thrift, 2004-03-23T19:52:15-08:00 vs.
Revision 128 by Douglas Thrift, 2004-03-23T22:15:08-08:00

# Line 6 | Line 6
6  
7   #include "SiteMapper.hpp"
8   #include "Matcher.hpp"
9 + #include "Page.hpp"
10  
11   #include <xalanc/Include/PlatformDefinitions.hpp>
12   #include <xercesc/util/PlatformUtils.hpp>
# Line 14 | Line 15
15   XALAN_USING_XERCES(XMLPlatformUtils)
16   XALAN_USING_XALAN(XPathEvaluator)
17  
18 + string program;
19 + bool debug = false;
20 +
21   int main(int argc, char* argv[])
22   {
23 +        program = argv[0];
24 +        
25          string siteIndex, siteMap;
26  
27          for (int index = 1; index < argc; argc++)
28          {
29 <                string arg = argv[index];
29 >                string arg(argv[index]);
30 >                Matcher matcher;
31  
32 <                //
32 >                if (arg == matcher("^-index=(.*)$"))
33 >                {
34 >                        siteIndex = matcher[1];
35 >                }
36 >                else if (arg == matcher("^-map=(.*)$"))
37 >                {
38 >                        siteMap = matcher[1];
39 >                }
40          }
27        
28        XMLPlatformUtils::Initialize();
29        XPathEvaluator::initialize();
41  
42 <        SiteMapper mapper(siteIndex, siteMap);
42 >        if (siteIndex != "" && siteMap != "")
43 >        {      
44 >                XMLPlatformUtils::Initialize();
45 >                XPathEvaluator::initialize();
46 >
47 >                SiteMapper mapper(siteIndex, siteMap);
48  
49 <        XPathEvaluator::terminate();
50 <        XMLPlatformUtils::Terminate();
49 >                XPathEvaluator::terminate();
50 >                XMLPlatformUtils::Terminate();
51 >        }
52 >        else
53 >        {
54 >                cout << "Usage: " << program << " -index=index -map=map\n";
55 >        }
56          
57          return 0;
58   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines