mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Fix use of getAsI when parsing download rpc.
The value is store as a string in in the xml, so we cannot use getAsI. We have to get the string and parse it to an int. We cannot use strtoull because android stdc++ lib doesn't have it. We have to implement our how parseFromString function using a istringstream.
This commit is contained in:
@ -71,5 +71,13 @@ std::string to_string(T value)
|
||||
oss << value;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T extractFromString(const std::string& str) {
|
||||
std::istringstream iss(str);
|
||||
T ret;
|
||||
iss >> ret;
|
||||
return ret;
|
||||
}
|
||||
} //namespace kiwix
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user