summaryrefslogtreecommitdiff
path: root/project2/common/variableConvert.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-03-29 21:37:22 +0000
committerrandomdan <randomdan@localhost>2013-03-29 21:37:22 +0000
commit3f47498cc4a4e394108306119bb9a78007bd79ba (patch)
tree3c4c7fceb294b5cd97b9a3324d137d43d163b9ac /project2/common/variableConvert.cpp
parentMore aggregates (diff)
downloadproject2-3f47498cc4a4e394108306119bb9a78007bd79ba.tar.bz2
project2-3f47498cc4a4e394108306119bb9a78007bd79ba.tar.xz
project2-3f47498cc4a4e394108306119bb9a78007bd79ba.zip
Split variable and variabletype code into separate files
Use variabletype in populating options data Add code for guessing the type of some input data
Diffstat (limited to 'project2/common/variableConvert.cpp')
-rw-r--r--project2/common/variableConvert.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp
index 6237c26..d0363f5 100644
--- a/project2/common/variableConvert.cpp
+++ b/project2/common/variableConvert.cpp
@@ -151,8 +151,8 @@ class ConvertVisitorBool : public boost::static_visitor<bool> {
private:
static bool fromStr(const Glib::ustring & s) {
const char * str = s.c_str();
- if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0) return true;
- if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0 || strcasecmp(str, "off") == 0) return false;
+ if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0 || strcasecmp(str, "1") == 0) return true;
+ if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0 || strcasecmp(str, "off") == 0 || strcasecmp(str, "0") == 0) return false;
throw InvalidConversionTo("bool", s);
}
const VariableType * var;