File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1417,6 +1417,9 @@ inline bool toBoolean(const ::std::string& s) { return s=="true"||s=="1"
14171417inline int toInt (const ::std::string& s) { return ::std::stoi (s); }
14181418inline float toFloat (const ::std::string& s) { try { return ::std::stof (s); } catch (...) { return 0 .0f ; } }
14191419inline char toChar (int v) { return static_cast <char >(v); }
1420+ inline int parseInt (const ::std::string& s) { try { return ::std::stoi (s); } catch (...) { return 0 ; } }
1421+ inline float parseFloat (const ::std::string& s) { try { return ::std::stof (s); } catch (...) { return 0 .f ; } }
1422+ inline bool parseBoolean (const ::std::string& s){ return s==" true" ||s==" True" ||s==" TRUE" ||s==" 1" ; }
14201423inline ::std::string toUpperCase (::std::string s) { for (auto & c:s) c=::std::toupper ((unsigned char )c); return s; }
14211424inline ::std::string toLowerCase (::std::string s) { for (auto & c:s) c=::std::tolower ((unsigned char )c); return s; }
14221425inline ::std::string trim (const ::std::string& s) {
You can’t perform that action at this time.
0 commit comments