|
const ElementDescriptor * | getElementDescriptor () const |
|
virtual IOErrorCode | toDOMDocument (xercesc::DOMDocument *pDOMDocument, xercesc::DOMElement *pDOMParent, const ErrorOptions errorOptions=ThrowExceptions) const =0 |
|
virtual void | fromDOMDocument (xercesc::DOMElement *pDOMElement, const ErrorOptions errorOptions=ThrowExceptions)=0 |
|
void | addElementListener (ElementListener *pElementListener) |
|
void | removeElementListener (ElementListener *pElementListener) |
|
const wchar_t * | getTag () const |
|
virtual Element * | getElementByTag (const wchar_t *pTagName, size_t nIndex=0) const |
|
virtual Element * | createElementByTag (const wchar_t *pTagName, size_t nIndex=0) |
|
virtual void | destroyElement (Element *pChildElement) |
|
virtual const wchar_t * | getTextValue () const |
|
virtual void | setValue (const wchar_t *pValue, const ErrorOptions errorOptions=ThrowExceptions) |
|
virtual const wchar_t * | getAttributeValue (const wchar_t *pAttributeName) const |
|
virtual void | setAttributeValue (const wchar_t *pAttributeName, const wchar_t *pValue) |
|
time_t | getDateValue () const |
|
void | setValue (const time_t Value, bool bWithTime=false, const ErrorOptions errorOptions=ThrowExceptions) |
|
int | getIntValue () const |
|
void | setValue (const int Value, const ErrorOptions errorOptions=ThrowExceptions) |
|
double | getDoubleValue () const |
|
void | setValue (const double d, const ErrorOptions errorOptions=ThrowExceptions) |
|
bool | isEmpty () const |
|
virtual TagKeyRange | getAllByTagName (const wchar_t *pTagName) |
|
◆ ErrorOptions
Options how to handle errors when reading (fromDOMDocument) or writing (toDOMDocument) Separatista files.
Enumerator |
---|
ThrowExceptions | Throw exceptions, default.
|
ClearValue | Leave an empty value for the node.
|
AcceptValue | Accept erronous values.
|
◆ Element()
Construct a new Element
- Parameters
-
pElementDescriptor | The element descriptor to load the element from. |
◆ ~Element()
Protected destructor to protect the object from being destroyed by non Element derived classes.
◆ addElementListener()
Add an elementlistener. Will be notified of changes to the element.
- Parameters
-
pElementListener | The elementlistener to register. |
- See also
- ElementListener
◆ createElementByTag()
Element * Element::createElementByTag |
( |
const wchar_t * |
pTagName, |
|
|
size_t |
nIndex = 0 |
|
) |
| |
|
virtual |
Returns or creates the child element by tag name. If the element already exists, this function return the existing element. If not, it will create the element.
- Returns
- A pointer to the child element. Will not return NULL. If the element isn't supported an UnsupportedTagException is thrown.
- Exceptions
-
Reimplemented in Separatista::ChoiceElement, and Separatista::BranchElement.
◆ deleteElement()
void Element::deleteElement |
( |
Element * |
pChildElement | ) |
|
|
staticprotected |
◆ destroyElement()
void Element::destroyElement |
( |
Element * |
pChildElement | ) |
|
|
virtual |
◆ fromDOMDocument()
virtual void Separatista::Element::fromDOMDocument |
( |
xercesc::DOMElement * |
pDOMElement, |
|
|
const ErrorOptions |
errorOptions = ThrowExceptions |
|
) |
| |
|
pure virtual |
◆ getAllByTagName()
◆ getAttributeValue()
const wchar_t * Element::getAttributeValue |
( |
const wchar_t * |
pAttributeName | ) |
const |
|
virtual |
Get the element's attribute value
- Parameters
-
pAttributeName | The name of the attribute |
- Returns
- The value as text or NULL
- Exceptions
-
Reimplemented in Separatista::AttributedLeafElement.
◆ getDateValue()
time_t Element::getDateValue |
( |
| ) |
const |
Returns the value of the text node converted to date
- Returns
- -1 on error
◆ getDoubleValue()
double Element::getDoubleValue |
( |
| ) |
const |
Get the value of a text node converted to double
◆ getElementByTag()
Element * Element::getElementByTag |
( |
const wchar_t * |
pTagName, |
|
|
size_t |
nIndex = 0 |
|
) |
| const |
|
virtual |
◆ getElementDescriptor()
◆ getIntValue()
int Element::getIntValue |
( |
| ) |
const |
Get the value of a text node converted to int
◆ getParentElement()
Element* Separatista::Element::getParentElement |
( |
| ) |
const |
|
protected |
Get the parent element The parent element or NULL if no parent was found in the ElementDescriptor
◆ getTag()
const wchar_t * Element::getTag |
( |
| ) |
const |
◆ getTextValue()
const wchar_t * Element::getTextValue |
( |
| ) |
const |
|
virtual |
Get the element's value as text.
- Returns
- A pointer to the text value or NULL if no value was set.
- Exceptions
-
Reimplemented in Separatista::LeafElement.
◆ isEmpty()
bool Element::isEmpty |
( |
| ) |
const |
Returns true if the element text is empty
◆ removeElementListener()
◆ setAttributeValue()
void Element::setAttributeValue |
( |
const wchar_t * |
pAttributeName, |
|
|
const wchar_t * |
pValue |
|
) |
| |
|
virtual |
Set the element's attribute value
- Parameters
-
pAttributeName | The name of the attribute |
pValue | The (new) value to set |
- Exceptions
-
Reimplemented in Separatista::AttributedLeafElement.
◆ setValue() [1/4]
◆ setValue() [2/4]
Set the value of a text node by a time_t
- Parameters
-
bWithTime | Wether the time should be included or not |
◆ setValue() [3/4]
Set the value of a text node by an int
◆ setValue() [4/4]
Set the value of a text node conveted to double
◆ toDOMDocument()
virtual IOErrorCode Separatista::Element::toDOMDocument |
( |
xercesc::DOMDocument * |
pDOMDocument, |
|
|
xercesc::DOMElement * |
pDOMParent, |
|
|
const ErrorOptions |
errorOptions = ThrowExceptions |
|
) |
| const |
|
pure virtual |
The documentation for this class was generated from the following files:
- /home/okkel/Projects/Cpp/separatista/lib/separatista/element.h
- /home/okkel/Projects/Cpp/separatista/lib/separatista/element.cpp