summaryrefslogtreecommitdiffstats
path: root/addon/xmlparse/main.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2001-08-01 18:08:50 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2001-08-01 18:08:50 (GMT)
commit071e39254b00ad7ffed5de8cdeb44072278d4d57 (patch)
treedd7f0f7dd0875046b1426a541b00547a8af08af1 /addon/xmlparse/main.cpp
parentea8a1bc7ccbd7b64a31c293caa31240bde7397cf (diff)
downloadDoxygen-071e39254b00ad7ffed5de8cdeb44072278d4d57.zip
Doxygen-071e39254b00ad7ffed5de8cdeb44072278d4d57.tar.gz
Doxygen-071e39254b00ad7ffed5de8cdeb44072278d4d57.tar.bz2
Release-1.2.9
Diffstat (limited to 'addon/xmlparse/main.cpp')
-rw-r--r--addon/xmlparse/main.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/addon/xmlparse/main.cpp b/addon/xmlparse/main.cpp
new file mode 100644
index 0000000..82cc849
--- /dev/null
+++ b/addon/xmlparse/main.cpp
@@ -0,0 +1,54 @@
+#include "mainhandler.h"
+
+#include <qstring.h>
+#include <qxml.h>
+#include <qfile.h>
+#include <qdict.h>
+#include <qlist.h>
+
+class ErrorHandler : public QXmlErrorHandler
+{
+ public:
+ virtual ~ErrorHandler() {}
+ bool warning( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool error( const QXmlParseException & )
+ {
+ return FALSE;
+ }
+ bool fatalError( const QXmlParseException &exception )
+ {
+ fprintf(stderr,"Fatal error at line %d column %d: %s\n",
+ exception.lineNumber(),exception.columnNumber(),
+ exception.message().data());
+ return FALSE;
+ }
+ QString errorString() { return ""; }
+
+ private:
+ QString errorMsg;
+};
+
+
+int main(int argc,char **argv)
+{
+ if (argc==1)
+ {
+ printf("Usage: %s file.xml\n",argv[0]);
+ exit(1);
+ }
+
+ QFile xmlFile(argv[1]);
+ MainHandler handler;
+ ErrorHandler errorHandler;
+ QXmlInputSource source( xmlFile );
+ QXmlSimpleReader reader;
+ reader.setContentHandler( &handler );
+ reader.setErrorHandler( &errorHandler );
+ reader.parse( source );
+
+ return 0;
+}
+