HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Types | Public Member Functions | Related Functions
rwsf::XmlAttribute Class Reference

Represents an attribute of an XML element. More...

#include <rwsf/core/XmlAttribute.h>

Public Types

typedef rwsf::XmlName AttributeName
 

Public Member Functions

 XmlAttribute ()
 
 XmlAttribute (const rwsf::XmlName &name, const std::string &value)
 
 XmlAttribute (const std::string &name, const std::string &value, const rwsf::XmlNamespace &ns=rwsf::XmlNamespace::getEmptyNamespace())
 
 XmlAttribute (const XmlAttribute &a)
 
 ~XmlAttribute ()
 
rwsf::XmlNamegetName ()
 
const rwsf::XmlNamegetName () const
 
const std::string & getValue () const
 
XmlAttributeoperator= (const XmlAttribute &rhs)
 
void setName (const rwsf::XmlName &name)
 
void setValue (const std::string &value)
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const XmlAttribute &lhs, const XmlAttribute &rhs)
 
bool operator< (const XmlAttribute &lhs, const XmlAttribute &rhs)
 
bool operator== (const XmlAttribute &lhs, const XmlAttribute &rhs)
 

Detailed Description

rwsf::XmlAttribute represents an attribute of an XML element. Each attribute consists of an attribute name represented by an rwsf::XmlName and a value string. For example, the element

<ServiceName xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:mustUnderstand="1">
WebData
</ServiceName>

contains an attribute with the name SOAP-ENV:mustUnderstand and the value string "1". Although, in this case, the URI component of the attribute name does not appear in the element, the rwsf::XmlName object representing this attribute name contains a URI for the SOAP-ENV prefix.

Member Typedef Documentation

AttributeName is a typedef for an instance of rwsf:XmlName representing an attribute name.

Constructor & Destructor Documentation

rwsf::XmlAttribute::XmlAttribute ( )

Default constructor. Constructs an instance with an empty local name, an empty value, and a namespace with no URI and no prefix.

rwsf::XmlAttribute::XmlAttribute ( const rwsf::XmlName name,
const std::string &  value 
)

Constructs an rwsf::XmlAttribute from an attribute name and the provided value.

rwsf::XmlAttribute::XmlAttribute ( const std::string &  name,
const std::string &  value,
const rwsf::XmlNamespace ns = rwsf::XmlNamespace::getEmptyNamespace() 
)

Constructs an rwsf::XmlAttribute with the local name name and the provided value. The name will be qualified by the ns provided, or an empty namespace if no ns is present.

Note
Do not use a qualified name string for name. If a qualified attribute name is needed, put the local name in name and put the namespace in ns.
rwsf::XmlAttribute::XmlAttribute ( const XmlAttribute a)

Copy constructor. Constructs a deep copy of a.

rwsf::XmlAttribute::~XmlAttribute ( )

Destructor.

Member Function Documentation

rwsf::XmlName& rwsf::XmlAttribute::getName ( )

Returns the name of this attribute.

const rwsf::XmlName& rwsf::XmlAttribute::getName ( ) const

Returns the name of this attribute.

const std::string& rwsf::XmlAttribute::getValue ( ) const

Returns the value of this attribute.

XmlAttribute& rwsf::XmlAttribute::operator= ( const XmlAttribute rhs)

Assignment operator. Makes self a copy of rhs.

void rwsf::XmlAttribute::setName ( const rwsf::XmlName name)

Sets the name of this attribute to name.

void rwsf::XmlAttribute::setValue ( const std::string &  value)

Sets the value of this attribute to value.

Friends And Related Function Documentation

bool operator!= ( const XmlAttribute lhs,
const XmlAttribute rhs 
)
related

Returns false if lhs and rhs have matching names and values.

bool operator< ( const XmlAttribute lhs,
const XmlAttribute rhs 
)
related

Returns true if the unique name of lhs compares less than the unique name of rhs, using operator< for std::string.

bool operator== ( const XmlAttribute lhs,
const XmlAttribute rhs 
)
related

Returns true if lhs and rhs have matching names and values. Compares the local names, URI strings, and values of lhs and rhs. If all comparisons are equal, lhs and rhs have matching names and values.

Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.