22 #ifndef vtkPVXMLElement_h 23 #define vtkPVXMLElement_h 25 #include "vtkObject.h" 26 #include "vtkPVCommonModule.h" 27 #include "vtkStdString.h" 32 struct vtkPVXMLElementInternals;
38 void PrintSelf(ostream& os, vtkIndent indent);
46 vtkSetStringMacro(Name);
47 vtkGetStringMacro(Name);
55 vtkGetStringMacro(Id);
62 const char*
GetAttribute(
const char* name) {
return this->GetAttributeOrDefault(name, NULL); }
70 return this->GetAttributeOrDefault(name,
"");
77 const char* GetAttributeOrDefault(
const char* name,
const char* notFound);
82 const char* GetCharacterData();
89 int GetScalarAttribute(
const char* name,
int* value);
90 int GetScalarAttribute(
const char* name,
float* value);
91 int GetScalarAttribute(
const char* name,
double* value);
92 #if defined(VTK_USE_64BIT_IDS) 93 int GetScalarAttribute(
const char* name, vtkIdType* value);
102 int GetVectorAttribute(
const char* name,
int length,
int* value);
103 int GetVectorAttribute(
const char* name,
int length,
float* value);
104 int GetVectorAttribute(
const char* name,
int length,
double* value);
105 #if defined(VTK_USE_64BIT_IDS) 106 int GetVectorAttribute(
const char* name,
int length, vtkIdType* value);
115 int GetCharacterDataAsVector(
int length,
int* value);
116 int GetCharacterDataAsVector(
int length,
float* value);
117 int GetCharacterDataAsVector(
int length,
double* value);
118 #if defined(VTK_USE_64BIT_IDS) 119 int GetCharacterDataAsVector(
int length, vtkIdType* value);
131 unsigned int GetNumberOfNestedElements();
153 void FindNestedElementByName(
const char* name, vtkCollection* elements);
158 void RemoveAllNestedElements();
174 void AddAttribute(
const char* attrName,
const char* attrValue);
175 void AddAttribute(
const char* attrName,
unsigned int attrValue);
176 void AddAttribute(
const char* attrName,
double attrValue);
177 void AddAttribute(
const char* attrName,
double attrValue,
int precision);
178 void AddAttribute(
const char* attrName,
int attrValue);
179 #if defined(VTK_USE_64BIT_IDS) 180 void AddAttribute(
const char* attrName, vtkIdType attrValue);
187 void RemoveAttribute(
const char* attrName);
196 void SetAttribute(
const char* attrName,
const char* attrValue);
212 void PrintXML(ostream& os, vtkIndent indent);
234 void GetElementsByName(
const char* name, vtkCollection* elements);
235 void GetElementsByName(
const char* name, vtkCollection* elements,
bool recursively);
241 static vtkStdString Encode(
const char* plaintext);
273 vtkSetStringMacro(Id);
274 void ReadXMLAttributes(
const char** atts);
275 void AddCharacterData(
const char* data,
int length);
const char * GetAttributeOrEmpty(const char *name)
Get the attribute with the given name.
const char * GetAttribute(const char *name)
Get the attribute with the given name.
vtkPVXMLElementInternals * Internal
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
This is a subclass of vtkXMLParser that constructs a representation of parsed XML using vtkPVXMLEleme...