Commit 17d11447 authored by Brad King's avatar Brad King 💬
Browse files

ENH: Added GetAttributeValue method to get an attribute's value by its index.

parent 9d09ec6f
......@@ -21,7 +21,7 @@
#include <ctype.h>
vtkCxxRevisionMacro(vtkXMLDataElement, "1.13");
vtkCxxRevisionMacro(vtkXMLDataElement, "1.14");
vtkStandardNewMacro(vtkXMLDataElement);
//----------------------------------------------------------------------------
......@@ -225,6 +225,17 @@ const char* vtkXMLDataElement::GetAttributeName(int idx)
return this->AttributeNames[idx];
}
//----------------------------------------------------------------------------
const char* vtkXMLDataElement::GetAttributeValue(int idx)
{
if (idx < 0 || idx >= this->NumberOfAttributes)
{
return 0;
}
return this->AttributeValues[idx];
}
//----------------------------------------------------------------------------
void vtkXMLDataElement::PrintXML(ostream& os, vtkIndent indent)
{
......
......@@ -115,6 +115,11 @@ public:
// Returns 0 if there is no such attribute.
const char* GetAttributeName(int idx);
// Description:
// Get the n-th attribute value.
// Returns 0 if there is no such attribute.
const char* GetAttributeValue(int idx);
// Description:
// Remove all attributes.
virtual void RemoveAllAttributes();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment