10 #ifndef vtkPVXMLElement_h
11 #define vtkPVXMLElement_h
14 #include "vtkPVVTKExtensionsCoreModule.h"
21 struct vtkPVXMLElementInternals;
35 vtkSetStringMacro(Name);
36 vtkGetStringMacro(Name);
44 vtkGetStringMacro(Id);
51 const char*
GetAttribute(
const char* name) {
return this->GetAttributeOrDefault(
name,
nullptr); }
59 return this->GetAttributeOrDefault(
name,
"");
66 const char* GetAttributeOrDefault(
const char* name,
const char* notFound);
71 const char* GetCharacterData();
78 int GetScalarAttribute(
const char* name,
int* value);
79 int GetScalarAttribute(
const char* name,
float* value);
80 int GetScalarAttribute(
const char* name,
double* value);
81 #if defined(VTK_USE_64BIT_IDS)
82 int GetScalarAttribute(
const char* name,
vtkIdType* value);
91 int GetVectorAttribute(
const char* name,
int length,
int* value);
92 int GetVectorAttribute(
const char* name,
int length,
float* value);
93 int GetVectorAttribute(
const char* name,
int length,
double* value);
94 #if defined(VTK_USE_64BIT_IDS)
95 int GetVectorAttribute(
const char* name,
int length,
vtkIdType* value);
104 int GetCharacterDataAsVector(
int length,
int* value);
105 int GetCharacterDataAsVector(
int length,
float* value);
106 int GetCharacterDataAsVector(
int length,
double* value);
107 #if defined(VTK_USE_64BIT_IDS)
108 int GetCharacterDataAsVector(
int length,
vtkIdType* value);
120 unsigned int GetNumberOfNestedElements();
142 void FindNestedElementByName(
const char* name,
vtkCollection* elements);
147 void RemoveAllNestedElements();
168 void AddAttribute(
const char* attrName,
const char* attrValue);
169 void AddAttribute(
const char* attrName,
unsigned int attrValue);
170 void AddAttribute(
const char* attrName,
double attrValue);
171 void AddAttribute(
const char* attrName,
double attrValue,
int precision);
172 void AddAttribute(
const char* attrName,
int attrValue);
173 #if defined(VTK_USE_64BIT_IDS)
174 void AddAttribute(
const char* attrName,
vtkIdType attrValue);
181 void RemoveAttribute(
const char* attrName);
190 void SetAttribute(
const char* attrName,
const char* attrValue);
206 void PrintXML(ostream& os,
vtkIndent indent);
228 void GetElementsByName(
const char* name,
vtkCollection* elements);
229 void GetElementsByName(
const char* name,
vtkCollection* elements,
bool recursively);
235 static std::string Encode(
const char* plaintext);
267 vtkSetStringMacro(Id);
268 void ReadXMLAttributes(
const char** atts);
269 void AddCharacterData(
const char* data,
int length);