summaryrefslogtreecommitdiffstats
path: root/parameter/IntegerParameterType.h
diff options
context:
space:
mode:
authorFrédéric Boisnard <fredericx.boisnard@intel.com>2012-08-06 19:03:01 +0200
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:03:12 +0100
commitdc32d63f2ed740af1bfc0b3f8fd2337cba46d895 (patch)
tree2afb4dd944e250bf86b172590f80d97f0be3506e /parameter/IntegerParameterType.h
parent7bd615ba9b4d44d78aa745a10e836d2e02f6a995 (diff)
downloadexternal_parameter-framework-dc32d63f2ed740af1bfc0b3f8fd2337cba46d895.zip
external_parameter-framework-dc32d63f2ed740af1bfc0b3f8fd2337cba46d895.tar.gz
external_parameter-framework-dc32d63f2ed740af1bfc0b3f8fd2337cba46d895.tar.bz2
PFW: Check if value provided is exactly an integer
BZ: 50802 Previously, if a fixed point value was provided for an integer parameter, there was no error. This was due to the results of strtol/strtoll which was not correctly checked (it would only fail if no digit was provided, but would succeed even if letters were appended after/before the digits). So for fixed point values, only the first part of the string was fetched, giving the impression of a truncation at the '.' character . Now the whole string shall be completly parsed for the conversion to succeed. Change-Id: Ia907e8cc05e5639e9a8bbd7204f46df5bdfa394a Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com> Reviewed-on: http://android.intel.com:8080/60743 Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com> Reviewed-by: Benavoli, Patrick <patrick.benavoli@intel.com> Reviewed-by: De Chivre, Renaud <renaud.de.chivre@intel.com> Tested-by: Mendi, EduardoX <eduardox.mendi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'parameter/IntegerParameterType.h')
-rw-r--r--parameter/IntegerParameterType.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/parameter/IntegerParameterType.h b/parameter/IntegerParameterType.h
index cbe349d..b29f0ac 100644
--- a/parameter/IntegerParameterType.h
+++ b/parameter/IntegerParameterType.h
@@ -62,8 +62,11 @@ private:
// Returns true if children dynamic creation is to be dealt with
virtual bool childrenAreDynamic() const;
+ // Conversion from string
+ bool convertValueFromString(const string& strValue, int64_t& iData, CParameterAccessContext& parameterAccessContext) const;
+
// Range checking
- template <typename type> bool checkValueAgainstRange(const string& strValue, type value, type minValue, type maxValue, CParameterAccessContext& parameterAccessContext, bool bHexaValue, bool bConversionSucceeded) const;
+ template <typename type> bool checkValueAgainstRange(const string& strValue, type value, type minValue, type maxValue, CParameterAccessContext& parameterAccessContext, bool bHexaValue) const;
// Adaptation element retrieval
const CParameterAdaptation* getParameterAdaptation() const;