00001 //========================================================================== 00002 // NEDSAXHANDLER.H - part of 00003 // 00004 // OMNeT++/OMNEST 00005 // Discrete System Simulation in C++ 00006 // 00007 //========================================================================== 00008 00009 /*--------------------------------------------------------------* 00010 Copyright (C) 2002-2008 Andras Varga 00011 Copyright (C) 2006-2008 OpenSim Ltd. 00012 00013 This file is distributed WITHOUT ANY WARRANTY. See the file 00014 `license' for details on this and other legal matters. 00015 *--------------------------------------------------------------*/ 00016 00017 #ifndef __NEDSAXHANDLER_H 00018 #define __NEDSAXHANDLER_H 00019 00020 00021 #include "nedelement.h" 00022 #include "nederror.h" 00023 #include "saxparser.h" 00024 00025 NAMESPACE_BEGIN 00026 00027 00046 class NEDXML_API NEDSAXHandler : public SAXHandler 00047 { 00048 NEDElement *root; 00049 NEDElement *current; 00050 const char *sourcefilename; 00051 NEDErrorStore *errors; 00052 00053 public: 00057 NEDSAXHandler(const char *filename, NEDErrorStore *e); 00058 00062 virtual ~NEDSAXHandler(); 00063 00067 virtual NEDElement *getTree(); 00068 00071 virtual void startElement(const char *name, const char **atts); 00072 virtual void endElement(const char *name); 00073 virtual void characterData(const char *s, int len); 00074 virtual void processingInstruction(const char *target, const char *data); 00075 virtual void comment(const char *data); 00076 virtual void startCdataSection(); 00077 virtual void endCdataSection(); 00079 }; 00080 00081 NAMESPACE_END 00082 00083 00084 #endif 00085