Changeset 288 in pacpusframework for trunk/src/PacpusLib/XmlComponentConfig.cpp


Ignore:
Timestamp:
03/26/14 21:27:30 (10 years ago)
Author:
Marek Kurdej
Message:

Using boost::shared_ptr for storing components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PacpusLib/XmlComponentConfig.cpp

    r270 r288  
    2222static const char* kPropertyConnectionPriority = "priority";
    2323
    24 XmlComponentConfig::XmlComponentConfig(const QString& name)
     24XmlComponentConfig::XmlComponentConfig(QString const& name)
    2525{
    2626    LOG_TRACE("XmlComponentConfig(QString)");
     
    4343}
    4444
    45 void XmlComponentConfig::addProperty(const QString& name)
     45void XmlComponentConfig::addProperty(QString const& name)
    4646{
    4747    if (hasProperty(name)) {
     
    6262}
    6363
    64 int XmlComponentConfig::delProperty(const QString& name)
     64int XmlComponentConfig::delProperty(QString const& name)
    6565{
    6666    if (!hasProperty(name)) {
     
    8282}
    8383
    84 QString XmlComponentConfig::getProperty(const QString& name, const QString& defaultValue) const
     84QString XmlComponentConfig::getProperty(QString const& name, QString const& defaultValue) const
    8585{
    8686    if (!hasProperty(name))
     
    9797}
    9898
    99 bool XmlComponentConfig::getBoolProperty(const QString& name, bool defaultValue) const
     99bool XmlComponentConfig::getBoolProperty(QString const& name, bool defaultValue) const
    100100{
    101101  return hasProperty(name) ? getProperty(name) == "true" : defaultValue;
    102102}
    103103
    104 int XmlComponentConfig::getIntProperty(const QString& name, int defaultValue) const
     104int XmlComponentConfig::getIntProperty(QString const& name, int defaultValue) const
    105105{
    106106  return hasProperty(name) ? getProperty(name).toInt() : defaultValue;
    107107}
    108108
    109 double XmlComponentConfig::getDoubleProperty(const QString& name, double defaultValue) const
     109double XmlComponentConfig::getDoubleProperty(QString const& name, double defaultValue) const
    110110{
    111111  return hasProperty(name) ? getProperty(name).toDouble() : defaultValue;
    112112}
    113113
    114 void XmlComponentConfig::setProperty(const QString& name, const QString& value)
     114void XmlComponentConfig::setProperty(QString const& name, QString const& value)
    115115{
    116116    component_.setAttribute(name, value);
     
    121121}
    122122
    123 bool XmlComponentConfig::hasProperty(const QString& name) const
     123bool XmlComponentConfig::hasProperty(QString const& name) const
    124124{
    125125    return component_.hasAttribute(name);
Note: See TracChangeset for help on using the changeset viewer.