add ignore_header setup option, add unit tests for parsing by header, add string_view to possible conversion values

This commit is contained in:
ado
2022-03-27 21:04:02 +02:00
parent 45d166f93d
commit a8fa5c753c
69 changed files with 4194 additions and 33 deletions

View File

@@ -8,6 +8,7 @@
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <variant>
namespace ss {
@@ -318,7 +319,14 @@ inline bool extract(const char* begin, const char* end, char& value) {
template <>
inline bool extract(const char* begin, const char* end, std::string& value) {
value = std::string(begin, end);
value = std::string{begin, end};
return true;
}
template <>
inline bool extract(const char* begin, const char* end,
std::string_view& value) {
value = std::string_view{begin, static_cast<size_t>(end - begin)};
return true;
}