HydraExpress™ C++ 2019 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Inserts, iterates, and searches rwsf::XmlAttribute objects in a set based on rwsf::XmlName values. More...
#include <rwsf/core/XmlAttributeSet.h>
Public Types | |
typedef std::list< rwsf::XmlAttribute >::const_iterator | const_iterator |
enum | EqualityType { Name, Value } |
typedef std::list< rwsf::XmlAttribute >::iterator | iterator |
rwsf::XmlAttributeSet is a specialized collection class for rwsf::XmlAttribute objects, providing methods for inserting, iterating, and searching based on rwsf::XmlName values. This collection is a set meaning only one rwsf::XmlAttribute per unique rwsf::XmlName is allowed.
typedef std::list<rwsf::XmlAttribute>::const_iterator rwsf::XmlAttributeSet::const_iterator |
Const iterator for the collection of rwsf::XmlAttribute objects within the rwsf::XmlAttributeSet.
typedef std::list<rwsf::XmlAttribute>::iterator rwsf::XmlAttributeSet::iterator |
Iterator for the collection of rwsf::XmlAttribute objects within the rwsf::XmlAttributeSet.
Contains values for changing the comparison behavior of the equalTo() operation.
Enumerator | |
---|---|
Name |
Requires only that the rwsf::XmlName to match for equality to be true. |
Value |
Requires both the rwsf::XmlName and the value of the attribute to match equals for equality to be true. |
rwsf::XmlAttributeSet::XmlAttributeSet | ( | ) |
Default constructor. Constructs an attribute set that contains no attributes.
rwsf::XmlAttributeSet::XmlAttributeSet | ( | const XmlAttributeSet & | a | ) |
Copy constructor. Constructs a new XmlAttributeSet from a as a deep copy.
|
virtual |
Virtual destructor. This class is intended as a base class.
void rwsf::XmlAttributeSet::add | ( | const rwsf::XmlAttribute & | attr | ) |
Adds attr to self. Replaces any existing attribute with the same name as attr.
void rwsf::XmlAttributeSet::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 rwsf::XmlAttributeSet::addNamespaceAttribute | ( | const rwsf::XmlNamespace & | ) |
Adds the attribute "xmlns:prefix", "URI" for the namespace consisting of the pair "prefix", "URI".
void rwsf::XmlAttributeSet::clear | ( | ) |
Removes all attributes from self.
bool rwsf::XmlAttributeSet::contains | ( | const rwsf::XmlName & | name | ) | const |
Returns true
if self contains an attribute with an rwsf::XmlName that compares equal to name, otherwise false
.
bool rwsf::XmlAttributeSet::contains | ( | const rwsf::XmlAttribute & | attr | ) | const |
Returns true
if self contains an attribute attr, otherwise false
.
size_t rwsf::XmlAttributeSet::entries | ( | ) | const |
Returns the set's size.
bool rwsf::XmlAttributeSet::equalTo | ( | const XmlAttributeSet & | other, |
EqualityType | type = Name |
||
) | const |
Returns true
if self and other have the following properties: Each contains the same number of rwsf::XmlAttribute instances. Each rwsf::XmlName of an rwsf::XmlAttribute matches equality with one rwsf::XmlName of an rwsf::XmlAttribute in other. If type == Value
, then the each matched value of rwsf::XmlAttribute must be equal as well.
bool rwsf::XmlAttributeSet::find | ( | const rwsf::XmlName & | name, |
rwsf::XmlAttribute & | ret | ||
) | const |
Returns true
if an rwsf::XmlAttribute with an rwsf::XmlName matching name exists in the set, otherwise false
. If a match is found, ret is populated with the values of the internal attribute, otherwise ret is not modified.
bool rwsf::XmlAttributeSet::find | ( | const rwsf::XmlAttribute & | attr, |
rwsf::XmlAttribute & | ret | ||
) | const |
Returns true
if an rwsf::XmlAttribute with an rwsf::XmlName matching the rwsf::XmlName of attr exists in the set, otherwise false
. If a match is found, ret is populated with the values of the internal attribute, otherwise ret is not modified.
bool rwsf::XmlAttributeSet::findNamespaceAttribute | ( | const std::string & | s, |
rwsf::XmlAttribute & | ret | ||
) |
Returns true
if an rwsf::XmlAttribute with an rwsf::XmlName matching "xmlns:" + s exists in the set, otherwise false
. If a match is found, ret is populated with the values of the internal attribute, otherwise ret is not modified.
bool rwsf::XmlAttributeSet::findNamespaceAttribute | ( | const rwsf::XmlNamespace & | s, |
rwsf::XmlAttribute & | ret | ||
) |
Returns true
if an rwsf::XmlAttribute with an rwsf::XmlName matching "xmlns:" + s exists in the set, otherwise false. If a match is found, ret is populated with the values of the internal attribute, otherwise ret is not modified.
std::string rwsf::XmlAttributeSet::findValueByName | ( | const std::string & | attrName, |
bool | mustExist = true |
||
) | const |
Returns the name of the attribute attrName from this set. If mustExist is true
and the attribute is not in the set, the function throws an rwsf::Exception.
std::string rwsf::XmlAttributeSet::getDefaultNamespaceAttribute | ( | ) | const |
Returns the (uri) string associated with the attribute rwsf::XmlName "\a xmlns" if any, otherwise returns the empty string.
XmlAttributeSet::iterator rwsf::XmlAttributeSet::getIteratorBegin | ( | ) | const |
Returns an iterator at set's beginning.
XmlAttributeSet::iterator rwsf::XmlAttributeSet::getIteratorEnd | ( | ) | const |
Returns an iterator at set's end.
XmlAttributeSet& rwsf::XmlAttributeSet::operator= | ( | const XmlAttributeSet & | a | ) |
Assignment operator. Makes self a deep copy of a.
void rwsf::XmlAttributeSet::remove | ( | const rwsf::XmlName & | name | ) |
Removes the attribute with an rwsf::XmlName 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 rwsf::XmlAttributeSet::remove | ( | const rwsf::XmlAttribute & | attr | ) |
Removes the attribute with an rwsf::XmlName that compares equal to the rwsf::XmlName 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 rwsf::XmlAttributeSet::removeDefaultNamespaceAttribute | ( | ) |
Removes the attribute with rwsf::XmlName "xmlns" if it exists.
void rwsf::XmlAttributeSet::removeNamespaceAttribute | ( | const rwsf::XmlNamespace & | prefix | ) |
Removes the attribute with the rwsf::XmlName "xmlns:prefix", if it exists.
void rwsf::XmlAttributeSet::removeNamespaceAttribute | ( | const std::string & | s | ) |
Removes the attribute with rwsf::XmlName "xmlns:s".
void rwsf::XmlAttributeSet::setDefaultNamespaceAttribute | ( | const std::string & | s | ) |
Sets the default namespace attribute for rwsf::XmlName to s. If the namespace attribute for the rwsf::XmlName exists, the value is replaced.
void rwsf::XmlAttributeSet::setDefaultNamespaceAttribute | ( | const rwsf::XmlNamespace & | ns | ) |
Sets the default namespace attribute to ns. If the namespace attribute for the rwsf::XmlName exists, the value is replaced.
void rwsf::XmlAttributeSet::setDefaultNamespaceAttribute | ( | const rwsf::XmlAttribute & | attr | ) |
Sets the default namespace attribute for rwsf::XmlAttribute to attr. If the namespace attribute for the rwsf::XmlAttribute exists, the value is replaced.
void rwsf::XmlAttributeSet::unsetDefaultNamespaceAttribute | ( | ) |
Unsets the default namespace xmlns
for the enclosing context by giving it the value ""
.
Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved. |