ParaView
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
vtkPVXMLElement Class Reference

#include <vtkPVXMLElement.h>

Inheritance diagram for vtkPVXMLElement:
Inheritance graph
[legend]
Collaboration diagram for vtkPVXMLElement:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual const char * GetClassName ()
virtual int IsA (const char *type)
void PrintSelf (ostream &os, vtkIndent indent)
const char * GetAttributeOrDefault (const char *name, const char *notFound)
const char * GetCharacterData ()
vtkPVXMLElementGetParent ()
unsigned int GetNumberOfNestedElements ()
vtkPVXMLElementGetNestedElement (unsigned int index)
vtkPVXMLElementFindNestedElement (const char *id)
vtkPVXMLElementFindNestedElementByName (const char *name)
void FindNestedElementByName (const char *name, vtkCollection *elements)
void RemoveAllNestedElements ()
void RemoveNestedElement (vtkPVXMLElement *)
vtkPVXMLElementLookupElement (const char *id)
void RemoveAttribute (const char *attrName)
void SetAttribute (const char *attrName, const char *attrValue)
void Merge (vtkPVXMLElement *element, const char *attributeName)
bool Equals (vtkPVXMLElement *other)
void CopyTo (vtkPVXMLElement *other)
void CopyAttributesTo (vtkPVXMLElement *other)
virtual void SetName (const char *)
virtual char * GetName ()
virtual char * GetId ()
const char * GetAttribute (const char *name)
const char * GetAttributeOrEmpty (const char *name)
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)
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 AddNestedElement (vtkPVXMLElement *element, int setPrent)
void AddNestedElement (vtkPVXMLElement *element)
void PrintXML (ostream &os, vtkIndent indent)
void PrintXML ()
void GetElementsByName (const char *name, vtkCollection *elements)
void GetElementsByName (const char *name, vtkCollection *elements, bool recursively)

Static Public Member Functions

static int IsTypeOf (const char *type)
static vtkPVXMLElementSafeDownCast (vtkObject *o)
static vtkPVXMLElementNew ()
static vtkStdString Encode (const char *plaintext)

Protected Member Functions

 vtkPVXMLElement ()
 ~vtkPVXMLElement ()
virtual void SetId (const char *)
void ReadXMLAttributes (const char **atts)
void AddCharacterData (const char *data, int length)
vtkPVXMLElementLookupElementInScope (const char *id)
vtkPVXMLElementLookupElementUpScope (const char *id)
void SetParent (vtkPVXMLElement *parent)

Protected Attributes

vtkPVXMLElementInternals * Internal
char * Name
char * Id
vtkPVXMLElementParent

Friends

class vtkPVXMLParser

Detailed Description

This is used by vtkPVXMLParser to represent an XML document starting at the root element.

Definition at line 34 of file vtkPVXMLElement.h.


Constructor & Destructor Documentation

vtkPVXMLElement::vtkPVXMLElement ( ) [protected]
vtkPVXMLElement::~vtkPVXMLElement ( ) [protected]

Member Function Documentation

virtual const char* vtkPVXMLElement::GetClassName ( ) [virtual]

Reimplemented from vtkObject.

static int vtkPVXMLElement::IsTypeOf ( const char *  type) [static]

Reimplemented from vtkObject.

virtual int vtkPVXMLElement::IsA ( const char *  type) [virtual]

Reimplemented from vtkObject.

static vtkPVXMLElement* vtkPVXMLElement::SafeDownCast ( vtkObject o) [static]

Reimplemented from vtkObject.

void vtkPVXMLElement::PrintSelf ( ostream &  os,
vtkIndent  indent 
) [virtual]

Reimplemented from vtkObject.

static vtkPVXMLElement* vtkPVXMLElement::New ( ) [static]

Reimplemented from vtkObject.

virtual void vtkPVXMLElement::SetName ( const char *  ) [virtual]

Set/Get the name of the element. This is its XML tag. (<Name>).

virtual char* vtkPVXMLElement::GetName ( ) [virtual]

Set/Get the name of the element. This is its XML tag. (<Name>).

