#pragma once #include #include #include namespace WebStat { struct QuotedString : std::string { using std::string::string; using std::string::operator=; }; struct QueryString : std::optional { using std::optional::optional; using std::optional::operator=; bool operator<=>(const QueryString &) const = default; }; struct CLFString : std::optional { using std::optional::optional; using std::optional::operator=; bool operator<=>(const CLFString &) const = default; }; enum class EntityType : std::uint8_t { Host, VirtualHost, Path, QueryString, Referrer, UserAgent, }; using Crc32Value = uint32_t; using Entity = std::tuple; } namespace scn { using ContextType = scn::v4::basic_scan_context; template<> struct scanner : scanner { static scan_expected scan(WebStat::QuotedString & value, ContextType & ctx); }; template<> struct scanner : scanner { static scan_expected scan(WebStat::QueryString & value, ContextType & ctx); }; template<> struct scanner : scanner { static scan_expected scan(WebStat::CLFString & value, ContextType & ctx); static void decode(std::string &); }; }