21 #ifndef SEPARATISTA_ELEMENT_H 22 #define SEPARATISTA_ELEMENT_H 31 #include "separatista/separatista.h" 32 #include "separatista/xerces_types.h" 33 #include "separatista/debug/debug.h" 34 #include "separatista/elementdescriptor.h" 35 #include "separatista/exception.h" 40 class ElementException;
41 class UnsupportedElementException;
49 virtual void elementValueChanged(
Element *pElement,
const wchar_t *pNewValue) = 0;
50 virtual void elementCreated(
Element *pParent,
Element *pChild) = 0;
51 virtual void elementDeleted(
Element *pElement) = 0;
84 virtual IOErrorCode toDOMDocument(xercesc::DOMDocument *pDOMDocument, xercesc::DOMElement *pDOMParent,
const ErrorOptions errorOptions = ThrowExceptions)
const = 0;
90 virtual void fromDOMDocument(xercesc::DOMElement *pDOMElement,
const ErrorOptions errorOptions = ThrowExceptions) = 0;
109 const wchar_t* getTag()
const;
116 virtual Element* getElementByTag(
const wchar_t *pTagName,
size_t nIndex = 0)
const;
125 virtual Element* createElementByTag(
const wchar_t *pTagName,
size_t nIndex = 0);
131 virtual void destroyElement(
Element *pChildElement);
138 virtual const wchar_t* getTextValue()
const;
144 virtual void setValue(
const wchar_t *pValue,
const ErrorOptions errorOptions = ThrowExceptions);
152 virtual const wchar_t* getAttributeValue(
const wchar_t *pAttributeName)
const;
160 virtual void setAttributeValue(
const wchar_t *pAttributeName,
const wchar_t *pValue);
166 time_t getDateValue()
const;
172 void setValue(
const time_t Value,
bool bWithTime =
false,
const ErrorOptions errorOptions = ThrowExceptions);
177 int getIntValue()
const;
182 void setValue(
const int Value,
const ErrorOptions errorOptions = ThrowExceptions);
187 double getDoubleValue()
const;
192 void setValue(
const double d,
const ErrorOptions errorOptions = ThrowExceptions);
197 bool isEmpty()
const;
209 bool operator <(
const TagKey &Other)
const;
211 bool operator ==(
const TagKey &Other)
const;
216 static unsigned int HashKey(
const wchar_t *pTagName);
218 const wchar_t* getTagName()
const;
220 unsigned int getHash()
const;
224 const wchar_t *m_pTagName;
225 unsigned int m_nHash;
229 typedef std::map<const TagKey, Element*> TagKeyMap;
233 TagKeyMap::const_iterator m_begin;
234 TagKeyMap::const_iterator m_end;
241 virtual TagKeyRange getAllByTagName(
const wchar_t *pTagName);
259 Element* getParentElement()
const;
266 static void deleteElement(
Element *pChildElement);
269 void onElementValueChanged(
const wchar_t *pNewValue);
272 void onElementCreated(
Element *pChildElement);
275 void onElementDeleted();
282 std::vector<ElementListener*> m_ElementListeners;
288 const wchar_t *m_pTag;
292 #endif // ifndef SEPARATISTA_ELEMENT_H Leave an empty value for the node.
Definition: element.h:67
Definition: elementdescriptor.h:44
Definition: element.h:203
Definition: elementdescriptor.h:58
ErrorOptions
Definition: element.h:62
Definition: element.h:231