Main Page Modules Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACEXML_AttributesImpl Class Reference

ACEXML_AttributesImpl provides the default implementation of interface ACEXML_Attributes. More...

`#include <AttributesImpl.h>`

Inheritance diagram for ACEXML_AttributesImpl:

[legend]
Collaboration diagram for ACEXML_AttributesImpl:

[legend]
List of all members.

## Public Methods
| ACEXML_AttributesImpl (int size=ACEXML_AttributesImpl_Default_Size)
| ACEXML_AttributesImpl (const ACEXML_AttributesImpl &attrs)
virtual | ~ACEXML_AttributesImpl (void)
virtual int | addAttribute (const ACEXML_Char *uri, const ACEXML_Char *localName, const ACEXML_Char *qName, const ACEXML_Char *type, const ACEXML_Char *value)
virtual int | addAttribute (const ACEXML_Attribute &att)
virtual int | isDuplicate (const ACEXML_Char *uri, const ACEXML_Char *localName, const ACEXML_Char *qName)
virtual int | removeAttribute (size_t index)
virtual int | getIndex (const ACEXML_Char *qName)
virtual int | getIndex (const ACEXML_Char *uri, const ACEXML_Char *localPart)
virtual size_t | getLength (void)
virtual const ACEXML_Char * | getLocalName (size_t index)
virtual const ACEXML_Char * | getQName (size_t index)
virtual const ACEXML_Char * | getType (size_t index)
virtual const ACEXML_Char * | getType (const ACEXML_Char *qName)
virtual const ACEXML_Char * | getType (const ACEXML_Char *uri, const ACEXML_Char *localPart)
virtual const ACEXML_Char * | getURI (size_t index)
virtual const ACEXML_Char * | getValue (size_t index)
virtual const ACEXML_Char * | getValue (const ACEXML_Char *qName)
virtual const ACEXML_Char * | getValue (const ACEXML_Char *uri, const ACEXML_Char *localPart)
virtual int | setAttribute (size_t index, const ACEXML_Char *uri, const ACEXML_Char *localName, const ACEXML_Char *qName, const ACEXML_Char *type, const ACEXML_Char *value)
virtual int | setLocalName (size_t index, const ACEXML_Char *localName)
virtual int | setQName (size_t index, const ACEXML_Char *qName)
virtual int | setURI (size_t index, const ACEXML_Char *uri)
virtual int | setType (size_t index, const ACEXML_Char *type)
virtual int | setValue (size_t index, const ACEXML_Char *value)
## Private Attributes
ACEXML_Attribute_Array | attrs_
| Container for all attributes.

## Detailed Description

ACEXML_AttributesImpl provides the default implementation of interface ACEXML_Attributes.

This class provides a default implementation of the SAX2 Attributes interface, with the addition of manipulators so that the list can be modified or reused.

There are two typical uses of this class:

- to take a persistent snapshot of an Attributes object in a startElement event; or
- to construct or modify an Attributes object in a SAX2 driver or filter.

This class replaces the now-deprecated SAX1 AttributeListImpl class; in addition to supporting the updated Attributes interface rather than the deprecated AttributeList interface, it also includes a much more efficient implementation using a single array rather than a set of Vectors.

See also:
  ACEXML_Attributes

## Constructor & Destructor Documentation

ACEXML_AttributesImpl::ACEXML_AttributesImpl | ( | int | size = ACEXML_AttributesImpl_Default_Size | ) |

| Initialize an AttributesImpl that holds <size> attributes.

ACEXML_AttributesImpl::ACEXML_AttributesImpl | ( | const ACEXML_AttributesImpl & | attrs | ) |

ACEXML_AttributesImpl::~ACEXML_AttributesImpl | ( | void |  | ) | `[virtual]`

## Member Function Documentation

int ACEXML_AttributesImpl::addAttribute | ( | const ACEXML_Attribute & | att | ) | `[virtual]`

int ACEXML_AttributesImpl::addAttribute | ( | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localName,
|  | const ACEXML_Char * | qName,
|  | const ACEXML_Char * | type,
|  | const ACEXML_Char * | value
| ) | `[virtual]`

| Add a new attribute using the argument(s) supplied. Return -1 if an attribute with the same name already exists.

