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