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:
Matthieu Gautier
2018-11-02 17:03:03 +01:00
parent 360c913230
commit 5f4c04e79e
2 changed files with 12 additions and 4 deletions

View File

@ -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