virtual char* vtkPVXMLElement::GetId ( ) [virtual]

Get the id of the element. This is assigned by the XML parser and can be used as an identifier to an element.

const char* vtkPVXMLElement::GetAttribute ( const char *  name) [inline]

Get the attribute with the given name. If it doesn't exist, returns NULL.

Definition at line 56 of file vtkPVXMLElement.h.

const char* vtkPVXMLElement::GetAttributeOrEmpty ( const char *  name) [inline]

Get the attribute with the given name. If it doesn't exist, returns "".

Definition at line 63 of file vtkPVXMLElement.h.

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.

const char* vtkPVXMLElement::GetCharacterData ( )

Get the character data for the element.

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.

int vtkPVXMLElement::GetScalarAttribute ( const char *  name,
float value 
)

Get the attribute with the given name converted to a scalar value. Returns whether value was extracted.

int vtkPVXMLElement::GetScalarAttribute ( const char *  name,
double value 
)

Get the attribute with the given name converted to a scalar value. Returns whether value was extracted.

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.

int vtkPVXMLElement::GetVectorAttribute ( const char *  name,
int  length,
float value 
)

Get the attribute with the given name converted to a scalar value. Returns length of vector read.

int vtkPVXMLElement::GetVectorAttribute ( const char *  name,
int  length,
double value 
)

Get the attribute with the given name converted to a scalar value. Returns length of vector read.

int vtkPVXMLElement::GetCharacterDataAsVector ( int  length,
int value 
)

Get the character data converted to a scalar value. Returns length of vector read.

int vtkPVXMLElement::GetCharacterDataAsVector ( int  length,
float value 
)

Get the character data converted to a scalar value. Returns length of vector read.

int vtkPVXMLElement::GetCharacterDataAsVector ( int  length,
double value 
)

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.

vtkPVXMLElement* vtkPVXMLElement::LookupElement ( const char *  id)

Lookup the element with the given id, starting at this scope.

void vtkPVXMLElement::AddAttribute ( const char *  attrName,
const char *  attrValue 
)

Given it's name and value, add an attribute.

void vtkPVXMLElement::AddAttribute ( const char *  attrName,
unsigned int  attrValue 
)

Given it's name and value, add an attribute.

void vtkPVXMLElement::AddAttribute ( const char *  attrName,
double  attrValue 
)

Given it's name and value, add an attribute.

void vtkPVXMLElement::AddAttribute ( const char *  attrName,
double  attrValue,
int  precision 
)

Given it's name and value, add an attribute.

void vtkPVXMLElement::AddAttribute ( const char *  attrName,
int  attrValue 
)

Given it's name and value, add an attribute.

void vtkPVXMLElement::RemoveAttribute ( const char *  attrName)

Remove the attribute from the current element

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 "

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 sepecific 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 sepecific 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 vtkStdString vtkPVXMLElement::Encode ( const char *  plaintext) [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.

virtual void vtkPVXMLElement::SetId ( const char *  ) [protected, virtual]
void vtkPVXMLElement::ReadXMLAttributes ( const char **  atts) [protected]
void vtkPVXMLElement::AddCharacterData ( const char *  data,
int  length 
) [protected]
vtkPVXMLElement* vtkPVXMLElement::LookupElementInScope ( const char *  id) [protected]
vtkPVXMLElement* vtkPVXMLElement::LookupElementUpScope ( const char *  id) [protected]
void vtkPVXMLElement::SetParent ( vtkPVXMLElement parent) [protected]

Friends And Related Function Documentation

friend class vtkPVXMLParser [friend]

Definition at line 228 of file vtkPVXMLElement.h.


Member Data Documentation

vtkPVXMLElementInternals* vtkPVXMLElement::Internal [protected]

Definition at line 208 of file vtkPVXMLElement.h.

char* vtkPVXMLElement::Name [protected]

Definition at line 210 of file vtkPVXMLElement.h.

char* vtkPVXMLElement::Id [protected]

Definition at line 211 of file vtkPVXMLElement.h.

Definition at line 214 of file vtkPVXMLElement.h.


The documentation for this class was generated from the following file: