----------------------------------------------------------------------------- Write ourselves to an XML document -----------------------------------------------------------------------------
| 283 | // Write ourselves to an XML document |
| 284 | //----------------------------------------------------------------------------- |
| 285 | void Value::WriteXML |
| 286 | ( |
| 287 | TiXmlElement* _valueElement |
| 288 | ) |
| 289 | { |
| 290 | char str[16]; |
| 291 | |
| 292 | _valueElement->SetAttribute( "type", GetTypeNameFromEnum(m_id.GetType()) ); |
| 293 | _valueElement->SetAttribute( "genre", GetGenreNameFromEnum(m_id.GetGenre()) ); |
| 294 | |
| 295 | snprintf( str, sizeof(str), "%d", m_id.GetInstance() ); |
| 296 | _valueElement->SetAttribute( "instance", str ); |
| 297 | |
| 298 | snprintf( str, sizeof(str), "%d", (m_id.GetIndex() & 0x3FF) ); |
| 299 | _valueElement->SetAttribute( "index", str ); |
| 300 | |
| 301 | _valueElement->SetAttribute( "label", GetLabel().c_str() ); |
| 302 | _valueElement->SetAttribute( "units", m_units.c_str() ); |
| 303 | _valueElement->SetAttribute( "read_only", m_readOnly ? "true" : "false" ); |
| 304 | _valueElement->SetAttribute( "write_only", m_writeOnly ? "true" : "false" ); |
| 305 | _valueElement->SetAttribute( "verify_changes", m_verifyChanges ? "true" : "false" ); |
| 306 | |
| 307 | snprintf( str, sizeof(str), "%d", m_pollIntensity ); |
| 308 | _valueElement->SetAttribute( "poll_intensity", str ); |
| 309 | |
| 310 | snprintf( str, sizeof(str), "%d", m_min ); |
| 311 | _valueElement->SetAttribute( "min", str ); |
| 312 | |
| 313 | snprintf( str, sizeof(str), "%d", m_max ); |
| 314 | _valueElement->SetAttribute( "max", str ); |
| 315 | |
| 316 | if( m_affectsAll ) |
| 317 | { |
| 318 | _valueElement->SetAttribute( "affects", "all" ); |
| 319 | } |
| 320 | else if( m_affectsLength > 0 ) |
| 321 | { |
| 322 | string s; |
| 323 | for( int i = 0; i < m_affectsLength; i++ ) |
| 324 | { |
| 325 | snprintf( str, sizeof(str), "%d", m_affects[i] ); |
| 326 | s = s + str; |
| 327 | if( i + 1 < m_affectsLength ) |
| 328 | { |
| 329 | s = s + ","; |
| 330 | } |
| 331 | |
| 332 | } |
| 333 | _valueElement->SetAttribute( "affects", s.c_str() ); |
| 334 | } |
| 335 | Localization::Get()->WriteXMLVIDHelp(m_id.GetCommandClassId(), m_id.GetIndex(),-1, _valueElement); |
| 336 | } |
| 337 | |
| 338 | //----------------------------------------------------------------------------- |
| 339 | // <Value::Set> |
nothing calls this directly
no test coverage detected