Main Page | Class Hierarchy | Class List | File List | Class Members

xml::attributes Class Reference

The xml::attributes class is used to access all the attributes of one xml::node. More...

#include <attributes.h>

List of all members.

Public Types

typedef std::size_t size_type
 size type


Public Member Functions

 attributes (void)
 Create a new xml::attributes object with no attributes.

 attributes (const attributes &other)
 Copy construct a xml::attributes object.

attributesoperator= (const attributes &other)
 Copy the given xml::attributes object into this one.

void swap (attributes &other)
 Swap this xml::attributes object with another one.

 ~attributes (void)
 Clean up after a xml::attributes object.

iterator begin (void)
 Get an iterator that points to the first attribute.

const_iterator begin (void) const
 Get a const_iterator that points to the first attribute.

iterator end (void)
 Get an iterator that points one past the the last attribute.

const_iterator end (void) const
 Get a const_iterator that points one past the last attribute.

void insert (const char *name, const char *value)
 Add an attribute to the attributes list.

iterator find (const char *name)
 Find the attribute with the given name.

const_iterator find (const char *name) const
 Find the attribute with the given name.

iterator erase (iterator to_erase)
 Erase the attribute that is pointed to by the given iterator.

void erase (const char *name)
 Erase the attribute with the given name.

bool empty (void) const
 Find out if there are any attributes in this xml::attributes object.

size_type size (void) const
 Find out how many attributes there are in this xml::attributes object.


Detailed Description

The xml::attributes class is used to access all the attributes of one xml::node.

You can add, find and erase attributes by name, and for some member functions, use the provided iterator classes.

The iterator classes allow you to access one XML attribute. This is done using the xml::attributes::attr class interface.


Member Typedef Documentation

typedef std::size_t xml::attributes::size_type
 

size type


Constructor & Destructor Documentation

xml::attributes::attributes void   ) 
 

Create a new xml::attributes object with no attributes.

Author:
Peter Jones

xml::attributes::attributes const attributes other  ) 
 

Copy construct a xml::attributes object.

Parameters:
other The xml::attributes object to copy from.
Author:
Peter Jones

xml::attributes::~attributes void   ) 
 

Clean up after a xml::attributes object.

Author:
Peter Jones


Member Function Documentation

const_iterator xml::attributes::begin void   )  const
 

Get a const_iterator that points to the first attribute.

Returns:
A const_iterator that points to the first attribute.

A const_iterator equal to end() if there are no attributes.

See also:
xml::attributes::const_iterator

xml::attributes::attr

Author:
Peter Jones

iterator xml::attributes::begin void   ) 
 

Get an iterator that points to the first attribute.

Returns:
An iterator that points to the first attribute.

An iterator equal to end() if there are no attributes.

See also:
xml::attributes::iterator

xml::attributes::attr

Author:
Peter Jones

bool xml::attributes::empty void   )  const
 

Find out if there are any attributes in this xml::attributes object.

Returns:
True if there are no attributes.

False if there is at least one attribute.

Author:
Peter Jones

const_iterator xml::attributes::end void   )  const
 

Get a const_iterator that points one past the last attribute.

Returns:
An "end" const_iterator.
Author:
Peter Jones

iterator xml::attributes::end void   ) 
 

Get an iterator that points one past the the last attribute.

Returns:
An "end" iterator.
Author:
Peter Jones

void xml::attributes::erase const char *  name  ) 
 

Erase the attribute with the given name.

This will invalidate any iterators that are pointing to that attribute, as well as any pointers or references to that attribute.

Parameters:
name The name of the attribute to erase.
Author:
Peter Jones

iterator xml::attributes::erase iterator  to_erase  ) 
 

Erase the attribute that is pointed to by the given iterator.

This will invalidate any iterators for this attribute, as well as any pointers or references to it.

Parameters:
to_erase An iterator that points to the attribute to erased.
Returns:
An iterator that points to the attribute after the one to be erased.
See also:
xml::attributes::iterator

xml::attributes::attr

Author:
Peter Jones

const_iterator xml::attributes::find const char *  name  )  const
 

Find the attribute with the given name.

If the attribute is not found on the current node, the DTD will be searched for a default value. This is, of course, if there was a DTD parsed with the XML document.

Parameters:
name The name of the attribute to find.
Returns:
A const_iterator that points to the attribute with the given name.

If the attribute was not found, find will return end().

See also:
xml::attributes::const_iterator

xml::attributes::attr

Author:
Peter Jones

iterator xml::attributes::find const char *  name  ) 
 

Find the attribute with the given name.

If the attribute is not found on the current node, the DTD will be searched for a default value. This is, of course, if there was a DTD parsed with the XML document.

Parameters:
name The name of the attribute to find.
Returns:
An iterator that points to the attribute with the given name.

If the attribute was not found, find will return end().

See also:
xml::attributes::iterator

xml::attributes::attr

Author:
Peter Jones

void xml::attributes::insert const char *  name,
const char *  value
 

Add an attribute to the attributes list.

If there is another attribute with the same name, it will be replaced with this one.

Parameters:
name The name of the attribute to add.
value The value of the attribute to add.
Author:
Peter Jones

attributes& xml::attributes::operator= const attributes other  ) 
 

Copy the given xml::attributes object into this one.

Parameters:
other The xml::attributes object to copy from.
Returns:
*this.
Author:
Peter Jones

size_type xml::attributes::size void   )  const
 

Find out how many attributes there are in this xml::attributes object.

Returns:
The number of attributes in this xml::attributes object.
Author:
Peter Jones

void xml::attributes::swap attributes other  ) 
 

Swap this xml::attributes object with another one.

Parameters:
other The other xml::attributes object to swap with.
Author:
Peter Jones


The documentation for this class was generated from the following file:
Generated on Tue Oct 19 12:26:03 2004 for xmlwrapp by doxygen 1.3.6