#include <xmlsimplemodel.h>
Inheritance diagram for XmlSimpleModel:
Public Methods | |
XmlSimpleModel (void) | |
A constructor. More... | |
virtual | ~XmlSimpleModel (void) |
A destructor. More... | |
virtual bool | manageEvent (XmlModelEvent *event) |
Manage XML events. More... | |
virtual void | setGrammar (GrammarBase *gr) |
Set a grammar for the model. More... | |
virtual void | setSAXEmitter (SAXEmitter *emitter, void *data=0) |
Set SAX emitter for decoding. More... | |
virtual void | receiveData (XmlChar *data, size_t size) |
Receive data from another object. More... | |
Protected Attributes | |
GrammarBase * | grammar |
The grammar used for compression. | |
bool | inCDATA |
Indication of CDATA section. | |
bool | inDoctype |
Indication of DOCTYPE section. | |
bool | elementHasAttributes |
Indication whether current element has any attributes. | |
bool | attributeListComplete |
Flag whether all the attributes have been decoded. | |
StructuralSymbols::Symbol | state |
State of the model. More... | |
ElementIds * | elementIds |
Hashtable of element ids. | |
SimpleElementTable * | elements |
Hashtable of element contexts. | |
ElementNamesList * | elementNamesList |
List of element names. | |
unsigned long | elementCounter |
Counter for unique element numbering. | |
Stack< unsigned long > * | elementStack |
Stack of element ids. More... | |
XmlChar * | buffer |
Buffer for read data. More... | |
size_t | bufferLength |
Length of the data in the buffer. | |
size_t | fibBits |
Number of read bits of Fibonacci code. More... | |
unsigned long | fibCode |
Read Fibonacci code. More... | |
bool | fibLastWasOne |
Helper variable for decoding Fibonacci codes. | |
DataQueue * | dataQueue |
The queue of decoded data items (such as names of the attributes, etc.). | |
SAXEmitter * | saxEmitter |
Pointer to the SAX emitter. More... | |
void * | userData |
User data for SAX emitter. More... |
This class implements a simple model for compression and decompression of XML data.
Definition at line 147 of file xmlsimplemodel.h.
|
A constructor. Initialization is performed. Definition at line 207 of file xmlsimplemodel.cpp. References attributeListComplete, buffer, bufferLength, dataQueue, elementCounter, elementHasAttributes, elementIds, elementNamesList, elements, elementStack, fibBits, fibCode, fibLastWasOne, grammar, inCDATA, inDoctype, NEW, saxEmitter, Collection< XmlChar >::setAutoDelete, HashTable< unsigned long, SimpleElementContext, List, 3079 >::setAutoDelete, HashTable< XmlChar *, unsigned long, List, 3079 >::setAutoDelete, Collection< unsigned >::setAutoDelete, Collection< DataQueueItem >::setAutoDelete, state, and userData. |
|
A destructor. The resources occupied by the model are freed. Definition at line 258 of file xmlsimplemodel.cpp. References Collection< XmlChar >::count, dataQueue, DELETE, elementNamesList, elements, elementStack, ExaltOptions::getOption, OUTPUTEENDLINE, OUTPUTENL, ExaltOptions::Verbose, and ExaltOptions::Yes. |
|
|
Receive data from another object. This method implements the decoding procedure. It receives data from the underlying grammar and reconstructs the XML data.
Implements XmlModelBase. Definition at line 835 of file xmlsimplemodel.cpp. References List< XmlChar >::append, attributeListComplete, buffer, bufferLength, CHANGE_STATE, CHECK_POINTER, Collection< DataQueueItem >::count, DataQueueItem::data, dataQueue, Fibonacci::decode, DELETE, Queue< DataQueueItem >::dequeue, elementCounter, elementHasAttributes, elementNamesList, elements, elementStack, Queue< DataQueueItem >::enqueue, fibBits, fibCode, fibLastWasOne, HashTable< unsigned long, SimpleElementContext, List, 3079 >::find, FINISH_ELEMENT_START, inCDATA, inDoctype, HashTable< unsigned long, SimpleElementContext, List, 3079 >::insert, SimpleElementContext::name, NEW, Stack< unsigned long >::pop, RESET_BUFFER, RESET_STATE, SAFE_CALL_EMITTER, state, DataQueueItem::type, userData, XML_MODEL_BUFFER_DEFAULT_SIZE, XmlChar, xmlchar_strcpy, and xmlchar_strlen. |
|
Set a grammar for the model.
Sets a grammar that is used for the compression of the data.
Implements XmlModelBase. Definition at line 166 of file xmlsimplemodel.h. References grammar. |
|
Set SAX emitter for decoding. Sets the SAX emitter and (optionaly) the user data.
Implements XmlModelBase. Definition at line 285 of file xmlsimplemodel.cpp. References saxEmitter, and userData. |
|
Buffer for read data.
Used during decoding. Definition at line 223 of file xmlsimplemodel.h. Referenced by receiveData, and XmlSimpleModel. |
|
Stack of element ids.
Stores the "level" in the document. Definition at line 216 of file xmlsimplemodel.h. Referenced by manageEvent, receiveData, XmlSimpleModel, and ~XmlSimpleModel. |
|
Number of read bits of Fibonacci code.
Used during decoding. Definition at line 235 of file xmlsimplemodel.h. Referenced by receiveData, and XmlSimpleModel. |
|
Read Fibonacci code.
Used during decoding. Definition at line 242 of file xmlsimplemodel.h. Referenced by receiveData, and XmlSimpleModel. |
|
Pointer to the SAX emitter.
Used during decoding. Definition at line 255 of file xmlsimplemodel.h. Referenced by setSAXEmitter, and XmlSimpleModel. |
|
State of the model.
Used during decoding. State is represented by StructuralSymbols. Definition at line 197 of file xmlsimplemodel.h. Referenced by receiveData, and XmlSimpleModel. |
|
User data for SAX emitter.
Used during decoding. Definition at line 262 of file xmlsimplemodel.h. Referenced by receiveData, setSAXEmitter, and XmlSimpleModel. |