[vtkusers] additional function for vtkXMLDataElementclass

Maarten Beek beekmaarten at yahoo.com
Thu Dec 12 15:39:08 EST 2013


Would the following function not be useful in the vtkXMLDataElement class?

vtkXMLDataElement* vtkXMLDataElement::GetNestedElementWithName(const char* name, int* index=NULL)
{
    if( !name )
    {
        return 0;
    }
    
    int i = 0;
    if( index ) { i = *index; }
    for( ; i < this->NumberOfNestedElements; ++i )
    {
        const char* nname = this->NestedElements[i]->GetName();
        if( nname && (strcmp(nname, name) == 0) )
        {
            if( index ) { *index = i+1; }
            return this->NestedElements[i];
        }
    }
    return 0;
}

Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131212/d8b0a62b/attachment.htm>


More information about the vtkusers mailing list