X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Foption.cpp;h=9694a452fb399338aa4cbc2caa83a57dbbd2aff0;hb=56f67ecca96efc7b72d03c95c8c42cfb66e31468;hp=b79e90cda67223c8356608c02d6258d5494f7327;hpb=c7fcb4c4bc5012a584add81a9509fc1f84c3c688;p=fms.git diff --git a/src/option.cpp b/src/option.cpp index b79e90c..9694a45 100644 --- a/src/option.cpp +++ b/src/option.cpp @@ -20,3 +20,24 @@ const bool Option::Get(const std::string &option, std::string &value) return false; } } + +const bool Option::GetInt(const std::string &option, int &value) +{ + std::string valstr=""; + if(Get(option,valstr)) + { + std::istringstream istr(valstr); + if(istr >> value) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } +}