Mercurial > minori
comparison src/core/strings.cc @ 120:275da698697d
config: template-ify INI
now it's... slightly less ugly :')
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 08 Nov 2023 18:13:37 -0500 |
parents | 39521c47c7a3 |
children | 9613d72b097e |
comparison
equal
deleted
inserted
replaced
119:4eae379cb1ff | 120:275da698697d |
---|---|
156 | 156 |
157 QString ToQString(const std::wstring& wstring) { | 157 QString ToQString(const std::wstring& wstring) { |
158 return QString::fromWCharArray(wstring.c_str(), wstring.length()); | 158 return QString::fromWCharArray(wstring.c_str(), wstring.length()); |
159 } | 159 } |
160 | 160 |
161 /* not really an "int"... but who cares? */ | |
161 int ToInt(const std::string& str, int def) { | 162 int ToInt(const std::string& str, int def) { |
162 int tmp = 0; | 163 int tmp = 0; |
163 try { | 164 try { |
164 tmp = std::stoi(str); | 165 tmp = std::stoi(str); |
165 } catch (std::invalid_argument const& ex) { | 166 } catch (std::invalid_argument const& ex) { |