source: subversion/applications/utils/export/guidise/guidise.cpp @ 27053

Last change on this file since 27053 was 24604, checked in by nick, 9 years ago

added guidise: tool to give features geographically-based unique (hopefully) IDs

File size: 620 bytes
Line 
1#include "Parser.h"
2#include <fstream>
3#include <iostream>
4
5int main (int argc, char *argv[])
6{
7        if(argc<2)
8        {
9                cerr<<"Usage: "<<argv[0]<<" infile"<<endl;
10                exit(1);
11        }
12
13        std::ifstream infile(argv[1]);
14        if(!infile.good())
15        {
16                cerr<<"Error reading input file"<<endl;
17                exit(1);
18        }
19
20        XML_Parser p = XML_ParserCreate(NULL);
21        if (!p)
22        {
23                cerr<< "Error creating parser"<<endl;
24                exit(1);
25        }
26       
27        XML_SetElementHandler(p, Parser::startElement, Parser::endElement);
28
29        // First parse to find the junction nodes
30        if(!Parser::parse(p,infile))
31        {
32                cerr<<"Error parsing:" << Parser::getError() <<endl;
33                exit(1);
34        }
35
36        return 0;
37}
Note: See TracBrowser for help on using the repository browser.