src/xml_loader.h

См. документацию.
00001 //
00002 // C++ Interface: xml_loader
00003 //
00004 // Description: 
00005 //
00006 //
00007 // Author: yessss <gennadiyesss@mail.ru>, (C) 2007
00008 //
00009 // Copyright: See COPYING file that comes with this distribution
00010 //
00011 //
00012 #include <stack>
00013 #include <expat.h>
00014 #include <document.h>
00015 
00016 class xml_loader;
00017 
00018 typedef void (XMLCALL *element_handler) (xml_loader *th, const XML_Char *name, const XML_Char **atts);
00019 typedef void (XMLCALL *text_handler) (void *userData, const XML_Char *s, int len);
00020 
00021 void XMLCALL string_text_data (void *userData, const XML_Char *s, int len);
00022 void XMLCALL decimal_text_data (void *userData, const XML_Char *s, int len);
00023 void string_element ( xml_loader *th, const char *name, const char **atts );
00024 void decimal_element ( xml_loader *th, const char *name, const char **atts );
00025 
00026 class xml_loader {
00027      Document* doc;
00028      FILE* input;
00029      XML_Parser parser;
00030 public:
00031      std::stack<element_handler> start_element_func;
00032 private:
00033      std::stack<text_handler> text_func;
00034      std::stack<void*> parents_stack;
00035 
00036      static void XMLCALL startElement ( void *userData, const char *name, const char **atts );
00037      static void XMLCALL endElement ( void *userData, const char *name );
00038      static void XMLCALL text_data (void *userData, const XML_Char *s, int len);
00039 
00040      void* load();
00041 public:
00042      xml_loader(FILE* inp, Document* Doc);
00043      Document* getDocument();
00044      ~xml_loader();
00045      void* get_parent() const;
00046      void push(void * node);
00047      void push(text_handler handler);
00048      void push(element_handler handler);
00049      void push(void * node, element_handler handler);
00050 };

Документация по XDataServer. Последние изменения: Thu Jul 12 11:49:43 2007. Создано системой  doxygen 1.5.2