Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

xmlmodelbase.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     xmlmodelbase.h  -  Definition of XmlModelBase class
00003                              -------------------
00004     begin                : June 21 2002
00005     copyright            : (C) 2003 by Vojtìch Toman
00006     email                : vtoman@lit.cz
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00027 #ifndef XMLMODELBASE_H
00028 #define XMLMODELBASE_H
00029 
00030 #include "defs.h"
00031 #include "encodings.h"
00032 #include "grammarbase.h"
00033 #include "hashtable.h"
00034 #include "list.h"
00035 #include "queue.h"
00036 #include "textcodec.h"
00037 #include "xmlmodelevents.h"
00038 #include "saxemitter.h"
00039 #include "funneldevice.h"
00040 
00041 
00042 
00043 
00044 
00045 
00047 #define XML_MODEL_BUFFER_DEFAULT_SIZE           1024
00048 
00049 
00050 
00051 
00053 enum DataQueueItemType
00054 {
00056   Number,
00057 
00059   Characters,
00060 
00062   CharactersLength
00063 };
00064 
00065 
00067 struct DataQueueItem
00068 {
00070   DataQueueItemType type;
00071 
00073   XmlChar *data;
00074 
00075   union
00076   {
00078     int length;
00079 
00081     int value;
00082   };
00083 };
00084 
00085 
00091 typedef Queue<DataQueueItem> DataQueue;
00092 
00093 
00099 typedef List<XmlChar> ElementNamesList;
00100 
00101 
00107 typedef List<XmlChar> AttributeNamesList;
00108 
00109 
00111 typedef HashTable<XmlChar *, unsigned long, List, 3079> ElementIds;
00112 
00114 typedef HashTable<XmlChar *, unsigned long, List, 3079> AttributeIds;
00115 
00116 
00117 
00123 class XmlModelBase : public UserOfTextCodec, public UserOfFunnelDevice
00124 {
00125 public:
00127   XmlModelBase(void) : UserOfTextCodec(), UserOfFunnelDevice() {}
00128 
00134   virtual ~XmlModelBase(void) {}
00135 
00143   virtual bool manageEvent(XmlModelEvent *event) = 0;
00144 
00153   virtual void receiveData(XmlChar *data, size_t size) = 0;
00154 
00156   virtual void setGrammar(GrammarBase *gr) = 0;
00157 
00159   virtual void setSAXEmitter(SAXEmitter *emitter, void *data = 0) = 0;
00160 };
00161 
00162 
00163 #endif //XMLMODELBASE_H

Generated on Wed Feb 5 10:43:02 2003 for Exalt by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002