libSBML Perl API  libSBML 5.8.0 Perl API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XMLAttributes Class Reference

Detailed Description

Representation of attributes on an XML node.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

Public Member Functions

int add (const std::string &name, const std::string &value, const std::string &namespaceURI="", const std::string &prefix="")
 Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace. More...
 
int add (const XMLTriple &triple, const std::string &value)
 Adds an attribute with the given XMLTriple/value pair to this XMLAttributes set. More...
 
int clear ()
 Clears (deletes) all attributes in this XMLAttributes object. More...
 
XMLAttributesclone () const
 Creates and returns a deep copy of this XMLAttributes set. More...
 
int getIndex (const std::string &name) const
 Return the index of an attribute with the given name. More...
 
int getIndex (const std::string &name, const std::string &uri) const
 Return the index of an attribute with the given local name and namespace URI. More...
 
int getIndex (const XMLTriple &triple) const
 Return the index of an attribute with the given XMLTriple. More...
 
int getLength () const
 Return the number of attributes in the set. More...
 
std::string getName (int index) const
 Return the local name of an attribute in this XMLAttributes set (by position). More...
 
int getNumAttributes () const
 Return the number of attributes in the set. More...
 
std::string getPrefix (int index) const
 Return the prefix of an attribute in this XMLAttributes set (by position). More...
 
std::string getPrefixedName (int index) const
 Return the prefixed name of an attribute in this XMLAttributes set (by position). More...
 
std::string getURI (int index) const
 Return the namespace URI of an attribute in this XMLAttributes set (by position). More...
 
std::string getValue (int index) const
 Return the value of an attribute in this XMLAttributes set (by position). More...
 
std::string getValue (const std::string name) const
 Return an attribute's value by name. More...
 
std::string getValue (const std::string name, const std::string uri) const
 Return a value of an attribute with the given local name and namespace URI. More...
 
std::string getValue (const XMLTriple &triple) const
 Return a value of an attribute with the given XMLTriple. More...
 
bool hasAttribute (int index) const
 Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes. More...
 
bool hasAttribute (const std::string name, const std::string uri="") const
 Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes. More...
 
bool hasAttribute (const XMLTriple &triple) const
 Predicate returning true or false depending on whether an attribute with the given XML triple exists in this XMLAttributes. More...
 
bool isEmpty () const
 Predicate returning true or false depending on whether this XMLAttributes set is empty. More...
 
XMLAttributesoperator= (const XMLAttributes &rhs)
 Assignment operator for XMLAttributes. More...
 
