----------------------------------------------------------------------------- Write ourselves to an XML document -----------------------------------------------------------------------------
| 193 | // Write ourselves to an XML document |
| 194 | //----------------------------------------------------------------------------- |
| 195 | void ValueBitSet::WriteXML |
| 196 | ( |
| 197 | TiXmlElement* _valueElement |
| 198 | ) |
| 199 | { |
| 200 | Value::WriteXML( _valueElement ); |
| 201 | char str[16]; |
| 202 | |
| 203 | snprintf(str, sizeof(str), "%d", m_BitMask); |
| 204 | _valueElement->SetAttribute( "bitmask", str); |
| 205 | |
| 206 | snprintf( str, sizeof(str), "%d", m_value.GetValue() ); |
| 207 | _valueElement->SetAttribute( "value", str ); |
| 208 | |
| 209 | snprintf( str, sizeof(str), "%d", m_size ); |
| 210 | _valueElement->SetAttribute( "size", str ); |
| 211 | |
| 212 | TiXmlElement *helpElement = _valueElement->FirstChildElement("Help"); |
| 213 | if (!helpElement) { |
| 214 | helpElement = new TiXmlElement( "Help" ); |
| 215 | _valueElement->LinkEndChild( helpElement ); |
| 216 | } |
| 217 | for (std::vector<int32>::iterator it = m_bits.begin(); it != m_bits.end(); ++it) { |
| 218 | TiXmlElement* BitSetElement = new TiXmlElement( "BitSet" ); |
| 219 | BitSetElement->SetAttribute("id", *it); |
| 220 | _valueElement->LinkEndChild( BitSetElement ); |
| 221 | |
| 222 | TiXmlElement* BitSetLabelElement = new TiXmlElement( "Label" ); |
| 223 | TiXmlText* labeltextElement = new TiXmlText(Localization::Get()->GetValueItemLabel(m_id.GetCommandClassId(), m_id.GetIndex(), -1, *it).c_str()); |
| 224 | BitSetLabelElement->LinkEndChild( labeltextElement ); |
| 225 | BitSetElement->LinkEndChild( BitSetLabelElement ); |
| 226 | |
| 227 | TiXmlElement* BitSetHelpElement = new TiXmlElement( "Help" ); |
| 228 | TiXmlText* helptextElement = new TiXmlText(Localization::Get()->GetValueItemHelp(m_id.GetCommandClassId(), m_id.GetIndex(), -1, *it).c_str()); |
| 229 | BitSetHelpElement->LinkEndChild( helptextElement ); |
| 230 | BitSetElement->LinkEndChild( BitSetHelpElement ); |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | //----------------------------------------------------------------------------- |
| 235 | // <ValueBitSet::Set> |
nothing calls this directly
no test coverage detected