#include <RdsItem.h>
Inheritance diagram for LiveSupport::Core::RdsItem:
This object has to be configured with an XML configuration element called rdsItem. This may look like the following:
<rdsItem key = "PS"
value = "BBC Four"
enabled = "1" />
The possible key values are PS, PI, RT, etc (see http://en.wikipedia.org/wiki/Radio_Data_System).
There value attribute can be any string.
The enabled attribute is either 0 (disabled) or 1 (enabled).
The DTD for the expected XML element looks like the following:
<!ELEMENT rdsItem EMPTY >
<!ATTLIST rdsItem key CDATA REQUIRED >
<!ATTLIST rdsItem value CDATA REQUIRED >
<!ATTLIST rdsItem enabled CDATA REQUIRED >
Definition at line 95 of file RdsItem.h.
Public Member Functions | |
RdsItem () throw () | |
Default constructor. | |
RdsItem (Ptr< const Glib::ustring >::Ref key, Ptr< const Glib::ustring >::Ref value, bool enabled=false) throw () | |
Constructor which sets the variables. | |
virtual | ~RdsItem (void) throw () |
A virtual destructor, as this class has virtual functions. | |
virtual void | configure (const xmlpp::Element &element) throw (std::invalid_argument) |
Configure the object based on an XML configuration element. | |
Ptr< const Glib::ustring >::Ref | getKey (void) throw () |
Get the key. | |
Ptr< const Glib::ustring >::Ref | getValue (void) throw () |
Get the value. | |
void | setValue (Ptr< const Glib::ustring >::Ref value) throw () |
Set the value. | |
bool | getEnabled (void) throw () |
Get the enabled/disabled flag. | |
void | setEnabled (bool enabled) throw () |
Set the enabled/disabled flag. | |
Ptr< Glib::ustring >::Ref | toString (void) throw () |
Convert the object to a string. | |
const xmlpp::Element * | toXmlElement (void) throw () |
Convert the object to XML. | |
bool | isTouched (void) throw () |
Tells you whether the object has been touched since the last save. | |
Static Public Member Functions | |
static const std::string | getConfigElementName (void) throw () |
Return the name of the XML element this object expects to be sent to a call to configure(). |
LiveSupport::Core::RdsItem::RdsItem | ( | ) | throw () [inline] |
virtual LiveSupport::Core::RdsItem::~RdsItem | ( | void | ) | throw () [inline, virtual] |
void RdsItem::configure | ( | const xmlpp::Element & | element | ) | throw (std::invalid_argument) [virtual] |
Configure the object based on an XML configuration element.
element | the XML configuration element. |
std::invalid_argument | if the supplied XML element contains bad configuration information |
Implements LiveSupport::Core::Configurable.
Definition at line 80 of file RdsItem.cxx.
References enabledAttributeName, keyAttributeName, and valueAttributeName.
static const std::string LiveSupport::Core::RdsItem::getConfigElementName | ( | void | ) | throw () [inline, static] |
Return the name of the XML element this object expects to be sent to a call to configure().
bool LiveSupport::Core::RdsItem::getEnabled | ( | void | ) | throw () [inline] |
Ptr<const Glib::ustring>::Ref LiveSupport::Core::RdsItem::getKey | ( | void | ) | throw () [inline] |
Ptr<const Glib::ustring>::Ref LiveSupport::Core::RdsItem::getValue | ( | void | ) | throw () [inline] |
bool LiveSupport::Core::RdsItem::isTouched | ( | void | ) | throw () [inline] |
Tells you whether the object has been touched since the last save.
Starts out false; set to true by setValue() and setEnabled(); set back to false by toXmlElement().
void LiveSupport::Core::RdsItem::setEnabled | ( | bool | enabled | ) | throw () [inline] |
void LiveSupport::Core::RdsItem::setValue | ( | Ptr< const Glib::ustring >::Ref | value | ) | throw () [inline] |
Ptr< Glib::ustring >::Ref RdsItem::toString | ( | void | ) | throw () |
Convert the object to a string.
Definition at line 129 of file RdsItem.cxx.
const xmlpp::Element * RdsItem::toXmlElement | ( | void | ) | throw () |
Convert the object to XML.
Definition at line 148 of file RdsItem.cxx.
References enabledAttributeName, keyAttributeName, and valueAttributeName.