head 1.4; access; symbols; locks; strict; comment @# @; 1.4 date 2002.09.07.01.50.37; author curt; state Exp; branches; next 1.3; 1.3 date 2002.08.31.19.01.51; author curt; state Exp; branches; next 1.2; 1.2 date 2002.08.31.18.53.59; author curt; state Exp; branches; next 1.1; 1.1 date 2002.02.15.17.21.55; author curt; state Exp; branches; next ; desc @@ 1.4 log @Updated doxygen docs. @ text @
Main Page Class Hierarchy Compound List File List Compound Members File Members

# XMLAttributes Class Reference

Interface for XML attributes. More...

`#include <easyxml.hxx>`

Inheritance diagram for XMLAttributes:

List of all members.

## Public Methods
| XMLAttributes ()
| Constructor.
virtual | ~XMLAttributes ()
| Destructor.
virtual int | size () const=0
| Get the number of attributes present.
virtual const char * | getName (int i) const=0
| Get the name of an attribute by index.
virtual const char * | getValue (int i) const=0
| Get the string value of an attribute by index.
virtual int | findAttribute (const char *name) const
| Look up the index of an attribute by name.
virtual bool | hasAttribute (const char *name) const
| Test whether an attribute is present.
virtual const char * | getValue (const char *name) const
| Look up the value of an attribute by name.

## Detailed Description

Interface for XML attributes.

This interface is used to provide a list of attributes to the application. The interface is a pure abstract class so that different implementations can be substituted for the sake of efficiency.

See also:
  XMLAttributesDefault

Definition at line 36 of file easyxml.hxx.

## Member Function Documentation

int XMLAttributes::findAttribute | ( | const char * | name | ) | const`[virtual]`

  | Look up the index of an attribute by name. Attribute names must be unique. This method will return an index that can be used with the method if the attribute is found. Parameters:
  name | The name of the attribute.
Returns: The index of the attribute with the name specified, or -1 if no such attribute is present in the list. Definition at line 31 of file easyxml.cxx. References getName(), and size(). Referenced by getValue(), hasAttribute(), and XMLAttributesDefault::setValue().

virtual const char* XMLAttributes::getName | ( | int | i | ) | const`[pure virtual]`

  | Get the name of an attribute by index. The index must be less than the size of the list and greater than or equal to zero. Parameters:
  i | The index of the attribute (zero-based).
See also: size Implemented in XMLAttributesDefault. Referenced by findAttribute(), and XMLAttributesDefault::XMLAttributesDefault().

const char * XMLAttributes::getValue | ( | const char * | name | ) | const`[virtual]`

  | Look up the value of an attribute by name. This method provides a convenient short-cut to invoking findAttribute and . Parameters:
  name | The name of the attribute to look up.
Returns: The attribute's value as a string, or 0 if no attribute was found with the name specified. Definition at line 48 of file easyxml.cxx. References findAttribute(), and getValue().

virtual const char* XMLAttributes::getValue | ( | int | i | ) | const`[pure virtual]`

  | Get the string value of an attribute by index. The index must be less than the size of the list and greater than or equal to zero. Parameters:
  i | The index of the attribute (zero-based).
See also: size Implemented in XMLAttributesDefault. Referenced by getValue(), and XMLAttributesDefault::XMLAttributesDefault().

bool XMLAttributes::hasAttribute | ( | const char * | name | ) | const`[virtual]`

  | Test whether an attribute is present. Parameters:
  name | The name of the attribute.
Returns: true if an attribute with the specified name is present in the attribute list, false otherwise. Definition at line 42 of file easyxml.cxx. References findAttribute().

virtual int XMLAttributes::size | ( |  | ) | const`[pure virtual]`

| Get the number of attributes present. Returns: The number of attributes in the list (may be 0). Implemented in XMLAttributesDefault. Referenced by findAttribute(), and XMLAttributesDefault::XMLAttributesDefault().

The documentation for this class was generated from the following files:

- easyxml.hxx
- easyxml.cxx

@ 1.3 log @Oops, try again. @ text @d307 1 a307 1