From 2ecf900ad8c30ce9f8e81f57977a1a80a6f6d8af Mon Sep 17 00:00:00 2001 From: Patrick Benavoli Date: Wed, 31 Aug 2011 11:23:24 +0200 Subject: Parameter Framework: Parameter property display BZ: 7137 Added showProperties remote command Changed EQU to MONO_EQ for CAPTURE paths in LPE Subsystem structure definition Had to create a generic class for Parameter and BitParameter classes Change-Id: If6ab97ff002d8ba81df5a4a60bc3eb07dbe14e5e Orig-Change-Id: I425f81cd414b1c721f5c11169e9a489f5c638ab9 Signed-off-by: Patrick Benavoli Reviewed-on: http://android.intel.com:8080/16879 Reviewed-by: Mahe, Erwan Tested-by: Barthes, FabienX Reviewed-by: buildbot Tested-by: buildbot --- parameter/ConfigurableElement.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'parameter/ConfigurableElement.cpp') diff --git a/parameter/ConfigurableElement.cpp b/parameter/ConfigurableElement.cpp index 2fcde7a..f439ebf 100644 --- a/parameter/ConfigurableElement.cpp +++ b/parameter/ConfigurableElement.cpp @@ -34,7 +34,6 @@ #include "ConfigurableDomain.h" #include "ConfigurationAccessContext.h" #include "ConfigurableElementAggregator.h" -#include #include #define base CElement @@ -128,13 +127,13 @@ bool CConfigurableElement::serializeXmlSettings(CXmlElement& xmlConfigurationSet } // Parameter access -bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& strValue, CErrorContext& errorContext) const +bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& strValue, CParameterAccessContext& parameterContext) const { string* pStrChildName = pathNavigator.next(); if (!pStrChildName) { - errorContext.setError("Non settable element"); + parameterContext.setError("Non settable element"); return false; } @@ -143,21 +142,21 @@ bool CConfigurableElement::setValue(CPathNavigator& pathNavigator, const string& if (!pChild) { - errorContext.setError("Path not found: " + pathNavigator.getCurrentPath()); + parameterContext.setError("Path not found: " + pathNavigator.getCurrentPath()); return false; } - return pChild->setValue(pathNavigator, strValue, errorContext); + return pChild->setValue(pathNavigator, strValue, parameterContext); } -bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strValue, CErrorContext& errorContext) const +bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strValue, CParameterAccessContext& parameterContext) const { string* pStrChildName = pathNavigator.next(); if (!pStrChildName) { - errorContext.setError("Non gettable element"); + parameterContext.setError("Non gettable element"); return false; } @@ -166,12 +165,12 @@ bool CConfigurableElement::getValue(CPathNavigator& pathNavigator, string& strVa if (!pChild) { - errorContext.setError("Path not found: " + pathNavigator.getCurrentPath()); + parameterContext.setError("Path not found: " + pathNavigator.getCurrentPath()); return false; } - return pChild->getValue(pathNavigator, strValue, errorContext); + return pChild->getValue(pathNavigator, strValue, parameterContext); } // Used for simulation only @@ -189,6 +188,14 @@ void CConfigurableElement::setDefaultValues(CParameterAccessContext& parameterAc } } +// Element properties +void CConfigurableElement::showProperties(string& strResult) const +{ + base::showProperties(strResult); + + strResult += "Total size: " + getFootprintAsString() + "\n"; +} + // Offset void CConfigurableElement::setOffset(uint32_t uiOffset) { @@ -350,11 +357,7 @@ void CConfigurableElement::listRogueElements(string& strResult) const string CConfigurableElement::getFootprintAsString() const { // Get size as string - ostringstream str; - - str << getFootPrint() << " bytes"; - - return str.str(); + return toString(getFootPrint()) + " byte(s)"; } // Matching check for no domain association -- cgit v1.1