aboutsummaryrefslogtreecommitdiffstats
path: root/parameter/ConfigurableElement.cpp
diff options
context:
space:
mode:
authorPatrick Benavoli <patrickx.benavoli@intel.com>2011-08-31 11:23:24 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-10 17:13:21 +0100
commit6ba361d96bc2581667b3400f87ff89fae6449e1f (patch)
treee72e959d7d4c3b0f0b6dc20ec4f07d957eae1a50 /parameter/ConfigurableElement.cpp
parent68a912857707864bbaaff9808717813105072a6e (diff)
downloadexternal_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/ConfigurableElement.cpp')
-rw-r--r--parameter/ConfigurableElement.cpp79
1 files changed, 15 insertions, 64 deletions
diff --git a/parameter/ConfigurableElement.cpp b/parameter/ConfigurableElement.cpp
index 9707fb2..2fcde7a 100644
--- a/parameter/ConfigurableElement.cpp
+++ b/parameter/ConfigurableElement.cpp
@@ -34,6 +34,7 @@
#include "ConfigurableDomain.h"
#include "ConfigurationAccessContext.h"
#include "ConfigurableElementAggregator.h"
+#include <sstream>
#include <assert.h>
#define base CElement
@@ -47,14 +48,14 @@ CConfigurableElement::~CConfigurableElement()
}
// XML configuration settings parsing
-bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurableElementSettingsElement, CConfigurationAccessContext& configurationAccessContext) const
+bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurationSettingsElementContent, CConfigurationAccessContext& configurationAccessContext) const
{
uint32_t uiIndex;
uint32_t uiNbChildren = getNbChildren();
if (!configurationAccessContext.serializeOut()) {
// Just do basic checks and propagate to children
- CXmlElement::CChildIterator it(xmlConfigurableElementSettingsElement);
+ CXmlElement::CChildIterator it(xmlConfigurationSettingsElementContent);
CXmlElement xmlChildConfigurableElementSettingsElement;
@@ -113,7 +114,7 @@ bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurableElem
// Create corresponding child element
CXmlElement xmlChildConfigurableElementSettingsElement;
- xmlConfigurableElementSettingsElement.createChild(xmlChildConfigurableElementSettingsElement, pChildConfigurableElement->getKind());
+ xmlConfigurationSettingsElementContent.createChild(xmlChildConfigurableElementSettingsElement, pChildConfigurableElement->getKind());
// Handle element name attribute
xmlChildConfigurableElementSettingsElement.setNameAttribute(pChildConfigurableElement->getName());
@@ -126,67 +127,6 @@ bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurableElem
return true;
}
-#if 0
-bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurableElementSettingsElement, CConfigurationAccessContext& configurationAccessContext) const
-{
- if (!configurationAccessContext.serializeOut()) {
- // Just do basic checks and propagate to children
- CXmlElement::CChildIterator it(xmlConfigurableElementSettingsElement);
-
- CXmlElement xmlChildConfigurableElementSettingsElement;
-
- while (it.next(xmlChildConfigurableElementSettingsElement)) {
-
- // Find child configurable element
- const CConfigurableElement* pChildConfigurableElement = static_cast<const CConfigurableElement*>(findChild(xmlChildConfigurableElementSettingsElement.getNameAttribute()));
-
- if (!pChildConfigurableElement) {
-
- configurationAccessContext.setError("Configuration settings parsing: Unable to find configurable element " + xmlChildConfigurableElementSettingsElement.getNameAttribute() + " under configurable element " + getName());
-
- return false;
- }
-
- // Check element type matches
- if (xmlChildConfigurableElementSettingsElement.getType() != pChildConfigurableElement->getKind()) {
-
- configurationAccessContext.setError("Settings for configurable element " + pChildConfigurableElement->getName() + " does not match expected type: " + xmlChildConfigurableElementSettingsElement.getType() + " instead of " + pChildConfigurableElement->getKind());
-
- return false;
- }
-
- // Parse child configurable element's settings
- if (!pChildConfigurableElement->serializeXmlSettings(xmlChildConfigurableElementSettingsElement, configurationAccessContext)) {
-
- return false;
- }
- }
- } else {
- // Propagate to children
- uint32_t uiIndex;
- uint32_t uiNbChildren = getNbChildren();
-
- for (uiIndex = 0; uiIndex < uiNbChildren; uiIndex++) {
-
- const CConfigurableElement* pChildConfigurableElement = static_cast<const CConfigurableElement*>(getChild(uiIndex));
-
- // Create corresponding child element
- CXmlElement xmlChildConfigurableElementSettingsElement;
-
- xmlConfigurableElementSettingsElement.createChild(xmlChildConfigurableElementSettingsElement, pChildConfigurableElement->getKind());
-
- // Handle element name attribute
- xmlChildConfigurableElementSettingsElement.setNameAttribute(pChildConfigurableElement->getName());
-
- // Propagate
- pChildConfigurableElement->serializeXmlSettings(xmlChildConfigurableElementSettingsElement, configurationAccessContext);
- }
- }
- // Done
- return true;
-}
-#endif
-
// Parameter access
bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& strValue, CErrorContext& errorContext) const
{
@@ -406,6 +346,17 @@ void CConfigurableElement::listRogueElements(string& strResult) const
}
}
+// Footprint as string
+string CConfigurableElement::getFootprintAsString() const
+{
+ // Get size as string
+ ostringstream str;
+
+ str << getFootPrint() << " bytes";
+
+ return str.str();
+}
+
// Matching check for no domain association
bool CConfigurableElement::hasNoDomainAssociated() const
{