tinyxml2

Function QueryIntAttribute

Synopsis

#include <tinyxml2/tinyxml2.h>

XMLError tinyxml2::XMLElement::QueryIntAttribute(const char *name, int *value) const

Description

Given an attribute name, QueryIntAttribute() returns XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion can't be performed, or XML_NO_ATTRIBUTE if the attribute doesn't exist. If successful, the result of the conversion will be written to 'value'. If not successful, nothing will be written to 'value'. This allows you to provide default value:

int value = 10; QueryIntAttribute( "foo", &value ); // if "foo" isn't found, value will still be 10

Examples

//
//

Source

From lines 1270-1276 in tinyxml2.h

XMLError QueryIntAttribute( const char* name, int* value ) const                {
    const XMLAttribute* a = FindAttribute( name );
    if ( !a ) {
        return XML_NO_ATTRIBUTE;
    }
    return a->QueryIntValue( value );
}


Discussions

There are 0 discussions relevant for this page, and 0 discussions in the whole project.




Add Discussion

Log in to comment