From cd42dc11b146e2e6ca8a5a19599e7b60ada76f03 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 25 Feb 2022 10:52:09 +1000 Subject: [PATCH] uri: add pq convenience query --- uri.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/uri.hpp b/uri.hpp index 9dfe85e8..4fa9bc5d 100644 --- a/uri.hpp +++ b/uri.hpp @@ -97,16 +97,19 @@ namespace cruft { std::string_view heirarchical (void) const&; //{ return { user ().begin (), path ().end () }; } std::string_view authority (void) const&; //{ return { user ().begin (), port ().end () }; } + std::string_view pq (void) const& + { + return { + m_views[PATH].begin (), + m_views[QUERY].end () + }; + } + std::string_view pqf (void) const& { return { m_views[PATH].begin (), - std::size_t ( - std::distance ( - m_views[PATH].begin (), - m_views[FRAGMENT].end () - ) - ) + m_views[FRAGMENT].end () }; }