HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
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)

(Note that these are not member symbols.)

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

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

Constructor & Destructor Documentation

◆ XmlAttribute() [1/4]

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.

◆ XmlAttribute() [2/4]

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

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

◆ XmlAttribute() [3/4]

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.

◆ XmlAttribute() [4/4]

rwsf::XmlAttribute::XmlAttribute ( const XmlAttribute & a)

Copy constructor. Constructs a deep copy of a.

◆ ~XmlAttribute()

rwsf::XmlAttribute::~XmlAttribute ( )

Destructor.

Member Function Documentation

◆ getName() [1/2]

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

Returns the name of this attribute.

◆ getName() [2/2]

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

Returns the name of this attribute.

◆ getValue()

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

Returns the value of this attribute.

◆ operator=()

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

Assignment operator. Makes self a copy of rhs.

◆ setName()

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

Sets the name of this attribute to name.

◆ setValue()

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

Sets the value of this attribute to value.

◆ operator!=()

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

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

◆ operator<()

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.

◆ operator==()

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 © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.