aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/SelectionCriterionRule.cpp
diff options
context:
space:
mode:
authorDavid Wagner <david.wagner@intel.com>2014-12-19 11:15:02 +0100
committerDavid Wagner <david.wagner@intel.com>2015-01-22 11:53:52 +0100
commit29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b (patch)
tree5786f9d76eae3a29eb7f22a0727921979e53c8bb /parameter/SelectionCriterionRule.cpp
parentc39e7f4bbad04e92b53054b61b3f3deaa98ccd61 (diff)
downloadexternal_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.zip
external_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.tar.gz
external_parameter-framework-29fa61fc5bc02f72f99e66ad50e4de8cb6b8490b.tar.bz2
Extract and specialize domain import- and export-specific contexts
Import and Export of ConfigurableDomains have different context needs: e.g. the value representation is only used for export; auto-validation is only meaningful for import whereas the "with settings" context is common to both. We create two new classes, derived from XmlDomainSerializingContext and move most of its content to each class it belongs to. Change-Id: I56589cdb3a8ea417e11d2ed98ccd055d7cdead67 Signed-off-by: David Wagner <david.wagner@intel.com>
Diffstat (limited to 'parameter/SelectionCriterionRule.cpp')
-rw-r--r--parameter/SelectionCriterionRule.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/parameter/SelectionCriterionRule.cpp b/parameter/SelectionCriterionRule.cpp
index 6f350c3..b6df7aa 100644
--- a/parameter/SelectionCriterionRule.cpp
+++ b/parameter/SelectionCriterionRule.cpp
@@ -30,6 +30,7 @@
#include "SelectionCriterionRule.h"
#include "SelectionCriterion.h"
#include "XmlDomainSerializingContext.h"
+#include "XmlDomainImportContext.h"
#include "SelectionCriteriaDefinition.h"
#include "SelectionCriterionTypeInterface.h"
#include "RuleParser.h"
@@ -152,17 +153,17 @@ bool CSelectionCriterionRule::matches() const
bool CSelectionCriterionRule::fromXml(const CXmlElement& xmlElement, CXmlSerializingContext& serializingContext)
{
// Retrieve actual context
- CXmlDomainSerializingContext& xmlDomainSerializingContext = static_cast<CXmlDomainSerializingContext&>(serializingContext);
+ CXmlDomainImportContext& xmlDomainImportContext = static_cast<CXmlDomainImportContext&>(serializingContext);
// Get selection criterion
string strSelectionCriterion = xmlElement.getAttributeString("SelectionCriterion");
- _pSelectionCriterion = xmlDomainSerializingContext.getSelectionCriteriaDefinition()->getSelectionCriterion(strSelectionCriterion);
+ _pSelectionCriterion = xmlDomainImportContext.getSelectionCriteriaDefinition()->getSelectionCriterion(strSelectionCriterion);
// Check existence
if (!_pSelectionCriterion) {
- xmlDomainSerializingContext.setError("Couldn't find selection criterion " + strSelectionCriterion + " in " + getKind() + " " + xmlElement.getPath());
+ xmlDomainImportContext.setError("Couldn't find selection criterion " + strSelectionCriterion + " in " + getKind() + " " + xmlElement.getPath());
return false;
}
@@ -173,7 +174,7 @@ bool CSelectionCriterionRule::fromXml(const CXmlElement& xmlElement, CXmlSeriali
if (!setMatchesWhen(strMatchesWhen, strError)) {
- xmlDomainSerializingContext.setError("Wrong MatchesWhen attribute " + strMatchesWhen + " in " + getKind() + " " + xmlElement.getPath() + ": " + strError);
+ xmlDomainImportContext.setError("Wrong MatchesWhen attribute " + strMatchesWhen + " in " + getKind() + " " + xmlElement.getPath() + ": " + strError);
return false;
}
@@ -183,7 +184,7 @@ bool CSelectionCriterionRule::fromXml(const CXmlElement& xmlElement, CXmlSeriali
if (!_pSelectionCriterion->getCriterionType()->getNumericalValue(strValue, _iMatchValue)) {
- xmlDomainSerializingContext.setError("Wrong Value attribute value " + strValue + " in " + getKind() + " " + xmlElement.getPath());
+ xmlDomainImportContext.setError("Wrong Value attribute value " + strValue + " in " + getKind() + " " + xmlElement.getPath());
return false;
}