class attList

Attribute list class.

Inheritance:


Public Fields

typedef AttrList::const_iterator const_attr_iter
Constant attribute iterator.

Public Methods

attList(void)
Default constructor.
attList(const attList& x)
Copy constructor.
virtual ~attList(void)
destructor.
attrib& addAttr(const std::string& name, const attrib& a)
Add an attribute to the list.
attrib& repAttr(const std::string& name, const attrib& a)
Replace an attribute in the list.
void remAttr(const std::string& name)
remove an attribute.
void clear(void)
Clear attribute list.
bool empty(void) const
test for empty list.
bool exists(const std::string& key) const
Test if attribute exists.
const attrib& find(const std::string& key) const
Find a named attribute.
bool isDefault(void) const
Test for default list.
virtual void putAttr(writer& w) const
List attributes.
virtual void setWrite(writer& w) const
Set writer attributes.
virtual void merge(const attList& x)
Merge attribute lists.
const_attr_iter begin(void) const
List start iterator.
const_attr_iter end(void) const
List end iterator.

Documentation

An attribute list is a map associating a set of attribute names to with their appropriate values.
attList(void)
Construct a null attribute list.

attList(const attList& x)
Copy an attribute list by cloning all known attributes.
Parameters:
x - Attribute list to be copied.

virtual ~attList(void)
Delete all attribute values in the attribute list and clear the list.

attrib& addAttr(const std::string& name, const attrib& a)
The specified attribute value is cloned and added to the attribute list with the given name.
Returns:
reference to the attribute value entry.
Parameters:
name - Attribute name to be added.
a - Value of attribute to be added

attrib& repAttr(const std::string& name, const attrib& a)
The specified attribute value is used to replace the attribute with the given name.
Returns:
reference to the attribute value entry.
Parameters:
name - Attribute name to be replaced.
a - Replacement attribute value.

void remAttr(const std::string& name)
Remove the specified attribute from the list.
Parameters:
name - Name of attribute to be removed.

void clear(void)
Delete and destroy all attributes from the list.

bool empty(void) const
Test if the list has any attributes.
Returns:
true if the list is empty.

bool exists(const std::string& key) const
Test whether the named attribute is included in the list.
Returns:
true if the named attribute is in the list.
Parameters:
key - Name of attribute to search for.

const attrib& find(const std::string& key) const
Look for the specified attribute. Return a reference if it is found.
Returns:
Reference to the found attribute instance.
Parameters:
key - name of the attribute to be searched for.

bool isDefault(void) const
Test whether all specified attributes have their default values.

virtual void putAttr(writer& w) const
List all non-default attributes to the HTML document stream.
Parameters:
w - HTML document stream to receive attribute list.

virtual void setWrite(writer& w) const
Set HTML document writer to reflect any state attributes.
Parameters:
x - Writer to modify based on attribute values.

virtual void merge(const attList& x)
Merge specified attribute list into the current list. Any attribute in the specified list that is not covered by the current list will be added to the current list.
Parameters:
x - List to be merged into the current list.

typedef AttrList::const_iterator const_attr_iter
Constant iterator for use in traversing the attribute list.

const_attr_iter begin(void) const
Fetch an iterator pointing to the start of the attribute list.

const_attr_iter end(void) const
Fetch an iterator pointing to the end of the attribute list.


Direct child classes:
StyleClass
Author:
J. Zweizig
Version:
1.0; Modified January 5, 2001

alphabetic index hierarchy of classes


generated by doc++