Better ExtractFromString

- Throw a exception if we cannot extract from string.
  (We throw the same exception as `std::sto*`)
- Add a specialization to extract string from string
- Add some unit test
This commit is contained in:
Matthieu Gautier committed 2022-05-23 10:56:39 +02:00
1 parent aa1f73472d
commit 717c39f2ef
3 files changed
+34 -1

No files matched your search

+5
View File
@@ -405,3 +405,8 @@ std::vector<std::string> kiwix::getTitleVariants(const std::string& title) {
variants.push_back(kiwix::toTitle(title));
return variants;
}
template<>
std::string kiwix::extractFromString(const std::string& str) {
return str;
}