bool readInto (const std::string &name, bool &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, bool &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute with the given XMLTriple into value. More...
 
bool readInto (const std::string &name, double &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, double &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute with the given XMLTriple into value. More...
 
bool readInto (const std::string &name, long &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, long &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute XMLTriple into value. More...
 
bool readInto (const std::string &name, int &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, int &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute with the given XMLTriple into value. More...
 
bool readInto (const std::string &name, unsigned int &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, unsigned int &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute with the given XMLTriple into value. More...
 
bool readInto (const std::string &name, std::string &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute name into value. More...
 
bool readInto (const XMLTriple &triple, std::string &value, XMLErrorLog *log=NULL, bool required=false, const unsigned int line=0, const unsigned int column=0) const
 Reads the value for the attribute with the given XMLTriple into value. More...
 
int remove (int n)
 Removes an attribute with the given index from this XMLAttributes set. More...
 
int remove (const std::string &name, const std::string &uri="")
 Removes an attribute with the given local name and namespace URI from this XMLAttributes set. More...
 
int remove (const XMLTriple &triple)
 Removes an attribute with the given XMLTriple from this XMLAttributes set. More...
 
int removeResource (int n)
 Removes an attribute with the given index from this XMLAttributes set. More...
 
 XMLAttributes ()
 Creates a new empty XMLAttributes set. More...
 
 XMLAttributes (const XMLAttributes &orig)
 Copy constructor; creates a copy of this XMLAttributes set. More...
 
virtual ~XMLAttributes ()
 Destroys this XMLAttributes set. More...
 

Constructor & Destructor Documentation

XMLAttributes::XMLAttributes ( )

Creates a new empty XMLAttributes set.

XMLAttributes::~XMLAttributes ( )
virtual

Destroys this XMLAttributes set.

XMLAttributes::XMLAttributes ( const XMLAttributes orig)

Copy constructor; creates a copy of this XMLAttributes set.

orig the XMLAttributes object to copy.

Exceptions
XMLConstructorExceptionThrown if the argument orig is NULL.

Member Function Documentation

int XMLAttributes::add ( const std::string &  name,
const std::string &  value,
const std::string &  namespaceURI = "",
const std::string &  prefix = "" 
)

Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
namespaceURIa string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace
Returns
an integer code indicating the success or failure of the function. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
int XMLAttributes::add ( const XMLTriple triple,
const std::string &  value 
)

Adds an attribute with the given XMLTriple/value pair to this XMLAttributes set.

Note
if local name with the same namespace URI already exists in this attribute set, its value and prefix will be replaced.
Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea string, the value of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int XMLAttributes::clear ( )

Clears (deletes) all attributes in this XMLAttributes object.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
XMLAttributes * XMLAttributes::clone ( ) const

Creates and returns a deep copy of this XMLAttributes set.

Returns
a (deep) copy of this XMLAttributes set.
int XMLAttributes::getIndex ( const std::string &  name) const

Return the index of an attribute with the given name.

Note
A namespace bound to the name is not checked by this function. Thus, if there are multiple attributes with the given local name and different namespaces, the smallest index among those attributes will be returned. XMLAttributes::getIndex(const std::string& name, const std::string& uri) const or XMLAttributes::getIndex(const XMLTriple& triple) const should be used to get an index of an attribute with the given local name and namespace.
Parameters
namea string, the local name of the attribute for which the index is required.
Returns
the index of an attribute with the given local name, or -1 if not present.
int XMLAttributes::getIndex ( const std::string &  name,
const std::string &  uri 
) const

Return the index of an attribute with the given local name and namespace URI.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
the index of an attribute with the given local name and namespace URI, or -1 if not present.
int XMLAttributes::getIndex ( const XMLTriple triple) const

Return the index of an attribute with the given XMLTriple.

Parameters
triplean XMLTriple, the XML triple of the attribute for which the index is required.
Returns
the index of an attribute with the given XMLTriple, or -1 if not present.
int XMLAttributes::getLength ( ) const

Return the number of attributes in the set.

Returns
the number of attributes in this XMLAttributes set.
std::string XMLAttributes::getName ( int  index) const

Return the local name of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose local name is required.
Returns
the local name of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) const to test for the attribute existence.
int XMLAttributes::getNumAttributes ( ) const

Return the number of attributes in the set.

Returns
the number of attributes in this XMLAttributes set.

This function is an alias for getLength introduced for consistency with other XML classes.

std::string XMLAttributes::getPrefix ( int  index) const

Return the prefix of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose prefix is required.
Returns
the namespace prefix of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) const to test for the attribute existence.
std::string XMLAttributes::getPrefixedName ( int  index) const

Return the prefixed name of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose prefixed name is required.
Returns
the prefixed name of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) const to test for attribute existence.
std::string XMLAttributes::getURI ( int  index) const

Return the namespace URI of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose namespace URI is required.
Returns
the namespace URI of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) const to test for attribute existence.
std::string XMLAttributes::getValue ( int  index) const

Return the value of an attribute in this XMLAttributes set (by position).

Parameters
indexan integer, the position of the attribute whose value is required.
Returns
the value of an attribute in the list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLAttributes::hasAttribute(int index) const to test for attribute existence.
std::string XMLAttributes::getValue ( const std::string  name) const

Return an attribute's value by name.

Parameters
namea string, the local name of the attribute whose value is required.
Returns
The attribute value as a string.
Note
If an attribute with the given local name does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(const std::string name, const std::string uri) const to test for attribute existence. A namespace bound to the local name is not checked by this function. Thus, if there are multiple attributes with the given local name and different namespaces, the value of an attribute with the smallest index among those attributes will be returned. XMLAttributes::getValue(const std::string name) const or XMLAttributes::getValue(const XMLTriple& triple) const should be used to get a value of an attribute with the given local name and namespace.
std::string XMLAttributes::getValue ( const std::string  name,
const std::string  uri 
) const

Return a value of an attribute with the given local name and namespace URI.

Parameters
namea string, the local name of the attribute whose value is required.
uria string, the namespace URI of the attribute.
Returns
The attribute value as a string.
Note
If an attribute with the given local name and namespace URI does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(const std::string name, const std::string uri) const to test for attribute existence.
std::string XMLAttributes::getValue ( const XMLTriple triple) const

Return a value of an attribute with the given XMLTriple.

Parameters
triplean XMLTriple, the XML triple of the attribute whose value is required.
Returns
The attribute value as a string.
Note
If an attribute with the given XMLTriple does not exist, an empty string will be returned. Use XMLAttributes::hasAttribute(const XMLTriple& triple) const to test for attribute existence.
bool XMLAttributes::hasAttribute ( int  index) const

Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes.

Parameters
indexan integer, the position of the attribute.
Returns
true if an attribute with the given index exists in this XMLAttributes, false otherwise.
bool XMLAttributes::hasAttribute ( const std::string  name,
const std::string  uri = "" 
) const

Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
true if an attribute with the given local name and namespace URI exists in this XMLAttributes, false otherwise.
bool XMLAttributes::hasAttribute ( const XMLTriple triple) const

Predicate returning true or false depending on whether an attribute with the given XML triple exists in this XMLAttributes.

Parameters
triplean XMLTriple, the XML triple of the attribute
Returns
true if an attribute with the given XML triple exists in this XMLAttributes, false otherwise.
bool XMLAttributes::isEmpty ( ) const

Predicate returning true or false depending on whether this XMLAttributes set is empty.

Returns
true if this XMLAttributes set is empty, false otherwise.
XMLAttributes & XMLAttributes::operator= ( const XMLAttributes rhs)

Assignment operator for XMLAttributes.

Parameters
rhsThe XMLAttributes object whose values are used as the basis of the assignment.
Exceptions
XMLConstructorExceptionThrown if the argument rhs is NULL.
bool XMLAttributes::readInto ( const std::string &  name,
bool &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found or value could be interpreted as a boolean, value is not modified.

According to the W3C XML Schema, valid boolean values are: "true", "false", "1", and "0" (case-insensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#boolean

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
namea string, the local name of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, bool&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
bool &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute with the given XMLTriple into value.

If the XMLTriple was not found or value could be interpreted as a boolean, value is not modified.

According to the W3C XML Schema, valid boolean values are: "true", "false", "1", and "0" (case-insensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#boolean

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const std::string &  name,
double &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found or value could be interpreted as a double, value is not modified.

According to the W3C XML Schema, valid doubles are the same as valid doubles for C and the special values "INF", "-INF", and "NaN" (case-sensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#double

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
namea string, the local name of the attribute.
valuea double, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, double&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
double &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute with the given XMLTriple into value.

If the triple was not found or value could be interpreted as a double, value is not modified.

According to the W3C XML Schema, valid doubles are the same as valid doubles for C and the special values "INF", "-INF", and "NaN" (case-sensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#double

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea double, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const std::string &  name,
long &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found or value could be interpreted as an long, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a long. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
namea string, the local name of the attribute.
valuea long, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, long&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
long &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute XMLTriple into value.

If the XMLTriple was not found or value could be interpreted as a long, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a long. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea long, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const std::string &  name,
int &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found or value could be interpreted as an int, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
namea string, the local name of the attribute.
valuean integer, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, int&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
int &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute with the given XMLTriple into value.

If the XMLTriple was not found or value could be interpreted as an int, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuean integer, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const std::string &  name,
unsigned int &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found or value could be interpreted as an unsigned int, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a unsigned int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
namea string, the local name of the attribute.
valuean unsigned integer, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, unsigned int&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
unsigned int &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute with the given XMLTriple into value.

If the XMLTriple was not found or value could be interpreted as an unsigned int, value is not modified.

According to the W3C XML Schema valid integers include zero, *all* positive and *all* negative whole numbers. For practical purposes, we limit values to what can be stored in a unsigned int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer

If an XMLErrorLog is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuean unsigned integer, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const std::string &  name,
std::string &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute name into value.

If the given local name was not found, value is not modified.

If an XMLErrorLog is passed in and required is true, missing attributes are logged.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes::readInto(const XMLTriple, std::string&, ...) const should be used to read a value for an attribute name with a prefix and namespace.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
bool XMLAttributes::readInto ( const XMLTriple triple,
std::string &  value,
XMLErrorLog log = NULL,
bool  required = false,
const unsigned int  line = 0,
const unsigned int  column = 0 
) const

Reads the value for the attribute with the given XMLTriple into value.

If the XMLTriple was not found, value is not modified.

If an XMLErrorLog is passed in and required is true, missing attributes are logged.

Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea string, the value of the attribute.
logan XMLErrorLog, the error log.
requireda boolean, indicating whether the attribute is required.
linean unsigned int, the line number at which the error occured.
columnan unsigned int, the column number at which the error occured.
Returns
true if the attribute was read into value, false otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
int XMLAttributes::remove ( int  n)

Removes an attribute with the given index from this XMLAttributes set.

(This function is an alias of XMLAttributes::removeResource() ).

Parameters
nan integer the index of the resource to be deleted
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int XMLAttributes::remove ( const std::string &  name,
const std::string &  uri = "" 
)

Removes an attribute with the given local name and namespace URI from this XMLAttributes set.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int XMLAttributes::remove ( const XMLTriple triple)

Removes an attribute with the given XMLTriple from this XMLAttributes set.

Parameters
triplean XMLTriple, the XML triple of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int XMLAttributes::removeResource ( int  n)

Removes an attribute with the given index from this XMLAttributes set.

Parameters
nan integer the index of the resource to be deleted
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: