#include "Properties.h" #include "../util/StringUtil.h" static const string STRING_TRUE("true"); static const string STRING_FALSE("false"); namespace Feather::Config { template <> string Properties::Get(string_view key) { return properties.at(string(key)); } template <> bool Properties::Get(string_view key) { string value = Get(key); if (StringUtil::iequal(value, STRING_TRUE)) { return true; } else { // Java's Boolean.valueOf does not care about anything other than "true" return false; } } template <> int Properties::Get(string_view key) { return std::stoi(Get(key)); } template <> long Properties::Get(string_view key) { return std::stol(Get(key)); } template <> long long Properties::Get(string_view key) { return std::stoll(Get(key)); } }