Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

qgxml::QtAttributesAdaptor Class Reference

#include <QtAttributesAdaptor.H>

Inheritance diagram for qgxml::QtAttributesAdaptor:

qgxml::Attributes List of all members.

Detailed Description

Adapts the interface of Attributes to the Qt QXmlAttributes class.

This class adapts the Qgar SAX Attributes interface to the Qt implementation: QXmlAttributes.

Author:
Jan Rendek
Date:
March 11, 2003 09:52
Since:
Qgar 2.1.1

Definition at line 73 of file QtAttributesAdaptor.H.

Public Member Functions

Constructors
 QtAttributesAdaptor (QXmlAttributes *attributes)
 Default constructor.
Destructors
virtual ~QtAttributesAdaptor ()
 Destructor.
Access
virtual int getIndex (const std::string &qName) const
 Look up the index of an attribute by XML 1.0 qualified name.
virtual int getIndex (const std::string &uri, const std::string &localName) const
 Look up the index of an attribute by Namespace name.
virtual int getLength () const
 Return the number of attributes in the list.
virtual std::string getLocalName (int index) const
 Look up an attribute's local name by index.
virtual std::string getQName (int index) const
 Look up an attribute's XML 1.0 qualified name by index.
virtual std::string getType (int index) const
 Look up an attribute's type by index.
virtual std::string getType (const std::string &qName) const
 Look up an attribute's type by XML 1.0 qualified name.
virtual std::string getType (const std::string &uri, const std::string &localName) const
 Look up an attribute's type by Namespace name.
virtual std::string getURI (int index) const
 Look up an attribute's Namespace URI by index.
virtual std::string getValue (int index) const
 Look up an attribute's value by index.
virtual std::string getValue (const std::string &qName) const
 Look up an attribute's value by XML 1.0 qualified name.
virtual std::string getValue (const std::string &uri, const std::string &localName) const
 Look up an attribute's value by Namespace name.

Protected Attributes

QXmlAttributes * _impl
 The adaptee, a QXmlAttribute instance.
QtStringConverter _sc
 A converter used to transform stl string to Qt QString and back.


Constructor & Destructor Documentation

qgxml::QtAttributesAdaptor::QtAttributesAdaptor QXmlAttributes *  attributes  ) 
 

Default constructor.

Parameters:
attributes a pointer to a QXmlAttributes instance to be adapted to the qgxml::Attributes instance.

Definition at line 57 of file QtAttributesAdaptor.C.

References _impl.

qgxml::QtAttributesAdaptor::~QtAttributesAdaptor  )  [virtual]
 

Destructor.

Definition at line 68 of file QtAttributesAdaptor.C.


Member Function Documentation

virtual int qgxml::QtAttributesAdaptor::getIndex const std::string &  uri,
const std::string &  localName
const [virtual]
 

Look up the index of an attribute by Namespace name.

Parameters:
uri The Namespace URI, or the empty string if the name has no Namespace URI.
localName The attribute's local name.
Returns:
The index of the attribute, or -1 if it does not appear in the list.

Implements qgxml::Attributes.

virtual int qgxml::QtAttributesAdaptor::getIndex const std::string &  qName  )  const [virtual]
 

Look up the index of an attribute by XML 1.0 qualified name.

Parameters:
qName The qualified (prefixed) name.
Returns:
The index of the attribute., or -1 if it does not appear in the list.

Implements qgxml::Attributes.

int qgxml::QtAttributesAdaptor::getLength  )  const [virtual]
 

Return the number of attributes in the list.

Once you know the number of attributes, you can iterate through the list.

Returns:
The number of attributes in the list.

Implements qgxml::Attributes.

Definition at line 95 of file QtAttributesAdaptor.C.

References _impl.

string qgxml::QtAttributesAdaptor::getLocalName int  index  )  const [virtual]
 

Look up an attribute's local name by index.

Parameters:
index The attribute index (zero-based).
Returns:
The local name, or the empty string if Namespace processing is not being performed, or null if the index is out of range.

