interpretation of empty value strings in json
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -17,12 +17,19 @@ ReturnValue_t ArcsecJsonParamBase::getParam(const std::string name, std::string&
|
||||
for (json::iterator it = set.begin(); it != set.end(); ++it) {
|
||||
if ((*it)[arcseckeys::NAME] == name) {
|
||||
value = (*it)[arcseckeys::VALUE];
|
||||
convertEmpty(value);
|
||||
return RETURN_OK;
|
||||
}
|
||||
}
|
||||
return PARAM_NOT_EXISTS;
|
||||
}
|
||||
|
||||
void ArcsecJsonParamBase::convertEmpty(std::string& value) {
|
||||
if (value == "") {
|
||||
value = "0";
|
||||
}
|
||||
}
|
||||
|
||||
void ArcsecJsonParamBase::addfloat(const std::string value, uint8_t* buffer) {
|
||||
float param = std::stof(value);
|
||||
std::memcpy(buffer, ¶m, sizeof(param));
|
||||
|
Reference in New Issue
Block a user