![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <vtkPVXMLElement.h>


Public Member Functions | |
| vtkTypeMacro (vtkPVXMLElement, vtkObject) | |
| void | PrintSelf (ostream &os, vtkIndent indent) override |
| vtkSetStringMacro (Name) | |
| vtkGetStringMacro (Name) | |
| vtkGetStringMacro (Id) | |
| const char * | GetAttribute (const char *name) |
| const char * | GetAttributeOrEmpty (const char *name) |
| const char * | GetAttributeOrDefault (const char *name, const char *notFound) |
| const char * | GetCharacterData () |
| int | GetScalarAttribute (const char *name, int *value) |
| int | GetScalarAttribute (const char *name, float *value) |
| int | GetScalarAttribute (const char *name, double *value) |
| int | GetVectorAttribute (const char *name, int length, int *value) |
| int | GetVectorAttribute (const char *name, int length, float *value) |
| int | GetVectorAttribute (const char *name, int length, double *value) |
| int | GetCharacterDataAsVector (int length, int *value) |
| int | GetCharacterDataAsVector (int length, float *value) |
| int | GetCharacterDataAsVector (int length, double *value) |
| vtkPVXMLElement * | GetParent () |
| unsigned int | GetNumberOfNestedElements () |
| vtkPVXMLElement * | GetNestedElement (unsigned int index) |
| vtkPVXMLElement * | FindNestedElement (const char *id) |
| vtkPVXMLElement * | FindNestedElementByName (const char *name) |
| void | FindNestedElementByName (const char *name, vtkCollection *elements) |
| void | RemoveAllNestedElements () |
| void | RemoveNestedElement (vtkPVXMLElement *) |
| void | ReplaceNestedElement (vtkPVXMLElement *elementToReplace, vtkPVXMLElement *element) |
| vtkPVXMLElement * | LookupElement (const char *id) |
| void | AddAttribute (const char *attrName, const char *attrValue) |
| void | AddAttribute (const char *attrName, unsigned int attrValue) |
| void | AddAttribute (const char *attrName, double attrValue) |
| void | AddAttribute (const char *attrName, double attrValue, int precision) |
| void | AddAttribute (const char *attrName, int attrValue) |
| void | RemoveAttribute (const char *attrName) |
| void | SetAttribute (const char *attrName, const char *attrValue) |
| void | AddNestedElement (vtkPVXMLElement *element, int setPrent) |
| void | AddNestedElement (vtkPVXMLElement *element) |
| void | PrintXML (ostream &os, vtkIndent indent) |
| void | PrintXML () |
| void | Merge (vtkPVXMLElement *element, const char *attributeName) |
| void | GetElementsByName (const char *name, vtkCollection *elements) |
| void | GetElementsByName (const char *name, vtkCollection *elements, bool recursively) |
| bool | Equals (vtkPVXMLElement *other) |
| void | CopyTo (vtkPVXMLElement *other) |
| void | CopyAttributesTo (vtkPVXMLElement *other) |
Static Public Member Functions | |
| static vtkPVXMLElement * | New () |
| static std::string | Encode (const char *plaintext) |
Protected Member Functions | |
| vtkPVXMLElement () | |
| ~vtkPVXMLElement () override | |
| vtkSetStringMacro (Id) | |
| void | ReadXMLAttributes (const char **atts) |
| void | AddCharacterData (const char *data, int length) |
| vtkPVXMLElement * | LookupElementInScope (const char *id) |
| vtkPVXMLElement * | LookupElementUpScope (const char *id) |
| void | SetParent (vtkPVXMLElement *parent) |
Protected Attributes | |
| char * | Name |
| char * | Id |
| vtkPVXMLElement * | Parent |
Definition at line 20 of file vtkPVXMLElement.h.
|
protected |
Definition at line 56 of file vtkPVXMLElement.cxx.
|
overrideprotected |
Definition at line 66 of file vtkPVXMLElement.cxx.
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| const char * | attrValue | ||
| ) |
Given it's name and value, add an attribute.
Definition at line 140 of file vtkPVXMLElement.cxx.
Referenced by AddAttribute(), Merge(), ReadXMLAttributes(), and SetAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| double | attrValue | ||
| ) |
Definition at line 117 of file vtkPVXMLElement.cxx.
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| double | attrValue, | ||
| int | precision | ||
| ) |
Definition at line 125 of file vtkPVXMLElement.cxx.
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| int | attrValue | ||
| ) |
Definition at line 99 of file vtkPVXMLElement.cxx.
References AddAttribute().
| void vtkPVXMLElement::AddAttribute | ( | const char * | attrName, |
| unsigned int | attrValue | ||
| ) |
Definition at line 91 of file vtkPVXMLElement.cxx.
References AddAttribute().
|
protected |
Definition at line 250 of file vtkPVXMLElement.cxx.
References data.
Referenced by vtkPVXMLParser::CharacterDataHandler(), CopyAttributesTo(), and CopyTo().
| void vtkPVXMLElement::AddNestedElement | ( | vtkPVXMLElement * | element | ) |
Definition at line 234 of file vtkPVXMLElement.cxx.
References AddNestedElement().
| 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.
Definition at line 240 of file vtkPVXMLElement.cxx.
References SetParent().
Referenced by AddNestedElement(), CopyTo(), vtkPVXMLParser::EndElement(), and Merge().
| void vtkPVXMLElement::CopyAttributesTo | ( | vtkPVXMLElement * | other | ) |
Copy the attributes from current XML element content into the provided one.
Definition at line 742 of file vtkPVXMLElement.cxx.
References AddCharacterData().
| void vtkPVXMLElement::CopyTo | ( | vtkPVXMLElement * | other | ) |
Copy the current XML element content into the provided one
Definition at line 721 of file vtkPVXMLElement.cxx.
References AddCharacterData(), and AddNestedElement().
|
static |
Encode a string.
Definition at line 593 of file vtkPVXMLElement.cxx.
References SNPRINTF.
Referenced by PrintXML().
| 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.
Definition at line 753 of file vtkPVXMLElement.cxx.
References PrintXML().
| 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.
Definition at line 365 of file vtkPVXMLElement.cxx.
Referenced by LookupElementInScope(), and LookupElementUpScope().
| vtkPVXMLElement * vtkPVXMLElement::FindNestedElementByName | ( | const char * | name | ) |
Locate a nested element with the given tag name.
Definition at line 381 of file vtkPVXMLElement.cxx.
References name.
| void vtkPVXMLElement::FindNestedElementByName | ( | const char * | name, |
| vtkCollection * | elements | ||
| ) |
Locate a set of nested elements with the given tag name.
Definition at line 397 of file vtkPVXMLElement.cxx.
References GetElementsByName().
|
inline |
Get the attribute with the given name. If it doesn't exist, returns NULL.
Definition at line 47 of file vtkPVXMLElement.h.
Referenced by GetVectorAttribute(), Merge(), and vtkPVXMLParser::StartElement().
| const char * vtkPVXMLElement::GetAttributeOrDefault | ( | const char * | name, |
| const char * | notFound | ||
| ) |
Get the attribute with the given name. If it doesn't exist, returns the provided notFound value.
Definition at line 256 of file vtkPVXMLElement.cxx.
References name.
|
inline |
Get the attribute with the given name. If it doesn't exist, returns "".
Definition at line 55 of file vtkPVXMLElement.h.
References name.
| const char * vtkPVXMLElement::GetCharacterData | ( | ) |
Get the character data for the element.
Definition at line 270 of file vtkPVXMLElement.cxx.
Referenced by GetCharacterDataAsVector().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| double * | value | ||
| ) |
Definition at line 543 of file vtkPVXMLElement.cxx.
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| float * | value | ||
| ) |
Definition at line 537 of file vtkPVXMLElement.cxx.
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetCharacterDataAsVector | ( | int | length, |
| int * | value | ||
| ) |
Get the character data converted to a scalar value. Returns length of vector read.
Definition at line 531 of file vtkPVXMLElement.cxx.
References data, GetCharacterData(), and vtkPVXMLVectorAttributeParse().
| 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.
Definition at line 549 of file vtkPVXMLElement.cxx.
Referenced by FindNestedElementByName(), and GetElementsByName().
| void vtkPVXMLElement::GetElementsByName | ( | const char * | name, |
| vtkCollection * | elements, | ||
| bool | recursively | ||
| ) |
Definition at line 555 of file vtkPVXMLElement.cxx.
References GetElementsByName(), GetNestedElement(), GetNumberOfNestedElements(), and name.
| vtkPVXMLElement * vtkPVXMLElement::GetNestedElement | ( | unsigned int | index | ) |
Get the element nested in this one at the given index.
Definition at line 349 of file vtkPVXMLElement.cxx.
Referenced by GetElementsByName(), and PrintSelf().
| unsigned int vtkPVXMLElement::GetNumberOfNestedElements | ( | ) |
Get the number of elements nested in this one.
Definition at line 343 of file vtkPVXMLElement.cxx.
Referenced by GetElementsByName(), and PrintSelf().
| vtkPVXMLElement * vtkPVXMLElement::GetParent | ( | ) |
Get the parent of this element.
Definition at line 337 of file vtkPVXMLElement.cxx.
References Parent.
Referenced by LookupElementUpScope().
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| double * | value | ||
| ) |
Definition at line 469 of file vtkPVXMLElement.cxx.
References GetVectorAttribute().
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| float * | value | ||
| ) |
Definition at line 463 of file vtkPVXMLElement.cxx.
References GetVectorAttribute().
| int vtkPVXMLElement::GetScalarAttribute | ( | const char * | name, |
| int * | value | ||
| ) |
Get the attribute with the given name converted to a scalar value. Returns whether value was extracted.
Definition at line 457 of file vtkPVXMLElement.cxx.
References GetVectorAttribute().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| double * | value | ||
| ) |
Definition at line 517 of file vtkPVXMLElement.cxx.
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| float * | value | ||
| ) |
Definition at line 511 of file vtkPVXMLElement.cxx.
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
| int vtkPVXMLElement::GetVectorAttribute | ( | const char * | name, |
| int | length, | ||
| int * | value | ||
| ) |
Get the attribute with the given name converted to a scalar value. Returns length of vector read.
Definition at line 505 of file vtkPVXMLElement.cxx.
References data, GetAttribute(), and vtkPVXMLVectorAttributeParse().
Referenced by GetScalarAttribute().
| vtkPVXMLElement * vtkPVXMLElement::LookupElement | ( | const char * | id | ) |
Lookup the element with the given id, starting at this scope.
Definition at line 359 of file vtkPVXMLElement.cxx.
References LookupElementUpScope().
|
protected |
Definition at line 404 of file vtkPVXMLElement.cxx.
References FindNestedElement(), name, and next.
Referenced by LookupElementUpScope().
|
protected |
Definition at line 428 of file vtkPVXMLElement.cxx.
References FindNestedElement(), GetParent(), LookupElementInScope(), and name.
Referenced by LookupElement().
| 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.
Definition at line 640 of file vtkPVXMLElement.cxx.
References AddAttribute(), AddNestedElement(), GetAttribute(), and NULL.
|
static |
Referenced by vtkPVXMLParser::StartElement().
|
override |
Definition at line 75 of file vtkPVXMLElement.cxx.
References QtCompat::endl(), GetNestedElement(), GetNumberOfNestedElements(), Id, Name, and PrintSelf().
Referenced by PrintSelf().
| void vtkPVXMLElement::PrintXML | ( | ) |
Definition at line 276 of file vtkPVXMLElement.cxx.
Referenced by Equals().
| void vtkPVXMLElement::PrintXML | ( | ostream & | os, |
| vtkIndent | indent | ||
| ) |
Serialize (as XML) in the given stream.
Definition at line 282 of file vtkPVXMLElement.cxx.
References Encode(), Name, and vtkIsSpace().
Referenced by Equals(), and vtkPVXMLParser::PrintXML().
|
protected |
Definition at line 175 of file vtkPVXMLElement.cxx.
References AddAttribute(), and count.
Referenced by vtkPVXMLParser::StartElement().
| void vtkPVXMLElement::RemoveAllNestedElements | ( | ) |
Removes all nested elements.
Definition at line 199 of file vtkPVXMLElement.cxx.
| void vtkPVXMLElement::RemoveAttribute | ( | const char * | attrName | ) |
Remove the attribute from the current element
Definition at line 771 of file vtkPVXMLElement.cxx.
References name.
| void vtkPVXMLElement::RemoveNestedElement | ( | vtkPVXMLElement * | element | ) |
Remove a particular element.
Definition at line 205 of file vtkPVXMLElement.cxx.
| void vtkPVXMLElement::ReplaceNestedElement | ( | vtkPVXMLElement * | elementToReplace, |
| vtkPVXMLElement * | element | ||
| ) |
Replace a particular element with another
Definition at line 220 of file vtkPVXMLElement.cxx.
| void vtkPVXMLElement::SetAttribute | ( | const char * | attrName, |
| const char * | attrValue | ||
| ) |
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 "
Definition at line 152 of file vtkPVXMLElement.cxx.
References AddAttribute().
|
protected |
Definition at line 331 of file vtkPVXMLElement.cxx.
References Parent.
Referenced by AddNestedElement().
| vtkPVXMLElement::vtkGetStringMacro | ( | Id | ) |
Get the id of the element. This is assigned by the XML parser and can be used as an identifier to an element.
| vtkPVXMLElement::vtkGetStringMacro | ( | Name | ) |
|
protected |
| vtkPVXMLElement::vtkSetStringMacro | ( | Name | ) |
Set/Get the name of the element. This is its XML tag. (<Name/>).
| vtkPVXMLElement::vtkTypeMacro | ( | vtkPVXMLElement | , |
| vtkObject | |||
| ) |
|
protected |
Definition at line 262 of file vtkPVXMLElement.h.
Referenced by PrintSelf(), and vtkPVXMLElement().
|
protected |
Definition at line 261 of file vtkPVXMLElement.h.
Referenced by PrintSelf(), PrintXML(), and vtkPVXMLElement().
|
protected |
Definition at line 265 of file vtkPVXMLElement.h.
Referenced by GetParent(), SetParent(), and vtkPVXMLElement().