int ACEXML_AttributesImpl::getIndex | ( | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localPart
| ) | `[virtual]`

| Look up the index of an attribute by Namespace name. Return -1 if we fail to find a match. Implements ACEXML_Attributes.

int ACEXML_AttributesImpl::getIndex | ( | const ACEXML_Char * | qName | ) | `[virtual]`

| Look up the index of an attribute by XML 1.0 qualified name. Return -1 if we fail to find a match. Implements ACEXML_Attributes.

size_t ACEXML_AttributesImpl::getLength | ( | void |  | ) | `[virtual]`

| Return the number of attributes in the list. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getLocalName | ( | size_t | index | ) | `[virtual]`

| Look up an attribute's local name by index. Return 0 if index is out of range. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getQName | ( | size_t | index | ) | `[virtual]`

| Look up an attribute's XML 1.0 qualified name by index. Return 0 if index is out of range. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getType | ( | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localPart
| ) | `[virtual]`

| Look up an attribute's type by Namespace name. Return 0 if we fail to find a match. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getType | ( | const ACEXML_Char * | qName | ) | `[virtual]`

| Look up an attribute's type by XML 1.0 qualified name. Return 0 if we fail to find a match. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getType | ( | size_t | index | ) | `[virtual]`

| Look up an attribute's type by index. Return 0 if index is out of range. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getURI | ( | size_t | index | ) | `[virtual]`

| Look up an attribute's Namespace URI by index. Return 0 if index is out of range. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getValue | ( | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localPart
| ) | `[virtual]`

| Look up an attribute's value by Namespace name. Return 0 if we fail to find a match. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getValue | ( | const ACEXML_Char * | qName | ) | `[virtual]`

| Look up an attribute's value by XML 1.0 qualified name. Return 0 if we fail to find a match. Implements ACEXML_Attributes.

const ACEXML_Char * ACEXML_AttributesImpl::getValue | ( | size_t | index | ) | `[virtual]`

| Look up an attribute's value by index. Return 0 if index is out of range. Implements ACEXML_Attributes.

int ACEXML_AttributesImpl::isDuplicate | ( | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localName,
|  | const ACEXML_Char * | qName
| ) | `[virtual]`

| Check for duplicate attributes.

int ACEXML_AttributesImpl::removeAttribute | ( | size_t | index | ) | `[virtual]`

| Remove an attribute from the array. Notice that this operation can invalidate previously acquired <index> value. (It will repack the array.)

int ACEXML_AttributesImpl::setAttribute | ( | size_t | index,
|  | const ACEXML_Char * | uri,
|  | const ACEXML_Char * | localName,
|  | const ACEXML_Char * | qName,
|  | const ACEXML_Char * | type,
|  | const ACEXML_Char * | value
| ) | `[virtual]`

| Set an attribute at index. Return -1 if index is out of range.

int ACEXML_AttributesImpl::setLocalName | ( | size_t | index,
|  | const ACEXML_Char * | localName
| ) | `[virtual]`

| Set the localName of the attribute at <index>. return -1 if <index> is out of range.

int ACEXML_AttributesImpl::setQName | ( | size_t | index,
|  | const ACEXML_Char * | qName
| ) | `[virtual]`

| Set the qName of the attribute at <index>. return -1 if <index> is out of range.

int ACEXML_AttributesImpl::setType | ( | size_t | index,
|  | const ACEXML_Char * | type
| ) | `[virtual]`

| Set the type of the attribute at <index>. return -1 if <index> is out of range.

int ACEXML_AttributesImpl::setURI | ( | size_t | index,
|  | const ACEXML_Char * | uri
| ) | `[virtual]`

| Set the URI of the attribute at <index>. return -1 if <index> is out of range.

int ACEXML_AttributesImpl::setValue | ( | size_t | index,
|  | const ACEXML_Char * | value
| ) | `[virtual]`

| Set the value of the attribute at <index>. return -1 if <index> is out of range.

## Member Data Documentation

ACEXML_Attribute_Array ACEXML_AttributesImpl::attrs_`[private]`

| Container for all attributes.

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

- AttributesImpl.h
- AttributesImpl.cpp