#include <RdsContainer.h>
Inheritance diagram for LiveSupport::Core::RdsContainer:
It is used by the OptionContainer class to hold RDS strings (see http://en.wikipedia.org/wiki/Radio_Data_System).
This object has to be configured with an XML configuration element called rdsContainer. This may look like the following:
<rdsContainer>
<rdsItem> ... </rdsItem>
<rdsItem> ... </rdsItem>
...
<rdsItem> ... </rdsItem>
</rdsContainer>
The DTD for the expected XML element is the following:
<!ELEMENT rdsContainer (rdsItem*) >
For a description of the rdsItem XML element, see the documentation of the RdsItem class.
Definition at line 95 of file RdsContainer.h.
Public Member Functions | |
RdsContainer () throw () | |
Constructor. | |
virtual | ~RdsContainer (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. | |
void | setRdsOptions (Ptr< const Glib::ustring >::Ref key, Ptr< const Glib::ustring >::Ref value, bool enabled) throw () |
Set the value of the RDS options. | |
Ptr< const Glib::ustring >::Ref | getRdsValue (Ptr< const Glib::ustring >::Ref key) throw (std::invalid_argument) |
Get the value of an RDS string. | |
bool | getRdsEnabled (Ptr< const Glib::ustring >::Ref key) throw (std::invalid_argument) |
Get the enabled/disabled state of an RDS option. | |
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::RdsContainer::RdsContainer | ( | ) | throw () [inline] |
virtual LiveSupport::Core::RdsContainer::~RdsContainer | ( | void | ) | throw () [inline, virtual] |
A virtual destructor, as this class has virtual functions.
Definition at line 139 of file RdsContainer.h.
void RdsContainer::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 62 of file RdsContainer.cxx.
static const std::string LiveSupport::Core::RdsContainer::getConfigElementName | ( | void | ) | throw () [inline, static] |
Return the name of the XML element this object expects to be sent to a call to configure().
Definition at line 150 of file RdsContainer.h.
Referenced by LiveSupport::Core::OptionsContainer::writeToFile().
bool RdsContainer::getRdsEnabled | ( | Ptr< const Glib::ustring >::Ref | key | ) | throw (std::invalid_argument) |
Get the enabled/disabled state of an RDS option.
key | which setting to modify. |
std::invalid_argument | if there is no such RDS option. |
Definition at line 142 of file RdsContainer.cxx.
Ptr< const Glib::ustring >::Ref RdsContainer::getRdsValue | ( | Ptr< const Glib::ustring >::Ref | key | ) | throw (std::invalid_argument) |
Get the value of an RDS string.
The key can be any of the RDS data codes, like PS, PI, PTY, RT, etc.
key | which setting to modify. |
std::invalid_argument | if there is no such RDS option. |
Definition at line 122 of file RdsContainer.cxx.
bool LiveSupport::Core::RdsContainer::isTouched | ( | void | ) | throw () [inline] |
Tells you whether the object has been touched since the last save.
Starts out false; set to true by setRdsString() and set back to false by toXmlElement().
Definition at line 230 of file RdsContainer.h.
void RdsContainer::setRdsOptions | ( | Ptr< const Glib::ustring >::Ref | key, | |
Ptr< const Glib::ustring >::Ref | value, | |||
bool | enabled | |||
) | throw () |
Set the value of the RDS options.
The key can be any of the RDS data codes, like PS, PI, PTY, RT, etc. If there is already a value set for this code, it gets overwritten, otherwise a new key-value pair is added.
key | which setting to modify. | |
value | the new value of the RDS setting. | |
enabled | whether this value will be broadcast. |
Definition at line 91 of file RdsContainer.cxx.
Ptr< Glib::ustring >::Ref RdsContainer::toString | ( | void | ) | throw () |
Convert the object to a string.
Definition at line 162 of file RdsContainer.cxx.
const xmlpp::Element * RdsContainer::toXmlElement | ( | void | ) | throw () |
Convert the object to XML.
Definition at line 180 of file RdsContainer.cxx.