00001 //========================================================================== 00002 // NEDSAXHANDLER.H - 00003 // part of OMNeT++ 00004 // 00005 //========================================================================== 00006 00007 /*--------------------------------------------------------------* 00008 Copyright (C) 2002-2003 Andras Varga 00009 00010 This file is distributed WITHOUT ANY WARRANTY. See the file 00011 `license' for details on this and other legal matters. 00012 *--------------------------------------------------------------*/ 00013 00014 #ifndef __NEDSAXHANDLER_H 00015 #define __NEDSAXHANDLER_H 00016 00017 00018 #include "nedelement.h" 00019 #include "saxparser.h" 00020 00021 00040 class NEDSAXHandler : public SAXHandler 00041 { 00042 NEDElement *root; 00043 NEDElement *current; 00044 const char *sourcefilename; 00045 00046 public: 00050 NEDSAXHandler(const char *filename); 00051 00055 virtual ~NEDSAXHandler(); 00056 00060 virtual NEDElement *getTree(); 00061 00064 virtual void startElement(const char *name, const char **atts); 00065 virtual void endElement(const char *name); 00066 virtual void characterData(const char *s, int len); 00067 virtual void processingInstruction(const char *target, const char *data); 00068 virtual void comment(const char *data); 00069 virtual void startCdataSection(); 00070 virtual void endCdataSection(); 00072 }; 00073 00074 #endif 00075