summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-03-12 12:54:50 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2015-03-12 12:54:50 +0100
commit1c979ff4204876698426b95f11636a7668a8932b (patch)
treed1228e27823737b5f66a27c9513aa0c4c6aaf994
parent6096f9f0f6e158932efc7389b5fb303f87640511 (diff)
added methods IniValue::stringValue(), IniValue::numericValue(), etcv1.3.1
-rw-r--r--include/inivalue.h32
1 files changed, 26 insertions, 6 deletions
diff --git a/include/inivalue.h b/include/inivalue.h
index 9f2e44c..fc3bc8f 100644
--- a/include/inivalue.h
+++ b/include/inivalue.h
@@ -58,7 +58,7 @@ public:
*/
operator bool () const
{
- return (bool)numericValue();
+ return boolValue();
}
/**
@@ -67,7 +67,7 @@ public:
*/
operator std::string () const
{
- return rawValue();
+ return stringValue();
}
/**
@@ -84,9 +84,7 @@ public:
* @return double
*/
operator double() const;
-
-private:
-
+
/**
* Retrieve the value as number
*
@@ -98,12 +96,34 @@ private:
* @return int64_t
*/
int64_t numericValue() const;
+
+ /**
+ * Boolean value
+ * @return bool
+ */
+ bool boolValue() const
+ {
+ return (bool)numericValue();
+ }
+
+ /**
+ * String value
+ * @return std::string
+ */
+ std::string stringValue() const
+ {
+ return std::string(rawValue());
+ }
/**
- * Get access to the raw buffer for read operationrs.
+ * Get access to the raw buffer for read operations.
* @return const char *
*/
const char *rawValue() const;
+
+
+private:
+
/**
* ini entry name