QName Class Reference

#include <Pt/Xml/QName.h>

A qualified XML name. More...

Public Member Functions

 QName ()
 Constructs an empty qualified name.
 
void clear ()
 Clears all content.
 
bool empty () const
 Returns true if empty.
 
std::size_t size () const
 Returns the size of the prefix and local part.
 
Stringprefix ()
 Returns the namespace prefix.
 
const Stringprefix () const
 Returns the namespace prefix.
 
void setPrefix (const String &prefix)
 Sets the namespace prefix.
 
Stringlocal ()
 Returns the local name.
 
const Stringlocal () const
 Returns the local name.
 
void setLocal (const String &name)
 Sets the local name.
 

Related Functions

bool operator== (const QName &a, const QName &b)
 Returns true if equal.
 
bool operator!= (const QName &a, const QName &b)
 Returns true if not equal.
 
bool operator< (const QName &a, const QName &b)
 Returns true if less.
 

Detailed Description

A qualified XML name consists of a prefix separated by a colon from its local name. The prefix is used to refer to a namespace. This allows to distinguish between to attributes or elements with the same local name.