mirror of
https://github.com/red0124/ssp.git
synced 2025-12-14 21:59:55 +01:00
add ignore_header setup option, add unit tests for parsing by header, add string_view to possible conversion values
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user