From e5bfd17637bf297c3cfe509d51027916864092d5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 10 Dec 2017 10:02:19 +0300 Subject: Add basic_url class template --- libbutl/url.ixx | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 libbutl/url.ixx (limited to 'libbutl/url.ixx') diff --git a/libbutl/url.ixx b/libbutl/url.ixx new file mode 100644 index 0000000..4ff7a06 --- /dev/null +++ b/libbutl/url.ixx @@ -0,0 +1,84 @@ +// file : libbutl/url.ixx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason. +{ + template + inline basic_url:: + basic_url (scheme_type s, + optional a, + optional p, + optional q, + optional f) + : scheme (std::move (s)), + authority (std::move (a)), + path (std::move (p)), + query (std::move (q)), + fragment (std::move (f)) + { + } + + template + inline basic_url:: + basic_url (scheme_type s, + host_type h, + optional p, + optional q, + optional f) + : basic_url (std::move (s), + authority_type {string_type (), std::move (h), 0}, + std::move (p), + std::move (q), + std::move (f)) + { + } + + template + inline basic_url:: + basic_url (scheme_type s, + host_type h, + std::uint16_t o, + optional p, + optional q, + optional f) + : basic_url (std::move (s), + authority_type {string_type (), std::move (h), o}, + std::move (p), + std::move (q), + std::move (f)) + { + } + + template + inline basic_url:: + basic_url (scheme_type s, + string_type h, + optional p, + optional q, + optional f) + : basic_url (std::move (s), + host_type (std::move (h)), + std::move (p), + std::move (q), + std::move (f)) + { + } + + template + inline basic_url:: + basic_url (scheme_type s, + string_type h, + std::uint16_t o, + optional p, + optional q, + optional f) + : basic_url (std::move (s), + host_type (std::move (h)), + o, + std::move (p), + std::move (q), + std::move (f)) + { + } +} -- cgit v1.1