mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-28 23:21:18 +01:00
replace stoi with StringTo<int>
This commit is contained in:
@@ -922,7 +922,7 @@ int Module::getThresholdEnergy() {
|
||||
std::string result = getAdditionalJsonParameter("threshold");
|
||||
// convert to integer
|
||||
try {
|
||||
return stoi(result);
|
||||
return std::stoi(result);
|
||||
}
|
||||
// not found or cannot scan integer
|
||||
catch (...) {
|
||||
@@ -2139,7 +2139,7 @@ std::string Module::setAdditionalJsonParameter(const std::string &key,
|
||||
std::string valueLiteral(value);
|
||||
// add quotations to value only if it is a string
|
||||
try {
|
||||
stoi(valueLiteral);
|
||||
std::stoi(valueLiteral);
|
||||
} catch (...) {
|
||||
// add quotations if it failed to convert to integer, otherwise nothing
|
||||
valueLiteral.insert(0, "\"");
|
||||
|
||||
Reference in New Issue
Block a user