2
0
mirror of https://github.com/boostorg/url.git synced 2026-02-21 15:32:13 +00:00

authority view string token

fix #546
This commit is contained in:
alandefreitas
2022-09-15 13:49:45 -03:00
parent dc8877cb38
commit 307facfaa8
2 changed files with 60 additions and 72 deletions

View File

@@ -349,9 +349,16 @@ public:
@ref password,
@ref user.
*/
BOOST_URL_DECL
std::string
userinfo() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
userinfo(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_userinfo().decode(
opt, std::move(token));
}
/** Return the userinfo
@@ -440,9 +447,16 @@ public:
@ref password,
@ref userinfo.
*/
BOOST_URL_DECL
std::string
user() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
user(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_user().decode(
opt, std::move(token));
}
/** Return the user
@@ -572,9 +586,16 @@ public:
@ref user,
@ref userinfo.
*/
BOOST_URL_DECL
std::string
password() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
password(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_password().decode(
opt, std::move(token));
}
/** Return the password
@@ -687,9 +708,16 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a>
*/
BOOST_URL_DECL
std::string
host() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
host(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host().decode(
opt, std::move(token));
}
/** Return the host
@@ -776,9 +804,16 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a>
*/
BOOST_URL_DECL
std::string
host_address() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
host_address(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host_address().decode(
opt, std::move(token));
}
/** Return the host
@@ -990,9 +1025,16 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a>
*/
BOOST_URL_DECL
std::string
host_name() const;
template<BOOST_URL_STRTOK_TPARAM>
BOOST_URL_STRTOK_RETURN
host_name(
BOOST_URL_STRTOK_ARG(token)) const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host_name().decode(
opt, std::move(token));
}
/** Return the host name

View File

@@ -91,15 +91,6 @@ has_userinfo() const noexcept
return true;
}
std::string
authority_view::
userinfo() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_userinfo().decode(opt);
}
pct_string_view
authority_view::
encoded_userinfo() const noexcept
@@ -114,15 +105,6 @@ encoded_userinfo() const noexcept
return detail::make_pct_string_view(s);
}
std::string
authority_view::
user() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_user().decode(opt);
}
pct_string_view
authority_view::
encoded_user() const noexcept
@@ -150,15 +132,6 @@ has_password() const noexcept
return false;
}
std::string
authority_view::
password() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_password().decode(opt);
}
pct_string_view
authority_view::
encoded_password() const noexcept
@@ -203,15 +176,6 @@ std::string host_name() // return decoded name or ""
pct_string_view encoded_host_name() // return encoded host name or ""
*/
std::string
authority_view::
host() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host().decode(opt);
}
pct_string_view
authority_view::
encoded_host() const noexcept
@@ -221,15 +185,6 @@ encoded_host() const noexcept
u_.decoded_[id_host]);
}
std::string
authority_view::
host_address() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host_address().decode(opt);
}
pct_string_view
authority_view::
encoded_host_address() const noexcept
@@ -307,15 +262,6 @@ host_ipvfuture() const noexcept
return s;
}
std::string
authority_view::
host_name() const
{
decode_opts opt;
opt.plus_to_space = false;
return encoded_host_name().decode(opt);
}
pct_string_view
authority_view::
encoded_host_name() const noexcept