Added <cctype> and std::tolower

This commit is contained in:
Craig Hutchinson 2015-12-03 15:29:10 +00:00
parent 7ae2f08fa5
commit 8472c109a7

View File

@ -35,6 +35,7 @@
#define TBC_TEXT_FORMAT_H_INCLUDED #define TBC_TEXT_FORMAT_H_INCLUDED
#endif #endif
#include <cctype>
#include <string> #include <string>
#include <vector> #include <vector>
#include <sstream> #include <sstream>
@ -232,7 +233,7 @@ namespace Clara {
} }
inline void convertInto( std::string const& _source, bool& _dest ) { inline void convertInto( std::string const& _source, bool& _dest ) {
std::string sourceLC = _source; std::string sourceLC = _source;
std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower ); std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), std::tolower );
if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" ) if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
_dest = true; _dest = true;
else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" ) else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )