# Poco::XML

# class AttributesImpl

Library: XML
Package: SAX
Header: Poco/SAX/AttributesImpl.h

## Description

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:

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

## Inheritance

Direct Base Classes: Attributes

All Base Classes: Attributes

## Member Summary

Member Functions: addAttribute, begin, clear, end, find, getIndex, getLength, getLocalName, getQName, getType, getURI, getValue, isSpecified, operator =, removeAttribute, reserve, setAttribute, setAttributes, setLocalName, setQName, setType, setURI, setValue

Inherited Functions: getIndex, getLength, getLocalName, getQName, getType, getURI, getValue

## Nested Classes

### struct Attribute

## Types

### AttributeVec

typedef std::vector < Attribute > AttributeVec;

### iterator

typedef AttributeVec::const_iterator iterator;

## Constructors

### AttributesImpl

AttributesImpl();

Creates the AttributesImpl.

### AttributesImpl

AttributesImpl(
const Attributes & attributes
);

Creates the AttributesImpl by copying another one.

### AttributesImpl

AttributesImpl(
const AttributesImpl & attributes
);

Creates the AttributesImpl by copying another one.

## Destructor

### ~AttributesImpl

~AttributesImpl();

Destroys the AttributesImpl.

## Member Functions

### addAttribute

void addAttribute(
const XMLString & namespaceURI,
const XMLString & localName,
const XMLString & qname,
const XMLString & type,
const XMLString & value
);

Adds an attribute to the end of the list.

### addAttribute

void addAttribute(
const XMLString & namespaceURI,
const XMLString & localName,
const XMLString & qname,
const XMLString & type,
const XMLString & value,
bool specified
);

Adds an attribute to the end of the list.

### addAttribute

void addAttribute(
const XMLChar * namespaceURI,
const XMLChar * localName,
const XMLChar * qname,
const XMLChar * type,
const XMLChar * value,
bool specified
);

Adds an attribute to the end of the list.

### addAttribute

Attribute & addAttribute();

Add an (empty) attribute to the end of the list. For internal use only. The returned Attribute element must be filled by the caller.

### begin

iterator begin() const;

Iterator support.

### clear

void clear();

Removes all attributes.

### end

iterator end() const;

Iterator support.

### getIndex

int getIndex(
const XMLString & name
) const;

See also: Poco::XML::Attributes::getIndex()

### getIndex

int getIndex(
const XMLString & namespaceURI,
const XMLString & localName
) const;

See also: Poco::XML::Attributes::getIndex()

### getLength

int getLength() const;

See also: Poco::XML::Attributes::getLength()

### getLocalName

const XMLString & getLocalName(
int i
) const;

See also: Poco::XML::Attributes::getLocalName()

### getQName

const XMLString & getQName(
int i
) const;

See also: Poco::XML::Attributes::getQName()

### getType

const XMLString & getType(
int i
) const;

See also: Poco::XML::Attributes::getType()

### getType

const XMLString & getType(
const XMLString & qname
) const;

See also: Poco::XML::Attributes::getType()

### getType

const XMLString & getType(
const XMLString & namespaceURI,
const XMLString & localName
) const;

See also: Poco::XML::Attributes::getType()

### getURI

const XMLString & getURI(
int i
) const;

See also: Poco::XML::Attributes::getURI()

### getValue

const XMLString & getValue(
int i
) const;

See also: Poco::XML::Attributes::getValue()

### getValue

const XMLString & getValue(
const XMLString & qname
) const;

See also: Poco::XML::Attributes::getValue()

### getValue

const XMLString & getValue(
const XMLString & namespaceURI,
const XMLString & localName
) const;

See also: Poco::XML::Attributes::getValue()

### isSpecified

bool isSpecified(
int i
) const;

Returns true unless the attribute value was provided by DTD defaulting. Extension from Attributes2 interface.

### isSpecified

bool isSpecified(
const XMLString & qname
) const;

Returns true unless the attribute value was provided by DTD defaulting. Extension from Attributes2 interface.

### isSpecified

bool isSpecified(
const XMLString & namespaceURI,
const XMLString & localName
) const;

Returns true unless the attribute value was provided by DTD defaulting. Extension from Attributes2 interface.

### operator =

AttributesImpl & operator = (
const AttributesImpl & attributes
);

Assignment operator.

### removeAttribute

void removeAttribute(
int i
);

Removes an attribute.

### removeAttribute

void removeAttribute(
const XMLString & qname
);

Removes an attribute.

### removeAttribute

void removeAttribute(
const XMLString & namespaceURI,
const XMLString & localName
);

Removes an attribute.

### reserve

void reserve(
std::size_t capacity
);

Reserves capacity in the internal vector.

### setAttribute

void setAttribute(
int i,
const XMLString & namespaceURI,
const XMLString & localName,
const XMLString & qname,
const XMLString & type,
const XMLString & value
);

Sets an attribute.

### setAttributes

void setAttributes(
const Attributes & attributes
);

Copies the attributes from another Attributes object.

### setLocalName

void setLocalName(
int i,
const XMLString & localName
);

Sets the local name of an attribute.

### setQName

void setQName(
int i,
const XMLString & qname
);

Sets the qualified name of an attribute.

### setType

void setType(
int i,
const XMLString & type
);

Sets the type of an attribute.

### setURI

void setURI(
int i,
const XMLString & namespaceURI
);

Sets the namespace URI of an attribute.

### setValue

void setValue(
int i,
const XMLString & value
);

Sets the value of an attribute.

### setValue

void setValue(
const XMLString & qname,
const XMLString & value
);

Sets the value of an attribute.

### setValue

void setValue(
const XMLString & namespaceURI,
const XMLString & localName,
const XMLString & value
);

Sets the value of an attribute.

### find

Attribute * find(
const XMLString & qname
) const;

### find

Attribute * find(
const XMLString & namespaceURI,
const XMLString & localName
) const;