This is used by vtkPVXMLParser to represent an XML document starting at the root element. More...
#include <vtkPVXMLElement.h>
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
const char * | GetAttribute (const char *name) |
Get the attribute with the given name. More... | |
const char * | GetAttributeOrEmpty (const char *name) |
Get the attribute with the given name. More... | |
const char * | GetAttributeOrDefault (const char *name, const char *notFound) |
Get the attribute with the given name. More... | |
const char * | GetCharacterData () |
Get the character data for the element. More... | |
vtkPVXMLElement * | GetParent () |
Get the parent of this element. More... | |
unsigned int | GetNumberOfNestedElements () |
Get the number of elements nested in this one. More... | |
vtkPVXMLElement * | GetNestedElement (unsigned int index) |
Get the element nested in this one at the given index. More... | |
vtkPVXMLElement * | FindNestedElement (const char *id) |
Find a nested element with the given id. More... | |
vtkPVXMLElement * | FindNestedElementByName (const char *name) |
Locate a nested element with the given tag name. More... | |
void | FindNestedElementByName (const char *name, vtkCollection *elements) |
Locate a set of nested elements with the given tag name. More... | |
void | RemoveAllNestedElements () |
Removes all nested elements. More... | |
void | RemoveNestedElement (vtkPVXMLElement *) |
Remove a particular element. More... | |
void | ReplaceNestedElement (vtkPVXMLElement *elementToReplace, vtkPVXMLElement *element) |
Replace a particular element with another. More... | |
vtkPVXMLElement * | LookupElement (const char *id) |
Lookup the element with the given id, starting at this scope. More... | |
void | RemoveAttribute (const char *attrName) |
Remove the attribute from the current element. More... | |
void | SetAttribute (const char *attrName, const char *attrValue) |
Given it's name and value, set an attribute. More... | |
void | Merge (vtkPVXMLElement *element, const char *attributeName) |
Merges another element with this one, both having the same name. More... | |
bool | Equals (vtkPVXMLElement *other) |
Return true if the current object has the same content as the other. More... | |
void | CopyTo (vtkPVXMLElement *other) |
Copy the current XML element content into the provided one. More... | |
void | CopyAttributesTo (vtkPVXMLElement *other) |
Copy the attributes from current XML element content into the provided one. More... | |
virtual void | SetName (const char *) |
Set/Get the name of the element. More... | |
virtual char * | GetName () |
Set/Get the name of the element. More... | |
virtual char * | GetId () |
Get the id of the element. More... | |
int | GetScalarAttribute (const char *name, int *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetScalarAttribute (const char *name, float *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetScalarAttribute (const char *name, double *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetVectorAttribute (const char *name, int length, int *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetVectorAttribute (const char *name, int length, float *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetVectorAttribute (const char *name, int length, double *value) |
Get the attribute with the given name converted to a scalar value. More... | |
int | GetCharacterDataAsVector (int length, int *value) |
Get the character data converted to a scalar value. More... | |
int | GetCharacterDataAsVector (int length, float *value) |
Get the character data converted to a scalar value. More... | |
int | GetCharacterDataAsVector (int length, double *value) |
Get the character data converted to a scalar value. More... | |
void | AddAttribute (const char *attrName, const char *attrValue) |
Given it's name and value, add an attribute. More... | |
void | AddAttribute (const char *attrName, unsigned int attrValue) |
Given it's name and value, add an attribute. More... | |
void | AddAttribute (const char *attrName, double attrValue) |
Given it's name and value, add an attribute. More... | |
void | AddAttribute (const char *attrName, double attrValue, int precision) |
Given it's name and value, add an attribute. More... | |
void | AddAttribute (const char *attrName, int attrValue) |
Given it's name and value, add an attribute. More... | |
void | AddNestedElement (vtkPVXMLElement *element, int setPrent) |
Add a sub-element. More... | |
void | AddNestedElement (vtkPVXMLElement *element) |
Add a sub-element. More... | |
void | PrintXML (ostream &os, vtkIndent indent) |
Serialize (as XML) in the given stream. More... | |
void | PrintXML () |
Serialize (as XML) in the given stream. More... | |
void | GetElementsByName (const char *name, vtkCollection *elements) |
Similar to DOM specific getElementsByTagName(). More... | |
void | GetElementsByName (const char *name, vtkCollection *elements, bool recursively) |
Similar to DOM specific getElementsByTagName(). More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual vtkMTimeType | GetMTime () |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static int | IsTypeOf (const char *type) |
static vtkPVXMLElement * | SafeDownCast (vtkObject *o) |
static vtkPVXMLElement * | New () |
static std::string | Encode (const char *plaintext) |
Encode a string. More... | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Protected Attributes | |
vtkPVXMLElementInternals * | Internal |
char * | Name |
char * | Id |
vtkPVXMLElement * | Parent |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkPVXMLParser |
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
Definition at line 23 of file vtkPVXMLElement.h.
typedef vtkObject vtkPVXMLElement::Superclass |
Definition at line 26 of file vtkPVXMLElement.h.
|
protected |
|
overrideprotected |
|
virtual |
Reimplemented from vtkObjectBase.
|
static |
|
overridevirtual |
Reimplemented from vtkObject.
|
static |
|
virtual |
Set/Get the name of the element.
This is its XML tag. (<Name/>
).
|
virtual |
Set/Get the name of the element.
This is its XML tag. (<Name/>
).
|
virtual |
Get the id of the element.
This is assigned by the XML parser and can be used as an identifier to an element.
Get the attribute with the given name.
If it doesn't exist, returns nullptr.
Definition at line 51 of file vtkPVXMLElement.h.
Get the attribute with the given name.
If it doesn't exist, returns "".
Definition at line 57 of file vtkPVXMLElement.h.
Get the attribute with the given name.
If it doesn't exist, returns the provided notFound value.
const char* vtkPVXMLElement::GetCharacterData | ( | ) |
Get the character data for the element.
Get the attribute with the given name converted to a scalar value.
Returns 1 if a value was extracted.
Get the attribute with the given name converted to a scalar value.
Returns 1 if a value was extracted.
Get the attribute with the given name converted to a scalar value.
Returns 1 if a value was extracted.
Get the attribute with the given name converted to a scalar value.
Returns length of vector read.
Get the attribute with the given name converted to a scalar value.
Returns length of vector read.
Get the attribute with the given name converted to a scalar value.
Returns length of vector read.
Get the character data converted to a scalar value.
Returns length of vector read.
Get the character data converted to a scalar value.
Returns length of vector read.
Get the character data converted to a scalar value.
Returns length of vector read.
vtkPVXMLElement* vtkPVXMLElement::GetParent | ( | ) |
Get the parent of this element.
unsigned int vtkPVXMLElement::GetNumberOfNestedElements | ( | ) |
Get the number of elements nested in this one.
vtkPVXMLElement* vtkPVXMLElement::GetNestedElement | ( | unsigned int | index | ) |
Get the element nested in this one at the given index.
vtkPVXMLElement* vtkPVXMLElement::FindNestedElement | ( | const char * | id | ) |
Find a nested element with the given id.
Not that this searches only the immediate children of this vtkPVXMLElement.
vtkPVXMLElement* vtkPVXMLElement::FindNestedElementByName | ( | const char * | name | ) |
Locate a nested element with the given tag name.
void vtkPVXMLElement::FindNestedElementByName | ( | const char * | name, |
vtkCollection * | elements | ||
) |
Locate a set of nested elements with the given tag name.
void vtkPVXMLElement::RemoveAllNestedElements | ( | ) |
Removes all nested elements.
void vtkPVXMLElement::RemoveNestedElement | ( | vtkPVXMLElement * | ) |
Remove a particular element.
void vtkPVXMLElement::ReplaceNestedElement | ( | vtkPVXMLElement * | elementToReplace, |
vtkPVXMLElement * | element | ||
) |
Replace a particular element with another.
vtkPVXMLElement* vtkPVXMLElement::LookupElement | ( | const char * | id | ) |
Lookup the element with the given id, starting at this scope.
Given it's name and value, add an attribute.
Given it's name and value, add an attribute.
Given it's name and value, add an attribute.
Given it's name and value, add an attribute.
Given it's name and value, add an attribute.
void vtkPVXMLElement::RemoveAttribute | ( | const char * | attrName | ) |
Remove the attribute from the current element.
Given it's name and value, set an attribute.
If an attribute with the given name already exists, it replaces the old attribute. chars that need to be XML escaped will be done so internally for example " will be converted to "
void vtkPVXMLElement::AddNestedElement | ( | vtkPVXMLElement * | element, |
int | setPrent | ||
) |
Add a sub-element.
The parent element keeps a reference to sub-element. If setParent is true, the nested element's parent is set as this.
void vtkPVXMLElement::AddNestedElement | ( | vtkPVXMLElement * | element | ) |
Add a sub-element.
The parent element keeps a reference to sub-element. If setParent is true, the nested element's parent is set as this.
void vtkPVXMLElement::PrintXML | ( | ostream & | os, |
vtkIndent | indent | ||
) |
Serialize (as XML) in the given stream.
void vtkPVXMLElement::PrintXML | ( | ) |
Serialize (as XML) in the given stream.
void vtkPVXMLElement::Merge | ( | vtkPVXMLElement * | element, |
const char * | attributeName | ||
) |
Merges another element with this one, both having the same name.
If any attribute, character data or nested element exists in both, the passed in one will override this one's. If they don't exist, they'll be added. If nested elements have the same names, the optional attributeName maybe passed in as another criteria to determine what to merge in case of same names.
void vtkPVXMLElement::GetElementsByName | ( | const char * | name, |
vtkCollection * | elements | ||
) |
Similar to DOM specific getElementsByTagName().
Returns a list of vtkPVXMLElements with the given name in the order in which they will be encountered in a preorder traversal of the sub-tree under this node. The elements are populated in the vtkCollection passed as an argument.
void vtkPVXMLElement::GetElementsByName | ( | const char * | name, |
vtkCollection * | elements, | ||
bool | recursively | ||
) |
Similar to DOM specific getElementsByTagName().
Returns a list of vtkPVXMLElements with the given name in the order in which they will be encountered in a preorder traversal of the sub-tree under this node. The elements are populated in the vtkCollection passed as an argument.
|
static |
Encode a string.
bool vtkPVXMLElement::Equals | ( | vtkPVXMLElement * | other | ) |
Return true if the current object has the same content as the other.
The comparison implementation is pretty weak in the mean that we compare resulting XML string.
void vtkPVXMLElement::CopyTo | ( | vtkPVXMLElement * | other | ) |
Copy the current XML element content into the provided one.
void vtkPVXMLElement::CopyAttributesTo | ( | vtkPVXMLElement * | other | ) |
Copy the attributes from current XML element content into the provided one.
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
|
friend |
Definition at line 276 of file vtkPVXMLElement.h.
|
protected |
Definition at line 258 of file vtkPVXMLElement.h.
|
protected |
Definition at line 260 of file vtkPVXMLElement.h.
|
protected |
Definition at line 261 of file vtkPVXMLElement.h.
|
protected |
Definition at line 264 of file vtkPVXMLElement.h.