Does not inherit
#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.
std::list< rwsf::XmlAttribute >::const_iterator const_iterator;
Iterator for the collection of rwsf::XmlAttribute objects within the attribute set.
std::list< rwsf::XmlAttribute >::iterator 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.
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 & name, const std::string & value);
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);
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 "\c xmlns" if any; otherwise returns the empty string.
XmlAttributeSet::iterator getIteratorBegin() const;
Returns an iterator at set's beginning.
XmlAttributeSet::iterator getIteratorEnd() const;
Returns an iterator at set's end.
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 rwsf::XmlNamespace & prefix);
Removes the attribute with the name "xmlns:prefix", if it exists.
void removeNamespaceAttribute(const std::string & s);
Removes the attribute with name "xmlns:s".
void setDefaultNamespaceAttribute(const std::string & s);
Add (or replace) the attribute with name "xmlns" and value s.
void setDefaultNamespaceAttribute(const rwsf::XmlNamespace & ns);
Sets the default namespace attribute to ns.
void setDefaultNamespaceAttribute(const rwsf::XmlAttribute & attr);
Add (or replace) with the given attribute
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().
XmlAttributeSet & operator=(const XmlAttributeSet & a);
Assignment operator. Makes self a deep copy of a.
© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.