diff options
author | Patrick Benavoli <patrickx.benavoli@intel.com> | 2011-08-31 11:23:24 +0200 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-10 17:13:21 +0100 |
commit | 6ba361d96bc2581667b3400f87ff89fae6449e1f (patch) | |
tree | e72e959d7d4c3b0f0b6dc20ec4f07d957eae1a50 /parameter/ConfigurableDomain.cpp | |
parent | 68a912857707864bbaaff9808717813105072a6e (diff) | |
download | external_parameter-framework-6ba361d96bc2581667b3400f87ff89fae6449e1f.zip external_parameter-framework-6ba361d96bc2581667b3400f87ff89fae6449e1f.tar.gz external_parameter-framework-6ba361d96bc2581667b3400f87ff89fae6449e1f.tar.bz2 |
parameter-framework: improvements and corrections
BZ: 6721
- Bug correction concerning selection criteria display (inclusive type)
- Adapted XML format to allow for only on parameter to be associated to
a domain
- Removed unused files in parameter project
Change-Id: I9f42d08ff8cb60354714fe3d6b0f0b321ad0a7bf
Orig-Change-Id: I837e553070f5acf2d275082c986ba29433493e31
Signed-off-by: Patrick Benavoli <patrickx.benavoli@intel.com>
Reviewed-on: http://android.intel.com:8080/16878
Reviewed-by: Mahe, Erwan <erwan.mahe@intel.com>
Tested-by: Barthes, FabienX <fabienx.barthes@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/ConfigurableDomain.cpp')
-rw-r--r-- | parameter/ConfigurableDomain.cpp | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/parameter/ConfigurableDomain.cpp b/parameter/ConfigurableDomain.cpp index 807171f..912fa5e 100644 --- a/parameter/ConfigurableDomain.cpp +++ b/parameter/ConfigurableDomain.cpp @@ -277,7 +277,38 @@ bool CConfigurableDomain::serializeConfigurableElementConfiguration(CDomainConfi // Actual XML context CXmlDomainSerializingContext& xmlDomainSerializingContext = static_cast<CXmlDomainSerializingContext&>(serializingContext); - // Change context type for parameter settings access + // Element content + CXmlElement xmlConfigurationSettingsElementContent; + + // Deal with element itself + if (!bSerializeOut) { + + // Check structure + if (xmlConfigurationSettingsElement.getNbChildElements() != 1) { + + // Structure error + serializingContext.setError("Struture error encountered while parsing settinsg of " + pConfigurableElement->getKind() + " " + pConfigurableElement->getName() + " in Configuration " + pDomainConfiguration->getName() + " in Domain " + getName()); + + return false; + } + + // Check name and kind + if (!xmlConfigurationSettingsElement.getChildElement(pConfigurableElement->getKind(), pConfigurableElement->getName(), xmlConfigurationSettingsElementContent)) { + + serializingContext.setError("Couldn't find settings for " + pConfigurableElement->getKind() + " " + pConfigurableElement->getName() + " for Configuration " + pDomainConfiguration->getName() + " in Domain " + getName()); + + return false; + } + } else { + + // Create child XML element + xmlConfigurationSettingsElement.createChild(xmlConfigurationSettingsElementContent, pConfigurableElement->getKind()); + + // Set Name + xmlConfigurationSettingsElementContent.setNameAttribute(pConfigurableElement->getName()); + } + + // Change context type to parameter settings access string strError; // Create configuration access context @@ -286,6 +317,9 @@ bool CConfigurableDomain::serializeConfigurableElementConfiguration(CDomainConfi // Provide current value space configurationAccessContext.setValueSpaceRaw(xmlDomainSerializingContext.valueSpaceIsRaw()); + // Provide current output raw format + configurationAccessContext.setOutputRawFormat(xmlDomainSerializingContext.outputRawFormatIsHex()); + // Get subsystem const CSubsystem* pSubsystem = pConfigurableElement->getBelongingSubsystem(); @@ -298,7 +332,7 @@ bool CConfigurableDomain::serializeConfigurableElementConfiguration(CDomainConfi } // Have domain configuration parse settings for configurable element - if (!pDomainConfiguration->serializeXmlSettings(pConfigurableElement, xmlConfigurationSettingsElement, configurationAccessContext)) { + if (!pDomainConfiguration->serializeXmlSettings(pConfigurableElement, xmlConfigurationSettingsElementContent, configurationAccessContext)) { // Forward error xmlDomainSerializingContext.setError(strError); @@ -735,32 +769,7 @@ bool CConfigurableDomain::autoValidateConfiguration(CDomainConfiguration* pDomai } return false; } -#if 0 -void CConfigurableDomain::autoValidateConfiguration(CDomainConfiguration* pDomainConfiguration) -{ - // Validate - ConfigurableElementListIterator it; - - // Browse all configurable elements for configuration validation - for (it = _configurableElementList.begin(); it != _configurableElementList.end(); ++it) { - - const CConfigurableElement* pConfigurableElement = *it; - // Find first valid configuration for given configurable element - const CDomainConfiguration* pValidDomainConfiguration = findValidDomainConfiguration(pConfigurableElement); - - // Check valid configuration exists for that configurable element - if (pValidDomainConfiguration) { - - // Called on purpose - assert(pValidDomainConfiguration != pDomainConfiguration); - - // Validate - pDomainConfiguration->validateAgainst(pValidDomainConfiguration, pConfigurableElement); - } - } -} -#endif // Search for a valid configuration for given configurable element const CDomainConfiguration* CConfigurableDomain::findValidDomainConfiguration(const CConfigurableElement* pConfigurableElement) const { |