Changeset 288 in pacpusframework for trunk/src/PacpusLib/XmlComponentConfig.cpp
- Timestamp:
- Mar 26, 2014, 9:27:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/PacpusLib/XmlComponentConfig.cpp
r270 r288 22 22 static const char* kPropertyConnectionPriority = "priority"; 23 23 24 XmlComponentConfig::XmlComponentConfig( const QString& name)24 XmlComponentConfig::XmlComponentConfig(QString const& name) 25 25 { 26 26 LOG_TRACE("XmlComponentConfig(QString)"); … … 43 43 } 44 44 45 void XmlComponentConfig::addProperty( const QString& name)45 void XmlComponentConfig::addProperty(QString const& name) 46 46 { 47 47 if (hasProperty(name)) { … … 62 62 } 63 63 64 int XmlComponentConfig::delProperty( const QString& name)64 int XmlComponentConfig::delProperty(QString const& name) 65 65 { 66 66 if (!hasProperty(name)) { … … 82 82 } 83 83 84 QString XmlComponentConfig::getProperty( const QString& name, const QString& defaultValue) const84 QString XmlComponentConfig::getProperty(QString const& name, QString const& defaultValue) const 85 85 { 86 86 if (!hasProperty(name)) … … 97 97 } 98 98 99 bool XmlComponentConfig::getBoolProperty( const QString& name, bool defaultValue) const99 bool XmlComponentConfig::getBoolProperty(QString const& name, bool defaultValue) const 100 100 { 101 101 return hasProperty(name) ? getProperty(name) == "true" : defaultValue; 102 102 } 103 103 104 int XmlComponentConfig::getIntProperty( const QString& name, int defaultValue) const104 int XmlComponentConfig::getIntProperty(QString const& name, int defaultValue) const 105 105 { 106 106 return hasProperty(name) ? getProperty(name).toInt() : defaultValue; 107 107 } 108 108 109 double XmlComponentConfig::getDoubleProperty( const QString& name, double defaultValue) const109 double XmlComponentConfig::getDoubleProperty(QString const& name, double defaultValue) const 110 110 { 111 111 return hasProperty(name) ? getProperty(name).toDouble() : defaultValue; 112 112 } 113 113 114 void XmlComponentConfig::setProperty( const QString& name, const QString& value)114 void XmlComponentConfig::setProperty(QString const& name, QString const& value) 115 115 { 116 116 component_.setAttribute(name, value); … … 121 121 } 122 122 123 bool XmlComponentConfig::hasProperty( const QString& name) const123 bool XmlComponentConfig::hasProperty(QString const& name) const 124 124 { 125 125 return component_.hasAttribute(name);
Note:
See TracChangeset
for help on using the changeset viewer.