Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

Tag::Attribute Class Reference

#include <tag.h>

List of all members.

Public Member Functions

 Attribute (Tag *parent, const std::string &name, const std::string &value, const std::string &xmlns=EmptyString)
 Attribute (const std::string &name, const std::string &value, const std::string &xmlns=EmptyString)
 Attribute (const Attribute &attr)
virtual ~Attribute ()
const std::string & name () const
const std::string & value () const
bool setValue (const std::string &value)
const std::string & xmlns () const
bool setXmlns (const std::string &xmlns)
bool setPrefix (const std::string &prefix)
const std::string & prefix () const
const std::string xml () const
bool operator== (const Attribute &right) const
bool operator!= (const Attribute &right) const
 operator bool () const


Detailed Description

An XML element's attribute.

Author:
Jakob Schroeter <js@camaya.net>
Since:
1.0

Definition at line 59 of file tag.h.


Constructor & Destructor Documentation

Attribute Tag parent,
const std::string &  name,
const std::string &  value,
const std::string &  xmlns = EmptyString
 

Creates a new Attribute from name, value and optional xmlns and attaches it to the given Tag.

In the future: If xmlns is not empty, and if it is different from the Tag's default namespace, an appropriate and unique namespace declaration (prefix) will be added to the Tag and the attribute will be prefixed accordingly.

Parameters:
parent The Tag to attach the Attribute to.
name The attribute's name. Invalid (non-UTF-8) input will be ignored.
value The attribute's value. Invalid (non-UTF-8) input will be ignored.
xmlns The attribute's namespace. Invalid (non-UTF-8) input will be ignored.

Definition at line 31 of file tag.cpp.

Attribute const std::string &  name,
const std::string &  value,
const std::string &  xmlns = EmptyString
 

Creates a new Attribute from name, value and optional xmlns.

Parameters:
name The attribute's name. Invalid (non-UTF-8) input will be ignored.
value The attribute's value. Invalid (non-UTF-8) input will be ignored.
xmlns The attribute's namespace. Invalid (non-UTF-8) input will be ignored.

Definition at line 41 of file tag.cpp.

Attribute const Attribute attr  ) 
 

Copy constructor.

Parameters:
attr The Attribute to copy.

Definition at line 48 of file tag.cpp.

virtual ~Attribute  )  [inline, virtual]
 

Destructor.

Definition at line 98 of file tag.h.


Member Function Documentation

const std::string& name  )  const [inline]
 

Returns the attribute's name.

Returns:
The attribute's name.

Definition at line 104 of file tag.h.

operator bool  )  const [inline]
 

Returns true if the Attribute is valid, false otherwise.

Definition at line 171 of file tag.h.

bool operator!= const Attribute right  )  const [inline]
 

Checks two Attributes for inequality.

Parameters:
right The Attribute to check against the current Attribute.

Definition at line 165 of file tag.h.

bool operator== const Attribute right  )  const [inline]
 

Checks two Attributes for equality.

Parameters:
right The Attribute to check against the current Attribute.

Definition at line 158 of file tag.h.

const std::string & prefix  )  const
 

Returns the attribute's namespace prefix.

Returns:
The namespace prefix.

Definition at line 111 of file tag.cpp.

bool setPrefix const std::string &  prefix  ) 
 

Sets the attribute's namespace prefix.

Parameters:
value The new namespace prefix.
Returns:
True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.

Definition at line 91 of file tag.cpp.

bool setValue const std::string &  value  ) 
 

Sets the attribute's value.

Parameters:
value The new value.
Returns:
True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.

Definition at line 73 of file tag.cpp.

bool setXmlns const std::string &  xmlns  ) 
 

Sets the attribute's namespace.

Parameters:
value The new namespace.
Returns:
True if the input is valid UTF-8, false otherwise. Invalid input will be ignored.

Definition at line 82 of file tag.cpp.

const std::string& value  )  const [inline]
 

Returns the attribute's value.

Returns:
The attribute's value.

Definition at line 110 of file tag.h.

const std::string xml  )  const
 

Returns a string representation of the attribute.

Returns:
A string representation.

Definition at line 122 of file tag.cpp.

const std::string & xmlns  )  const
 

Returns the attribute's namespace.

Returns:
The attribute's namespace.

Definition at line 100 of file tag.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Sep 1 09:25:14 2008 for gloox by  doxygen 1.4.1