Changeset 165 in pacpusframework for branches/2.0-beta1/src/PacpusLib/XmlComponentConfig.cpp
- Timestamp:
- Aug 1, 2013, 6:30:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/src/PacpusLib/XmlComponentConfig.cpp
r162 r165 14 14 DECLARE_STATIC_LOGGER("pacpus.core.XmlComponentConfig"); 15 15 16 // FIXME: const char* instead of const string 17 static const string kPropertyComponentName = "name"; 18 static const string kPropertyComponentType = "type"; 19 static const string kPropertyConnectionType = "type"; 20 static const string kPropertyConnectionInput = "input"; 21 static const string kPropertyConnectionOutput = "output"; 22 static const string kPropertyConnectionPriority = "priority"; 23 //static const string kPropertyConnectionInputC = "inputC"; 24 //static const string kPropertyConnectionInputP = "inputP"; 25 //static const string kPropertyConnectionOutputC = "outputC"; 26 //static const string kPropertyConnectionOutputP = "outputP"; 16 static const char* kPropertyComponentName = "name"; 17 static const char* kPropertyComponentType = "type"; 18 static const char* kPropertyConnectionType = "type"; 19 static const char* kPropertyConnectionInput = "input"; 20 static const char* kPropertyConnectionOutput = "output"; 21 static const char* kPropertyConnectionPriority = "priority"; 27 22 28 23 XmlComponentConfig::XmlComponentConfig(const QString& name) … … 47 42 { 48 43 LOG_ERROR("cannot add component property:" 49 << " component '" << component_.attribute(kPropertyComponentName .c_str()) << "'"44 << " component '" << component_.attribute(kPropertyComponentName) << "'" 50 45 << " already contains property '" << name << "'" 51 46 << " and its value is '" << component_.attribute(name) << "'" … … 57 52 component_.setAttribute(name, 0); 58 53 LOG_INFO("property '" << name << "'" 59 << " was added to the component " << component_.attribute(kPropertyComponentName .c_str()) << "'"54 << " was added to the component " << component_.attribute(kPropertyComponentName) << "'" 60 55 << " and set to '" << component_.attribute(name) << "'" 61 56 ); … … 66 61 if (!hasProperty(name)) { 67 62 LOG_WARN("cannot delete compoenent property '" << name << "'" 68 << " of component '" << component_.attribute(kPropertyComponentName .c_str()) << "'"63 << " of component '" << component_.attribute(kPropertyComponentName) << "'" 69 64 << ". Component does not contain this property." 70 65 ); … … 75 70 component_.removeAttribute(name); 76 71 LOG_INFO("property '" << name << "' " 77 << " of component '" << component_.attribute(kPropertyComponentName .c_str()) << "'"72 << " of component '" << component_.attribute(kPropertyComponentName) << "'" 78 73 << " was deleted" 79 74 ); … … 87 82 { 88 83 LOG_WARN("cannot retrieve component property '" << name << "'" 89 << " of component '" << component_.attribute(kPropertyComponentName .c_str()) << "'"84 << " of component '" << component_.attribute(kPropertyComponentName) << "'" 90 85 << ". Component does not contain this property." 91 86 ); … … 116 111 component_.setAttribute(name, value); 117 112 LOG_INFO("property " << name 118 << " of the component " << component_.attribute(kPropertyComponentName .c_str())113 << " of the component " << component_.attribute(kPropertyComponentName) 119 114 << " was set to : " << value 120 115 ); … … 138 133 QString const XmlComponentConfig::getComponentName() const 139 134 { 140 //return component_.attribute(kPropertyComponentName.c_str()); 141 return getProperty(kPropertyComponentName.c_str()); 135 return getProperty(kPropertyComponentName); 142 136 } 143 137 144 138 QString const XmlComponentConfig::getComponentType() const 145 139 { 146 return getProperty(kPropertyComponentType .c_str());140 return getProperty(kPropertyComponentType); 147 141 } 148 142 149 143 QString const XmlComponentConfig::getConnectionType() const 150 144 { 151 return getProperty(kPropertyConnectionType .c_str());145 return getProperty(kPropertyConnectionType); 152 146 } 153 147 154 148 QString const XmlComponentConfig::getConnectionInput() const 155 149 { 156 return getProperty(kPropertyConnectionInput .c_str());150 return getProperty(kPropertyConnectionInput); 157 151 } 158 152 159 153 QString const XmlComponentConfig::getConnectionOutput() const 160 154 { 161 return getProperty(kPropertyConnectionOutput .c_str());155 return getProperty(kPropertyConnectionOutput); 162 156 } 163 157 164 158 int const XmlComponentConfig::getConnectionPriority() const 165 159 { 166 return getIntProperty(kPropertyConnectionPriority .c_str(),0);160 return getIntProperty(kPropertyConnectionPriority, /*defaultValue=*/0); 167 161 }
Note:
See TracChangeset
for help on using the changeset viewer.