Implements qgxml::Attributes.

Definition at line 103 of file QtAttributesAdaptor.C.

References _impl, _sc, and qgxml::QtStringConverter::convert().

string qgxml::QtAttributesAdaptor::getQName int  index  )  const [virtual]
 

Look up an attribute's XML 1.0 qualified name by index.

Parameters:
index The attribute index (zero-based).
Returns:
The XML 1.0 qualified name, or the empty string if none is available, or null if the index is out of range.

Implements qgxml::Attributes.

Definition at line 111 of file QtAttributesAdaptor.C.

References _impl, _sc, and qgxml::QtStringConverter::convert().

virtual std::string qgxml::QtAttributesAdaptor::getType const std::string &  uri,
const std::string &  localName
const [virtual]
 

Look up an attribute's type by Namespace name.

Parameters:
uri The Namespace URI, or the empty String if the name has no Namespace URI.
localName The local name of the attribute.
Returns:
The attribute type as a string.

Implements qgxml::Attributes.

virtual std::string qgxml::QtAttributesAdaptor::getType const std::string &  qName  )  const [virtual]
 

Look up an attribute's type by XML 1.0 qualified name.

Parameters:
qName The XML 1.0 qualified name.
Returns:
The attribute type as a string.

Implements qgxml::Attributes.

string qgxml::QtAttributesAdaptor::getType int  index  )  const [virtual]
 

Look up an attribute's type by index.

Parameters:
index The attribute index (zero-based).
Returns:
The attribute's type as a string.

Implements qgxml::Attributes.

Definition at line 119 of file QtAttributesAdaptor.C.

References _impl, _sc, and qgxml::QtStringConverter::convert().

string qgxml::QtAttributesAdaptor::getURI int  index  )  const [virtual]
 

Look up an attribute's Namespace URI by index.

Parameters:
index The attribute index (zero-based).
Returns:
The Namespace URI, or the empty string if none is available.

Implements qgxml::Attributes.

Definition at line 145 of file QtAttributesAdaptor.C.

References _impl, _sc, and qgxml::QtStringConverter::convert().

virtual std::string qgxml::QtAttributesAdaptor::getValue const std::string &  uri,
const std::string &  localName
const [virtual]
 

Look up an attribute's value by Namespace name.

Parameters:
uri The Namespace URI, or the empty String if the name has no Namespace URI.
localName The local name of the attribute.
Returns:
The attribute value as a string, or null if the attribute is not in the list.

Implements qgxml::Attributes.

virtual std::string qgxml::QtAttributesAdaptor::getValue const std::string &  qName  )  const [virtual]
 

Look up an attribute's value by XML 1.0 qualified name.

Parameters:
qName The XML 1.0 qualified name.
Returns:
The attribute value as a string, or null if the attribute is not in the list or if qualified names are not available.

Implements qgxml::Attributes.

string qgxml::QtAttributesAdaptor::getValue int  index  )  const [virtual]
 

Look up an attribute's value by index.

Parameters:
index The attribute index (zero-based).
Returns:
The attribute's value as a string, or null if the index is out of range.

Implements qgxml::Attributes.

Definition at line 153 of file QtAttributesAdaptor.C.

References _impl, _sc, and qgxml::QtStringConverter::convert().


Member Data Documentation

QXmlAttributes* qgxml::QtAttributesAdaptor::_impl [protected]
 

The adaptee, a QXmlAttribute instance.

Definition at line 260 of file QtAttributesAdaptor.H.

Referenced by getLength(), getLocalName(), getQName(), getType(), getURI(), getValue(), and QtAttributesAdaptor().

QtStringConverter qgxml::QtAttributesAdaptor::_sc [protected]
 

A converter used to transform stl string to Qt QString and back.

Definition at line 263 of file QtAttributesAdaptor.H.

Referenced by getLocalName(), getQName(), getType(), getURI(), and getValue().


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