diff options
author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2025-10-09 14:26:40 +0100 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2025-10-09 14:26:40 +0100 |
commit | a7a082d8d471bc38f9aa1160b0e9f8daf3d35ba3 (patch) | |
tree | c3a2f2f7dfc7c0e5d63964a0482a78d2aa13306a /src/logTypes.hpp | |
parent | bc05a99df780313ba3cc298323e98beaa5b0ba54 (diff) | |
download | webstat-a7a082d8d471bc38f9aa1160b0e9f8daf3d35ba3.tar.bz2 webstat-a7a082d8d471bc38f9aa1160b0e9f8daf3d35ba3.tar.xz webstat-a7a082d8d471bc38f9aa1160b0e9f8daf3d35ba3.zip |
Fix up QuotedString/CLFString parsing
Refactors CLFString in terms of QuotedString, but with the optional of
being null (nullopt)
Moves the whole decode function into QuotedString's parser, fixing
support for escaping of " which would otherwise prematurely end the
string in the middle.
Diffstat (limited to 'src/logTypes.hpp')
-rw-r--r-- | src/logTypes.hpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/logTypes.hpp b/src/logTypes.hpp index 7a78cc1..0262060 100644 --- a/src/logTypes.hpp +++ b/src/logTypes.hpp @@ -16,9 +16,9 @@ namespace WebStat { bool operator<=>(const QueryString &) const = default; }; - struct CLFString : std::optional<std::string> { - using std::optional<std::string>::optional; - using std::optional<std::string>::operator=; + struct CLFString : std::optional<QuotedString> { + using std::optional<QuotedString>::optional; + using std::optional<QuotedString>::operator=; bool operator<=>(const CLFString &) const = default; }; @@ -49,7 +49,5 @@ namespace scn { template<> struct scanner<WebStat::CLFString> : scanner<std::string, char> { static scan_expected<typename ContextType::iterator> scan(WebStat::CLFString & value, ContextType & ctx); - - static void decode(std::string &); }; } |