aboutsummaryrefslogtreecommitdiff
path: root/libbutl/url.ixx
blob: 4ff7a06cb5be00150d9fef60e8df0659dcd16e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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 <typename S, typename T>
  inline basic_url<S, T>::
  basic_url (scheme_type s,
             optional<authority_type> a,
             optional<path_type> p,
             optional<string_type> q,
             optional<string_type> f)
      : scheme (std::move (s)),
        authority (std::move (a)),
        path (std::move (p)),
        query (std::move (q)),
        fragment (std::move (f))
  {
  }

  template <typename S, typename T>
  inline basic_url<S, T>::
  basic_url (scheme_type s,
             host_type h,
             optional<path_type> p,
             optional<string_type> q,
             optional<string_type> f)
      : basic_url (std::move (s),
                   authority_type {string_type (), std::move (h), 0},
                   std::move (p),
                   std::move (q),
                   std::move (f))
  {
  }

  template <typename S, typename T>
  inline basic_url<S, T>::
  basic_url (scheme_type s,
             host_type h,
             std::uint16_t o,
             optional<path_type> p,
             optional<string_type> q,
             optional<string_type> f)
      : basic_url (std::move (s),
                   authority_type {string_type (), std::move (h), o},
                   std::move (p),
                   std::move (q),
                   std::move (f))
  {
  }

  template <typename S, typename T>
  inline basic_url<S, T>::
  basic_url (scheme_type s,
             string_type h,
             optional<path_type> p,
             optional<string_type> q,
             optional<string_type> f)
      : basic_url (std::move (s),
                   host_type (std::move (h)),
                   std::move (p),
                   std::move (q),
                   std::move (f))
  {
  }

  template <typename S, typename T>
  inline basic_url<S, T>::
  basic_url (scheme_type s,
             string_type h,
             std::uint16_t o,
             optional<path_type> p,
             optional<string_type> q,
             optional<string_type> f)
      : basic_url (std::move (s),
                   host_type (std::move (h)),
                   o,
                   std::move (p),
                   std::move (q),
                   std::move (f))
  {
  }
}