aboutsummaryrefslogtreecommitdiffstats
path: root/src/propertySet.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-05-15 18:05:38 +0000
committerVincent Richard <[email protected]>2005-05-15 18:05:38 +0000
commit8134a52f56697a51c734e1406d57a05fda77bac7 (patch)
treedd7fee1a9a7922fcdbaec7592b8ce39e1a031c38 /src/propertySet.cpp
parentOops... missing ')'. (diff)
downloadvmime-8134a52f56697a51c734e1406d57a05fda77bac7.tar.gz
vmime-8134a52f56697a51c734e1406d57a05fda77bac7.zip
Service properties enhancement.
Diffstat (limited to 'src/propertySet.cpp')
-rw-r--r--src/propertySet.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/propertySet.cpp b/src/propertySet.cpp
index 67f923ef..88ee4f57 100644
--- a/src/propertySet.cpp
+++ b/src/propertySet.cpp
@@ -324,6 +324,46 @@ const bool propertySet::property::getValue() const
}
}
+
+
+
+template <>
+const string propertySet::valueFromString(const string& value)
+{
+ return value;
+}
+
+
+template <>
+const string propertySet::valueToString(const string& value)
+{
+ return value;
+}
+
+
+template <>
+const bool propertySet::valueFromString(const string& value)
+{
+ if (utility::stringUtils::toLower(value) == "true")
+ return true;
+ else
+ {
+ int val = 0;
+
+ std::istringstream iss(value);
+ iss >> val;
+
+ return (!iss.fail() && val != 0);
+ }
+}
+
+
+template <>
+const string propertySet::valueToString(const bool& value)
+{
+ return (value ? "true" : "false");
+}
+
#endif // VMIME_INLINE_TEMPLATE_SPECIALIZATION