#include <rwsf/core/XmlAttributeSet.h>
rwsf::XmlAttributeSet is a specialized collection class for rwsf::XmlAttribute objects, providing methods for inserting, iterating, and searching based on rwsf::XmlName values.
enum EqualityType { Name, Value };
typedef std::listIterator<rwsf::XmlAttribute> iterator;
Iterator for the collection of rwsf::XmlAttribute objects within the attribute set.
XmlAttributeSet();
Default constructor. Constructs an attribute set that contains no attributes.
XmlAttributeSet(const XmlAttributeSet& a);
Copy constructor. Constructs a new attribute set as a deep copy of a.
virtual ~XmlAttributeSet();
Virtual destructor. This class is intended as a base class.
XmlAttributeSet& operator=(const XmlAttributeSet& a);
Assignment operator. Makes self a deep copy of a.
void add(const rwsf::XmlAttribute& attr);
Adds attr to self. Replaces any existing attribute with the same name as attr.
void add(const rwsf::XmlName&, const std::string&);
Constructs a new attribute name/value pair and adds that attribute to self. Replaces any existing attribute with a name that compares equal to name.
void addNamespaceAttribute(const rwsf::XmlNamespace&);
Add the attribute "xmlns:prefix", "URI" for the namespace consisting of the pair "prefix", "URI".
void clear();
Removes all attributes from self.
bool contains(const rwsf::XmlName& name) const;
Returns true if self contains an attribute with a name that compares equal to name. Otherwise, returns false.
bool contains(const rwsf::XmlAttribute& attr) const;
Returns true if self contains an attribute attr. Otherwise, returns false.
size_t entries() const;
Forwards set's size.
bool equalTo(const XmlAttributeSet& other, EqualityType type = Name) const;
Returns true if the number of attributes is the same, the rwsf::XmlName of each attribute in this set is the same as an rwsf::XmlName of the other set, and for each name, the value is the same. (Note: rwsf::XmlNames are unique in each set).
bool find(const rwsf::XmlName& name, rwsf::XmlAttribute& ret) const;
Returns true if an rwsf::XmlAttribute with a name matching name exists in the set; false otherwise. If a match is found, ret will be populated with the values of the internal attribute, otherwise ret will not be modified.
bool find(const rwsf::XmlAttribute& attr, rwsf::XmlAttribute& ret) const;
Returns true if an rwsf::XmlAttribute with a name matching attr's name exists in the set; false otherwise. If a match is found, ret will be populated with the values of the internal attribute, otherwise ret will not be modified.
bool findNamespaceAttribute(const std::string& s, rwsf::XmlAttribute& ret);
Returns true if an rwsf::XmlAttribute with a name matching "xmlns:s" exists in the set; false otherwise. If a match is found, ret will be populated with the values of the internal attribute, otherwise ret will not be modified.
bool findNamespaceAttribute(const rwsf::XmlNamespace& s, rwsf::XmlAttribute& ret) const;
Returns true if an rwsf::XmlAttribute with a name matching "xmlns:s" exists in the set; false otherwise. If a match is found, ret will be populated with the values of the internal attribute, otherwise ret will not be modified.
std::string findValueByName(const std::string& attrName, bool mustExist = true) const;
Returns the name of the attribute attrName from this set. If mustExit is true and the attribute is not in the set, throws an rwsf::Exception.
std::string& getDefaultNamespaceAttribute() const;
Returns the (uri) string associated with the attribute name "xmlns" if any; otherwise returns the empty string.
XmlAttributeSet::iterator getIterator() const;
Returns an iterator at set's begin.
void remove(const rwsf::XmlName& name);
Removes the attribute with a name that compares equal to name. Has no effect if self does not contain such an attribute. Calling this function may invalidate iterators that refer to this object.
void remove(const rwsf::XmlAttribute& attr);
Removes the attribute with a name that compares equal to the name of attr. Has no effect if self does not contain such an attribute. Calling this function may invalidate iterators that refer to this object.
void removeDefaultNamespaceAttribute();
Removes the attribute with name "xmlns" if it exists.
void removeNamespaceAttribute(const std::string& s);
Removes the attribute with name "xmlns:s".
void removeNamespaceAttribute(const rwsf::XmlNamespace&);
Removes the attribute with the name "xmlns:prefix", if it exists.
void setDefaultNamespaceAttribute(const rwsf::XmlNamespace& ns);
Sets the default namespace attribute to ns.
void unsetDefaultNamespaceAttribute();
Unsets the default namespace xmlns for the enclosing context by giving it the value "" (the empty string). This is not the same as removing the default namespace attribute as with removeNamespaceAttribure().
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.