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

 more...

struct EmptyAttribute protected

 more...

Types Aliases

AttributeVec

using AttributeVec = std::vector < Attribute >;

iterator

using iterator = AttributeVec::const_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.

AttributesImpl

AttributesImpl(
    AttributesImpl && attributes
) noexcept;

Creates the AttributesImpl by copying another one.

Destructor

~AttributesImpl virtual

~AttributesImpl();

Destroys the AttributesImpl.

Member Functions

addAttribute inline

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 inline

iterator begin() const;

Iterator support.

clear

void clear();

Removes all attributes.

end inline

iterator end() const;

Iterator support.

getIndex virtual

int getIndex(
    const XMLString & name
) const;

getIndex virtual

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

getLength virtual inline

int getLength() const;

getLocalName virtual inline

const XMLString & getLocalName(
    int i
) const;

getQName virtual inline

const XMLString & getQName(
    int i
) const;

getType virtual inline

const XMLString & getType(
    int i
) const;

getType virtual

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

getType virtual

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

getURI virtual inline

const XMLString & getURI(
    int i
) const;

getValue virtual inline

const XMLString & getValue(
    int i
) const;

getValue virtual

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

getValue virtual

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

isSpecified inline

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.

operator =

AttributesImpl & operator = (
    AttributesImpl && attributes
) noexcept;

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 protected

Attribute * find(
    const XMLString & qname
) const;

find protected

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