diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-27 22:40:40 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-27 22:40:40 +0200 |
commit | 6f25f5d9390ae247970ad886dc51d55435285831 (patch) | |
tree | e5c748d1e5598cdd658741a4b35890cec636d37a /src/utils/stringutils.h | |
parent | 661d16e98c62dfff40f481177bf3f1a0c58c2124 (diff) | |
download | mana-6f25f5d9390ae247970ad886dc51d55435285831.tar.gz mana-6f25f5d9390ae247970ad886dc51d55435285831.tar.bz2 mana-6f25f5d9390ae247970ad886dc51d55435285831.tar.xz mana-6f25f5d9390ae247970ad886dc51d55435285831.zip |
Centralized String to bool conversion into the client.
The former XML::getBoolProperty() had a potential memleak
and was unsafe when dealing with unknown values.
Reviewed-by: CodyMartin.
Resolves: Mana-Mantis #213.
Diffstat (limited to 'src/utils/stringutils.h')
-rw-r--r-- | src/utils/stringutils.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index 012ae98f..f032733d 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -122,7 +122,8 @@ int compareStrI(const std::string &a, const std::string &b); bool isWordSeparator(char chr); -const std::string findSameSubstring(const std::string &str1, const std::string &str2); +const std::string findSameSubstring(const std::string &str1, + const std::string &str2); const char* getSafeUtf8String(std::string text); @@ -132,7 +133,7 @@ const char* getSafeUtf8String(std::string text); * @param text the string used to get the bool value * @return a boolean value.. */ -bool getBoolFromString(const std::string &text); +bool getBoolFromString(const std::string &text, bool def = false); std::string autocomplete(std::vector<std::string> &candidates, std::string base); |