diff options
Diffstat (limited to 'parameter/SelectionCriterionType.cpp')
-rw-r--r-- | parameter/SelectionCriterionType.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/parameter/SelectionCriterionType.cpp b/parameter/SelectionCriterionType.cpp index 3e9cc80..95e8e46 100644 --- a/parameter/SelectionCriterionType.cpp +++ b/parameter/SelectionCriterionType.cpp @@ -203,3 +203,26 @@ std::string CSelectionCriterionType::getFormattedState(int iValue) const return strFormattedState; } + +// From IXmlSource +void CSelectionCriterionType::toXml(CXmlElement& xmlElement, CXmlSerializingContext& serializingContext) const +{ + // Type Kind + xmlElement.setAttributeString("Kind", isTypeInclusive() ? "Inclusive" : "Exclusive"); + + // Value pairs as children + NumToLitMapConstIt it; + + for (it = _numToLitMap.begin(); it != _numToLitMap.end(); ++it) { + + CXmlElement childValuePairElement; + + xmlElement.createChild(childValuePairElement, "ValuePair"); + // Literal + childValuePairElement.setAttributeString("Literal", it->first); + // Numerical + childValuePairElement.setAttributeSignedInteger("Numerical", it->second); + } + + base::toXml(xmlElement, serializingContext); +} |