fix: member of dll interface class may not be declared with dll interface

fix #748
This commit is contained in:
alandefreitas 2023-06-09 00:45:50 -03:00 committed by Alan de Freitas
parent 992ed70ed4
commit 2bae458a79
28 changed files with 390 additions and 534 deletions

View File

@ -47,7 +47,6 @@ class segment_template
public: public:
segment_template() = default; segment_template() = default;
BOOST_URL_DECL
bool bool
match(pct_string_view seg) const; match(pct_string_view seg) const;
@ -57,7 +56,6 @@ public:
return str_; return str_;
} }
BOOST_URL_DECL
core::string_view core::string_view
id() const; id() const;
@ -140,7 +138,6 @@ struct segment_template_rule_t
{ {
using value_type = segment_template; using value_type = segment_template;
BOOST_URL_DECL
system::result<value_type> system::result<value_type>
parse( parse(
char const*& it, char const*& it,

View File

@ -35,19 +35,15 @@ public:
}; };
protected: protected:
BOOST_URL_DECL
router_base(); router_base();
BOOST_URL_DECL
virtual ~router_base(); virtual ~router_base();
BOOST_URL_DECL
void void
insert_impl( insert_impl(
core::string_view s, core::string_view s,
any_resource const* v); any_resource const* v);
BOOST_URL_DECL
any_resource const* any_resource const*
find_impl( find_impl(
segments_encoded_view path, segments_encoded_view path,

View File

@ -79,7 +79,7 @@ namespace urls {
@see @see
@ref parse_authority. @ref parse_authority.
*/ */
class BOOST_SYMBOL_VISIBLE class BOOST_URL_DECL
authority_view authority_view
: private detail::parts_base : private detail::parts_base
{ {
@ -103,7 +103,6 @@ public:
/** Destructor /** Destructor
*/ */
BOOST_URL_DECL
virtual virtual
~authority_view(); ~authority_view();
@ -119,7 +118,6 @@ public:
@par Specification @par Specification
*/ */
BOOST_URL_DECL
authority_view() noexcept; authority_view() noexcept;
/** Construct from a string. /** Construct from a string.
@ -157,19 +155,16 @@ public:
@see @see
@ref parse_authority. @ref parse_authority.
*/ */
BOOST_URL_DECL
explicit explicit
authority_view(core::string_view s); authority_view(core::string_view s);
/** Constructor /** Constructor
*/ */
BOOST_URL_DECL
authority_view( authority_view(
authority_view const&) noexcept; authority_view const&) noexcept;
/** Assignment /** Assignment
*/ */
BOOST_URL_DECL
authority_view& authority_view&
operator=( operator=(
authority_view const&) noexcept; authority_view const&) noexcept;
@ -304,7 +299,6 @@ public:
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
bool bool
has_userinfo() const noexcept; has_userinfo() const noexcept;
@ -399,7 +393,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_userinfo() const noexcept; encoded_userinfo() const noexcept;
@ -498,7 +491,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_user() const noexcept; encoded_user() const noexcept;
@ -540,7 +532,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
bool bool
has_password() const noexcept; has_password() const noexcept;
@ -633,7 +624,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_password() const noexcept; encoded_password() const noexcept;
@ -750,7 +740,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host() const noexcept; encoded_host() const noexcept;
@ -865,7 +854,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_address() const noexcept; encoded_host_address() const noexcept;
@ -905,7 +893,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
ipv4_address ipv4_address
host_ipv4_address() const noexcept; host_ipv4_address() const noexcept;
@ -953,7 +940,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
ipv6_address ipv6_address
host_ipv6_address() const noexcept; host_ipv6_address() const noexcept;
@ -986,7 +972,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
core::string_view core::string_view
host_ipvfuture() const noexcept; host_ipvfuture() const noexcept;
@ -1069,7 +1054,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_name() const noexcept; encoded_host_name() const noexcept;
@ -1111,7 +1095,6 @@ public:
@ref port, @ref port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
bool bool
has_port() const noexcept; has_port() const noexcept;
@ -1147,7 +1130,6 @@ public:
@ref has_port, @ref has_port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
core::string_view core::string_view
port() const noexcept; port() const noexcept;
@ -1183,7 +1165,6 @@ public:
@ref has_port, @ref has_port,
@ref port. @ref port.
*/ */
BOOST_URL_DECL
std::uint16_t std::uint16_t
port_number() const noexcept; port_number() const noexcept;
@ -1223,7 +1204,6 @@ public:
@ref port, @ref port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_and_port() const noexcept; encoded_host_and_port() const noexcept;
@ -1249,7 +1229,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
int int
compare(authority_view const& other) const noexcept; compare(authority_view const& other) const noexcept;

View File

@ -124,7 +124,6 @@ struct BOOST_SYMBOL_VISIBLE
param_iter param_iter
: any_params_iter : any_params_iter
{ {
BOOST_URL_DECL
explicit explicit
param_iter( param_iter(
param_view const&) noexcept; param_view const&) noexcept;
@ -234,7 +233,6 @@ struct BOOST_SYMBOL_VISIBLE
param_encoded_iter param_encoded_iter
: any_params_iter : any_params_iter
{ {
BOOST_URL_DECL
explicit explicit
param_encoded_iter( param_encoded_iter(
param_pct_view const&) noexcept; param_pct_view const&) noexcept;

View File

@ -20,20 +20,21 @@
# error unsupported platform # error unsupported platform
#endif #endif
#if defined(BOOST_URL_DOCS) // Determine if compiling as a dynamic library
# define BOOST_URL_DECL #if (defined(BOOST_URL_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_URL_STATIC_LINK)
# define BOOST_URL_BUILD_DLL
#endif
// Set visibility flags
#if !defined(BOOST_URL_BUILD_DLL)
# define BOOST_URL_DECL /* static library */
#elif defined(BOOST_URL_SOURCE)
# define BOOST_URL_DECL BOOST_SYMBOL_EXPORT /* source: dllexport/visibility */
#else #else
# if (defined(BOOST_URL_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_URL_STATIC_LINK) # define BOOST_URL_DECL BOOST_SYMBOL_IMPORT /* header: dllimport */
# if defined(BOOST_URL_SOURCE) #endif
# define BOOST_URL_DECL BOOST_SYMBOL_EXPORT
# define BOOST_URL_BUILD_DLL // Set up auto-linker
# else
# define BOOST_URL_DECL BOOST_SYMBOL_IMPORT
# endif
# endif // shared lib
# ifndef BOOST_URL_DECL
# define BOOST_URL_DECL
# endif
# if !defined(BOOST_URL_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_URL_NO_LIB) # if !defined(BOOST_URL_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_URL_NO_LIB)
# define BOOST_LIB_NAME boost_url # define BOOST_LIB_NAME boost_url
# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_URL_DYN_LINK) # if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_URL_DYN_LINK)
@ -41,8 +42,8 @@
# endif # endif
# include <boost/config/auto_link.hpp> # include <boost/config/auto_link.hpp>
# endif # endif
#endif
// Set up SSE2
#if ! defined(BOOST_URL_NO_SSE2) && \ #if ! defined(BOOST_URL_NO_SSE2) && \
! defined(BOOST_URL_USE_SSE2) ! defined(BOOST_URL_USE_SSE2)
# if (defined(_M_IX86) && _M_IX86_FP == 2) || \ # if (defined(_M_IX86) && _M_IX86_FP == 2) || \
@ -51,6 +52,7 @@
# endif # endif
#endif #endif
// constexpr
#if BOOST_WORKAROUND( BOOST_GCC_VERSION, <= 72000 ) || \ #if BOOST_WORKAROUND( BOOST_GCC_VERSION, <= 72000 ) || \
BOOST_WORKAROUND( BOOST_CLANG_VERSION, <= 35000 ) BOOST_WORKAROUND( BOOST_CLANG_VERSION, <= 35000 )
# define BOOST_URL_CONSTEXPR # define BOOST_URL_CONSTEXPR
@ -73,6 +75,7 @@
# define BOOST_URL_POS (BOOST_CURRENT_LOCATION) # define BOOST_URL_POS (BOOST_CURRENT_LOCATION)
#endif #endif
// String token parameters
#ifndef BOOST_URL_STRTOK_TPARAM #ifndef BOOST_URL_STRTOK_TPARAM
#define BOOST_URL_STRTOK_TPARAM class StringToken = string_token::return_string #define BOOST_URL_STRTOK_TPARAM class StringToken = string_token::return_string
#endif #endif
@ -83,6 +86,7 @@
#define BOOST_URL_STRTOK_ARG(name) StringToken&& token = {} #define BOOST_URL_STRTOK_ARG(name) StringToken&& token = {}
#endif #endif
// Move
#if BOOST_WORKAROUND( BOOST_GCC_VERSION, < 80000 ) || \ #if BOOST_WORKAROUND( BOOST_GCC_VERSION, < 80000 ) || \
BOOST_WORKAROUND( BOOST_CLANG_VERSION, < 30900 ) BOOST_WORKAROUND( BOOST_CLANG_VERSION, < 30900 )
#define BOOST_URL_RETURN(x) return std::move((x)) #define BOOST_URL_RETURN(x) return std::move((x))
@ -90,18 +94,21 @@
#define BOOST_URL_RETURN(x) return (x) #define BOOST_URL_RETURN(x) return (x)
#endif #endif
// Limit tests
#ifndef BOOST_URL_MAX_SIZE #ifndef BOOST_URL_MAX_SIZE
// we leave room for a null, // we leave room for a null,
// and still fit in size_t // and still fit in size_t
#define BOOST_URL_MAX_SIZE ((std::size_t(-1))-1) #define BOOST_URL_MAX_SIZE ((std::size_t(-1))-1)
#endif #endif
// noinline attribute
#ifdef BOOST_GCC #ifdef BOOST_GCC
#define BOOST_URL_NO_INLINE [[gnu::noinline]] #define BOOST_URL_NO_INLINE [[gnu::noinline]]
#else #else
#define BOOST_URL_NO_INLINE #define BOOST_URL_NO_INLINE
#endif #endif
// libstdcxx copy-on-write strings
#ifndef BOOST_URL_COW_STRINGS #ifndef BOOST_URL_COW_STRINGS
#if defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 60000 || (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0)) #if defined(BOOST_LIBSTDCXX_VERSION) && (BOOST_LIBSTDCXX_VERSION < 60000 || (defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI == 0))
#define BOOST_URL_COW_STRINGS #define BOOST_URL_COW_STRINGS
@ -117,16 +124,17 @@
# error Unknown or unsupported architecture, please open an issue # error Unknown or unsupported architecture, please open an issue
#endif #endif
// deprecated attribute
#if defined(BOOST_MSVC) || defined(BOOST_URL_DOCS) #if defined(BOOST_MSVC) || defined(BOOST_URL_DOCS)
#define BOOST_URL_DEPRECATED(msg) #define BOOST_URL_DEPRECATED(msg)
#else #else
#define BOOST_URL_DEPRECATED(msg) BOOST_DEPRECATED(msg) #define BOOST_URL_DEPRECATED(msg) BOOST_DEPRECATED(msg)
#endif #endif
// avoid Boost.TypeTraits for these traits
namespace boost { namespace boost {
namespace urls { namespace urls {
// avoid some of Boost.TypeTraits for just this
template<class...> struct make_void { typedef void type; }; template<class...> struct make_void { typedef void type; };
template<class... Ts> using void_t = typename make_void<Ts...>::type; template<class... Ts> using void_t = typename make_void<Ts...>::type;

View File

@ -19,7 +19,7 @@ namespace boost {
namespace urls { namespace urls {
namespace detail { namespace detail {
struct params_iter_impl struct BOOST_URL_DECL params_iter_impl
: parts_base : parts_base
{ {
query_ref ref; query_ref ref;
@ -37,12 +37,10 @@ struct params_iter_impl
params_iter_impl const&) = default; params_iter_impl const&) = default;
// begin // begin
BOOST_URL_DECL
params_iter_impl( params_iter_impl(
query_ref const&) noexcept; query_ref const&) noexcept;
// end // end
BOOST_URL_DECL
params_iter_impl( params_iter_impl(
query_ref const&, query_ref const&,
int) noexcept; int) noexcept;
@ -53,9 +51,9 @@ struct params_iter_impl
std::size_t, std::size_t,
std::size_t) noexcept; std::size_t) noexcept;
void setup() noexcept; void setup() noexcept;
BOOST_URL_DECL void increment() noexcept; void increment() noexcept;
BOOST_URL_DECL void decrement() noexcept; void decrement() noexcept;
BOOST_URL_DECL param_pct_view param_pct_view
dereference() const noexcept; dereference() const noexcept;
pct_string_view key() const noexcept; pct_string_view key() const noexcept;

View File

@ -31,7 +31,7 @@ constexpr char const* const empty_c_str_ = "";
// This is the private 'guts' of a // This is the private 'guts' of a
// url_view, exposed so different parts // url_view, exposed so different parts
// of the implementation can work on it. // of the implementation can work on it.
struct url_impl : parts_base struct BOOST_URL_DECL url_impl : parts_base
{ {
static static
constexpr constexpr
@ -140,7 +140,7 @@ public:
// this allows a params to come from a // this allows a params to come from a
// url_impl or a separate core::string_view // url_impl or a separate core::string_view
class query_ref class BOOST_URL_DECL query_ref
: private parts_base : private parts_base
{ {
url_impl const* impl_ = nullptr; url_impl const* impl_ = nullptr;
@ -157,7 +157,6 @@ public:
std::size_t nparam std::size_t nparam
) noexcept; ) noexcept;
query_ref() = default; query_ref() = default;
BOOST_URL_DECL
query_ref(url_impl const& impl) noexcept; query_ref(url_impl const& impl) noexcept;
pct_string_view buffer() const noexcept; pct_string_view buffer() const noexcept;
std::size_t size() const noexcept; // with '?' std::size_t size() const noexcept; // with '?'
@ -186,158 +185,6 @@ public:
} }
}; };
//------------------------------------------------
// return length of [first, last)
inline
auto
url_impl::
len(
int first,
int last) const noexcept ->
std::size_t
{
BOOST_ASSERT(first <= last);
BOOST_ASSERT(last <= id_end);
return offset(last) - offset(first);
}
// return length of part
inline
auto
url_impl::
len(int id) const noexcept ->
std::size_t
{
return id == id_end
? zero_
: ( offset(id + 1) -
offset(id) );
}
// return offset of id
inline
auto
url_impl::
offset(int id) const noexcept ->
std::size_t
{
return
id == id_scheme
? zero_
: offset_[id];
}
// return id as string
inline
core::string_view
url_impl::
get(int id) const noexcept
{
return {
cs_ + offset(id), len(id) };
}
// return [first, last) as string
inline
core::string_view
url_impl::
get(int first,
int last) const noexcept
{
return { cs_ + offset(first),
offset(last) - offset(first) };
}
// return id as pct-string
inline
pct_string_view
url_impl::
pct_get(
int id) const noexcept
{
return make_pct_string_view_unsafe(
cs_ + offset(id),
len(id),
decoded_[id]);
}
// return [first, last) as pct-string
inline
pct_string_view
url_impl::
pct_get(
int first,
int last) const noexcept
{
auto const pos = offset(first);
std::size_t n = 0;
for(auto i = first; i < last;)
n += decoded_[i++];
return make_pct_string_view_unsafe(
cs_ + pos,
offset(last) - pos,
n);
}
//------------------------------------------------
// change id to size n
inline
void
url_impl::
set_size(
int id,
std::size_t n) noexcept
{
auto d = n - len(id);
for(auto i = id + 1;
i <= id_end; ++i)
offset_[i] += d;
}
// trim id to size n,
// moving excess into id+1
inline
void
url_impl::
split(
int id,
std::size_t n) noexcept
{
BOOST_ASSERT(id < id_end - 1);
//BOOST_ASSERT(n <= len(id));
offset_[id + 1] = offset(id) + n;
}
// add n to [first, last]
inline
void
url_impl::
adjust(
int first,
int last,
std::size_t n) noexcept
{
for(int i = first;
i <= last; ++i)
offset_[i] += n;
}
// set [first, last) offset
inline
void
url_impl::
collapse(
int first,
int last,
std::size_t n) noexcept
{
for(int i = first + 1;
i < last; ++i)
offset_[i] = n;
}
} // detail } // detail
} // urls } // urls

View File

@ -28,7 +28,7 @@ namespace urls {
@ref encoded_size, @ref encoded_size,
@ref pct_string_view. @ref pct_string_view.
*/ */
struct encoding_opts struct BOOST_URL_DECL encoding_opts
{ {
/** True if spaces encode to and from plus signs /** True if spaces encode to and from plus signs
@ -71,11 +71,7 @@ struct encoding_opts
encoding_opts( encoding_opts(
bool space_as_plus_ = false, bool space_as_plus_ = false,
bool lower_case_ = false, bool lower_case_ = false,
bool disallow_null_ = false) noexcept bool disallow_null_ = false) noexcept;
: space_as_plus(space_as_plus_)
, lower_case(lower_case_)
, disallow_null(disallow_null_)
{}
#endif #endif
}; };

View File

@ -39,16 +39,24 @@ struct BOOST_SYMBOL_VISIBLE
error_cat_type error_cat_type
: system::error_category : system::error_category
{ {
BOOST_URL_DECL const char* name( BOOST_URL_DECL
const char* name(
) const noexcept override; ) const noexcept override;
BOOST_URL_DECL std::string message(
BOOST_URL_DECL
std::string message(
int) const override; int) const override;
BOOST_URL_DECL char const* message(
BOOST_URL_DECL
char const* message(
int, char*, std::size_t int, char*, std::size_t
) const noexcept override; ) const noexcept override;
BOOST_URL_DECL system::error_condition
BOOST_URL_DECL
system::error_condition
default_error_condition( default_error_condition(
int code) const noexcept override; int code) const noexcept override;
BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept
: error_category(0x0536e50a30f9e9f2) : error_category(0x0536e50a30f9e9f2)
{ {
@ -59,13 +67,19 @@ struct BOOST_SYMBOL_VISIBLE
condition_cat_type condition_cat_type
: system::error_category : system::error_category
{ {
BOOST_URL_DECL const char* name( BOOST_URL_DECL
const char* name(
) const noexcept override; ) const noexcept override;
BOOST_URL_DECL std::string message(
BOOST_URL_DECL
std::string message(
int) const override; int) const override;
BOOST_URL_DECL char const* message(
BOOST_URL_DECL
char const* message(
int, char*, std::size_t int, char*, std::size_t
) const noexcept override; ) const noexcept override;
BOOST_SYSTEM_CONSTEXPR condition_cat_type() BOOST_SYSTEM_CONSTEXPR condition_cat_type()
: error_category(0x0536e50a30f9e9f2) : error_category(0x0536e50a30f9e9f2)
{ {

View File

@ -32,16 +32,24 @@ struct BOOST_SYMBOL_VISIBLE
error_cat_type error_cat_type
: system::error_category : system::error_category
{ {
BOOST_URL_DECL const char* name( BOOST_URL_DECL
const char* name(
) const noexcept override; ) const noexcept override;
BOOST_URL_DECL std::string message(
BOOST_URL_DECL
std::string message(
int) const override; int) const override;
BOOST_URL_DECL char const* message(
BOOST_URL_DECL
char const* message(
int, char*, std::size_t int, char*, std::size_t
) const noexcept override; ) const noexcept override;
BOOST_URL_DECL system::error_condition
BOOST_URL_DECL
system::error_condition
default_error_condition( default_error_condition(
int code) const noexcept override; int code) const noexcept override;
BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept
: error_category(0xbc15399d7a4ce829) : error_category(0xbc15399d7a4ce829)
{ {

View File

@ -19,7 +19,7 @@ namespace urls {
//------------------------------------------------ //------------------------------------------------
class params_base::iterator class BOOST_URL_DECL params_base::iterator
{ {
detail::params_iter_impl it_; detail::params_iter_impl it_;
bool space_as_plus_ = true; bool space_as_plus_ = true;
@ -88,7 +88,6 @@ public:
return tmp; return tmp;
} }
BOOST_URL_DECL
reference reference
operator*() const; operator*() const;
@ -110,84 +109,6 @@ public:
} }
}; };
//------------------------------------------------
inline
params_base::
params_base() noexcept
// space_as_plus = true
: opt_(true, false, false)
{
}
inline
bool
params_base::
contains(
core::string_view key,
ignore_case_param ic) const noexcept
{
return find(
begin(),key, ic) != end();
}
inline
auto
params_base::
find(
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_impl(
begin().it_, key, ic),
opt_);
}
inline
auto
params_base::
find(
iterator it,
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_impl(
it.it_, key, ic),
opt_);
}
inline
auto
params_base::
find_last(
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_last_impl(
end().it_, key, ic),
opt_);
}
inline
auto
params_base::
find_last(
iterator it,
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_last_impl(
it.it_, key, ic),
opt_);
}
} // urls } // urls
} // boost } // boost

View File

@ -126,33 +126,6 @@ insert(
FwdIt>::iterator_category{}); FwdIt>::iterator_category{});
} }
inline
auto
params_encoded_ref::
erase(
iterator pos) noexcept ->
iterator
{
return erase(
pos,
std::next(pos));
}
inline
auto
params_encoded_ref::
erase(
iterator first,
iterator last) noexcept ->
iterator
{
core::string_view s("", 0);
return u_->edit_params(
first.it_,
last.it_,
detail::query_iter(s));
}
template<class FwdIt> template<class FwdIt>
auto auto
params_encoded_ref:: params_encoded_ref::

View File

@ -166,35 +166,6 @@ insert(
FwdIt>::iterator_category{}); FwdIt>::iterator_category{});
} }
inline
auto
params_ref::
erase(
iterator pos) noexcept ->
iterator
{
return erase(
pos,
std::next(pos));
}
inline
auto
params_ref::
erase(
iterator first,
iterator last) noexcept ->
iterator
{
core::string_view s("", 0);
return iterator(
u_->edit_params(
first.it_,
last.it_,
detail::query_iter(s)),
opt_);
}
template<class FwdIt> template<class FwdIt>
auto auto
params_ref:: params_ref::

View File

@ -36,7 +36,7 @@ namespace urls {
@li @ref params_encoded_ref @li @ref params_encoded_ref
@li @ref params_encoded_view @li @ref params_encoded_view
*/ */
class params_base class BOOST_URL_DECL params_base
{ {
friend class url_view_base; friend class url_view_base;
friend class params_ref; friend class params_ref;
@ -46,7 +46,6 @@ class params_base
encoding_opts opt_; encoding_opts opt_;
params_base() noexcept; params_base() noexcept;
BOOST_URL_DECL
params_base( params_base(
detail::query_ref const& ref, detail::query_ref const& ref,
encoding_opts opt) noexcept; encoding_opts opt) noexcept;
@ -173,7 +172,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
buffer() const noexcept; buffer() const noexcept;
@ -190,7 +188,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
bool bool
empty() const noexcept; empty() const noexcept;
@ -207,7 +204,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
size() const noexcept; size() const noexcept;
@ -219,7 +215,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
iterator iterator
begin() const noexcept; begin() const noexcept;
@ -231,7 +226,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
iterator iterator
end() const noexcept; end() const noexcept;
@ -299,7 +293,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
count( count(
core::string_view key, core::string_view key,
@ -484,14 +477,12 @@ public:
ignore_case_param ic = {}) const noexcept; ignore_case_param ic = {}) const noexcept;
private: private:
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_impl( find_impl(
detail::params_iter_impl, detail::params_iter_impl,
core::string_view, core::string_view,
ignore_case_param) const noexcept; ignore_case_param) const noexcept;
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_last_impl( find_last_impl(
detail::params_iter_impl, detail::params_iter_impl,

View File

@ -35,7 +35,7 @@ namespace urls {
@li @ref params_encoded_ref @li @ref params_encoded_ref
@li @ref params_encoded_view @li @ref params_encoded_view
*/ */
class params_encoded_base class BOOST_URL_DECL params_encoded_base
{ {
friend class url_view_base; friend class url_view_base;
friend class params_encoded_ref; friend class params_encoded_ref;
@ -173,7 +173,6 @@ public:
@li <a href="https://en.wikipedia.org/wiki/Query_string" @li <a href="https://en.wikipedia.org/wiki/Query_string"
>Query string (Wikipedia)</a> >Query string (Wikipedia)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
buffer() const noexcept; buffer() const noexcept;
@ -190,7 +189,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
bool bool
empty() const noexcept; empty() const noexcept;
@ -207,7 +205,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
size() const noexcept; size() const noexcept;
@ -219,7 +216,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
iterator iterator
begin() const noexcept; begin() const noexcept;
@ -231,7 +227,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
iterator iterator
end() const noexcept; end() const noexcept;
@ -306,7 +301,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
count( count(
pct_string_view key, pct_string_view key,
@ -513,14 +507,12 @@ public:
ignore_case_param ic = {}) const noexcept; ignore_case_param ic = {}) const noexcept;
private: private:
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_impl( find_impl(
detail::params_iter_impl, detail::params_iter_impl,
pct_string_view, pct_string_view,
ignore_case_param) const noexcept; ignore_case_param) const noexcept;
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_last_impl( find_last_impl(
detail::params_iter_impl, detail::params_iter_impl,

View File

@ -70,7 +70,7 @@ class params_encoded_view;
params and all params params and all params
after (including `end()`). after (including `end()`).
*/ */
class params_encoded_ref class BOOST_URL_DECL params_encoded_ref
: public params_encoded_base : public params_encoded_base
{ {
friend class url_base; friend class url_base;
@ -139,7 +139,6 @@ public:
@param other The params to assign. @param other The params to assign.
*/ */
BOOST_URL_DECL
params_encoded_ref& params_encoded_ref&
operator=( operator=(
params_encoded_ref const& other); params_encoded_ref const& other);
@ -177,7 +176,6 @@ public:
@param init The list of params to assign. @param init The list of params to assign.
*/ */
BOOST_URL_DECL
params_encoded_ref& params_encoded_ref&
operator=(std::initializer_list< operator=(std::initializer_list<
param_pct_view> init); param_pct_view> init);
@ -190,7 +188,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
operator operator
params_encoded_view() const noexcept; params_encoded_view() const noexcept;
@ -289,7 +286,6 @@ public:
@param init The list of params to assign. @param init The list of params to assign.
*/ */
BOOST_URL_DECL
void void
assign( assign(
std::initializer_list< std::initializer_list<
@ -472,7 +468,6 @@ public:
@param p The param to insert. @param p The param to insert.
*/ */
BOOST_URL_DECL
iterator iterator
insert( insert(
iterator before, iterator before,
@ -514,7 +509,6 @@ public:
@param init The list of params to insert. @param init The list of params to insert.
*/ */
BOOST_URL_DECL
iterator iterator
insert( insert(
iterator before, iterator before,
@ -660,7 +654,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
erase( erase(
pct_string_view key, pct_string_view key,
@ -709,7 +702,6 @@ public:
@param p The param to assign. @param p The param to assign.
*/ */
BOOST_URL_DECL
iterator iterator
replace( replace(
iterator pos, iterator pos,
@ -750,7 +742,6 @@ public:
@param init The list of params to assign. @param init The list of params to assign.
*/ */
BOOST_URL_DECL
iterator iterator
replace( replace(
iterator from, iterator from,
@ -838,7 +829,6 @@ public:
@param pos An iterator to the element. @param pos An iterator to the element.
*/ */
BOOST_URL_DECL
iterator iterator
unset( unset(
iterator pos) noexcept; iterator pos) noexcept;
@ -886,7 +876,6 @@ public:
That is, `has_value` for the element That is, `has_value` for the element
is true. is true.
*/ */
BOOST_URL_DECL
iterator iterator
set( set(
iterator pos, iterator pos,
@ -959,7 +948,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
iterator iterator
set( set(
pct_string_view key, pct_string_view key,
@ -967,14 +955,12 @@ public:
ignore_case_param ic = {}); ignore_case_param ic = {});
private: private:
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_impl( find_impl(
detail::params_iter_impl, detail::params_iter_impl,
pct_string_view, pct_string_view,
ignore_case_param) const noexcept; ignore_case_param) const noexcept;
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_last_impl( find_last_impl(
detail::params_iter_impl, detail::params_iter_impl,

View File

@ -51,7 +51,7 @@ namespace urls {
Changes to the underlying character buffer Changes to the underlying character buffer
can invalidate iterators which reference it. can invalidate iterators which reference it.
*/ */
class params_encoded_view class BOOST_URL_DECL params_encoded_view
: public params_encoded_base : public params_encoded_base
{ {
friend class url_view_base; friend class url_view_base;
@ -162,7 +162,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
>3.4. Query</a> >3.4. Query</a>
*/ */
BOOST_URL_DECL
params_encoded_view( params_encoded_view(
core::string_view s); core::string_view s);
@ -221,16 +220,15 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing Throws nothing
*/ */
BOOST_URL_DECL
operator operator
params_view() const noexcept; params_view() const noexcept;
//-------------------------------------------- //--------------------------------------------
BOOST_URL_DECL
friend friend
system::result<params_encoded_view> BOOST_URL_DECL
parse_query(core::string_view s) noexcept; system::result<params_encoded_view>
parse_query(core::string_view s) noexcept;
}; };
} // urls } // urls

View File

@ -77,7 +77,7 @@ class params_view;
elements and all elements elements and all elements
after (including `end()`). after (including `end()`).
*/ */
class params_ref class BOOST_URL_DECL params_ref
: public params_base : public params_base
{ {
friend class url_base; friend class url_base;
@ -181,7 +181,6 @@ public:
@param other The params to assign. @param other The params to assign.
*/ */
BOOST_URL_DECL
params_ref& params_ref&
operator=( operator=(
params_ref const& other); params_ref const& other);
@ -219,7 +218,6 @@ public:
/** Conversion /** Conversion
*/ */
BOOST_URL_DECL
operator operator
params_view() const noexcept; params_view() const noexcept;
@ -314,7 +312,6 @@ public:
@param init The list of params to assign. @param init The list of params to assign.
*/ */
BOOST_URL_DECL
void void
assign( assign(
std::initializer_list< std::initializer_list<
@ -477,7 +474,6 @@ public:
@param p The param to insert. @param p The param to insert.
*/ */
BOOST_URL_DECL
iterator iterator
insert( insert(
iterator before, iterator before,
@ -515,7 +511,6 @@ public:
@param init The list of params to insert. @param init The list of params to insert.
*/ */
BOOST_URL_DECL
iterator iterator
insert( insert(
iterator before, iterator before,
@ -654,7 +649,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
std::size_t std::size_t
erase( erase(
core::string_view key, core::string_view key,
@ -694,7 +688,6 @@ public:
@param p The param to assign. @param p The param to assign.
*/ */
BOOST_URL_DECL
iterator iterator
replace( replace(
iterator pos, iterator pos,
@ -731,7 +724,6 @@ public:
@param init The list of params to assign. @param init The list of params to assign.
*/ */
BOOST_URL_DECL
iterator iterator
replace( replace(
iterator from, iterator from,
@ -815,7 +807,6 @@ public:
@param pos An iterator to the element. @param pos An iterator to the element.
*/ */
BOOST_URL_DECL
iterator iterator
unset( unset(
iterator pos) noexcept; iterator pos) noexcept;
@ -854,7 +845,6 @@ public:
That is, `has_value` for the element That is, `has_value` for the element
is true. is true.
*/ */
BOOST_URL_DECL
iterator iterator
set( set(
iterator pos, iterator pos,
@ -917,7 +907,6 @@ public:
here, the comparison is here, the comparison is
case-insensitive. case-insensitive.
*/ */
BOOST_URL_DECL
iterator iterator
set( set(
core::string_view key, core::string_view key,
@ -927,14 +916,12 @@ public:
//-------------------------------------------- //--------------------------------------------
private: private:
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_impl( find_impl(
detail::params_iter_impl, detail::params_iter_impl,
core::string_view, core::string_view,
ignore_case_param) const noexcept; ignore_case_param) const noexcept;
BOOST_URL_DECL
detail::params_iter_impl detail::params_iter_impl
find_last_impl( find_last_impl(
detail::params_iter_impl, detail::params_iter_impl,

View File

@ -49,7 +49,7 @@ class static_url;
@li @ref parse_uri @li @ref parse_uri
@li @ref parse_uri_reference @li @ref parse_uri_reference
*/ */
class BOOST_SYMBOL_VISIBLE class BOOST_URL_DECL
static_url_base static_url_base
: public url_base : public url_base
{ {
@ -57,13 +57,13 @@ class BOOST_SYMBOL_VISIBLE
friend class static_url; friend class static_url;
~static_url_base() = default; ~static_url_base() = default;
BOOST_URL_DECL static_url_base( static_url_base(
char* buf, std::size_t cap) noexcept; char* buf, std::size_t cap) noexcept;
BOOST_URL_DECL static_url_base( static_url_base(
char* buf, std::size_t cap, core::string_view s); char* buf, std::size_t cap, core::string_view s);
BOOST_URL_DECL void clear_impl() noexcept override; void clear_impl() noexcept override;
BOOST_URL_DECL void reserve_impl(std::size_t, op_t&) override; void reserve_impl(std::size_t, op_t&) override;
BOOST_URL_DECL void cleanup(op_t&) override; void cleanup(op_t&) override;
void void
copy(url_view_base const& u) copy(url_view_base const& u)

View File

@ -60,7 +60,7 @@ namespace urls {
@ref parse_uri_reference, @ref parse_uri_reference,
@ref resolve. @ref resolve.
*/ */
class BOOST_SYMBOL_VISIBLE url class BOOST_URL_DECL url
: public url_base : public url_base
{ {
friend std::hash<url>; friend std::hash<url>;
@ -82,7 +82,6 @@ public:
buffer is destroyed, invalidating all buffer is destroyed, invalidating all
references to it. references to it.
*/ */
BOOST_URL_DECL
virtual ~url(); virtual ~url();
/** Constructor /** Constructor
@ -118,7 +117,6 @@ public:
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2" <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2"
>4.2. Relative Reference (rfc3986)</a> >4.2. Relative Reference (rfc3986)</a>
*/ */
BOOST_URL_DECL
url() noexcept; url() noexcept;
/** Constructor /** Constructor
@ -168,7 +166,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.1" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.1"
>4.1. URI Reference</a> >4.1. URI Reference</a>
*/ */
BOOST_URL_DECL
explicit explicit
url(core::string_view s); url(core::string_view s);
@ -194,7 +191,6 @@ public:
@param u The url to move from. @param u The url to move from.
*/ */
BOOST_URL_DECL
url(url&& u) noexcept; url(url&& u) noexcept;
/** Constructor /** Constructor
@ -272,7 +268,6 @@ public:
@param u The url to assign from. @param u The url to assign from.
*/ */
BOOST_URL_DECL
url& url&
operator=(url&& u) noexcept; operator=(url&& u) noexcept;
@ -362,7 +357,6 @@ public:
@param other The object to swap with @param other The object to swap with
*/ */
BOOST_URL_DECL
void void
swap(url& other) noexcept; swap(url& other) noexcept;
@ -512,9 +506,9 @@ private:
char* allocate(std::size_t); char* allocate(std::size_t);
void deallocate(char* s); void deallocate(char* s);
BOOST_URL_DECL void clear_impl() noexcept override; void clear_impl() noexcept override;
BOOST_URL_DECL void reserve_impl(std::size_t, op_t&) override; void reserve_impl(std::size_t, op_t&) override;
BOOST_URL_DECL void cleanup(op_t&) override; void cleanup(op_t&) override;
}; };
} // urls } // urls

View File

@ -60,7 +60,7 @@ struct pattern;
@li @ref parse_uri @li @ref parse_uri
@li @ref parse_uri_reference @li @ref parse_uri_reference
*/ */
class BOOST_SYMBOL_VISIBLE class BOOST_URL_DECL
url_base url_base
: public url_view_base : public url_view_base
{ {
@ -94,12 +94,12 @@ class BOOST_SYMBOL_VISIBLE
url_base() noexcept = default; url_base() noexcept = default;
url_base(detail::url_impl const&) noexcept; url_base(detail::url_impl const&) noexcept;
explicit url_base(core::string_view); explicit url_base(core::string_view);
BOOST_URL_DECL void reserve_impl(std::size_t n); void reserve_impl(std::size_t n);
BOOST_URL_DECL void copy(url_view_base const&); void copy(url_view_base const&);
BOOST_URL_DECL virtual void clear_impl() noexcept = 0; virtual void clear_impl() noexcept = 0;
BOOST_URL_DECL virtual void reserve_impl( virtual void reserve_impl(
std::size_t, op_t&) = 0; std::size_t, op_t&) = 0;
BOOST_URL_DECL virtual void cleanup(op_t&) = 0; virtual void cleanup(op_t&) = 0;
public: public:
//-------------------------------------------- //--------------------------------------------
@ -239,7 +239,6 @@ public:
@see @see
@ref remove_scheme. @ref remove_scheme.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_scheme(core::string_view s); set_scheme(core::string_view s);
@ -274,7 +273,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1"> @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
3.1. Scheme (rfc3986)</a> 3.1. Scheme (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
#ifndef BOOST_URL_DOCS #ifndef BOOST_URL_DOCS
set_scheme_id(urls::scheme id); set_scheme_id(urls::scheme id);
@ -315,7 +313,6 @@ public:
@see @see
@ref set_scheme. @ref set_scheme.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_scheme(); remove_scheme();
@ -361,7 +358,6 @@ public:
@see @see
@ref remove_authority. @ref remove_authority.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_authority( set_encoded_authority(
pct_string_view s); pct_string_view s);
@ -404,7 +400,6 @@ public:
@see @see
@ref set_encoded_authority. @ref set_encoded_authority.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_authority(); remove_authority();
@ -471,7 +466,6 @@ public:
@ref remove_userinfo, @ref remove_userinfo,
@ref set_encoded_userinfo. @ref set_encoded_userinfo.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_userinfo( set_userinfo(
core::string_view s); core::string_view s);
@ -538,7 +532,6 @@ public:
@ref remove_userinfo, @ref remove_userinfo,
@ref set_userinfo. @ref set_userinfo.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_userinfo( set_encoded_userinfo(
pct_string_view s); pct_string_view s);
@ -580,7 +573,6 @@ public:
@ref set_encoded_userinfo, @ref set_encoded_userinfo,
@ref set_userinfo. @ref set_userinfo.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_userinfo() noexcept; remove_userinfo() noexcept;
@ -630,7 +622,6 @@ public:
@ref set_encoded_user, @ref set_encoded_user,
@ref set_password. @ref set_password.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_user( set_user(
core::string_view s); core::string_view s);
@ -684,7 +675,6 @@ public:
@ref set_password, @ref set_password,
@ref set_user. @ref set_user.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_user( set_encoded_user(
pct_string_view s); pct_string_view s);
@ -737,7 +727,6 @@ public:
@ref set_encoded_user, @ref set_encoded_user,
@ref set_user. @ref set_user.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_password( set_password(
core::string_view s); core::string_view s);
@ -795,7 +784,6 @@ public:
@ref set_encoded_user, @ref set_encoded_user,
@ref set_user. @ref set_user.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_password( set_encoded_password(
pct_string_view s); pct_string_view s);
@ -847,7 +835,6 @@ public:
@ref set_password, @ref set_password,
@ref set_user. @ref set_user.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_password() noexcept; remove_password() noexcept;
@ -931,7 +918,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host( set_host(
core::string_view s); core::string_view s);
@ -1016,7 +1002,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_host(pct_string_view s); set_encoded_host(pct_string_view s);
@ -1115,7 +1100,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host_address(core::string_view s); set_host_address(core::string_view s);
@ -1219,7 +1203,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_host_address( set_encoded_host_address(
pct_string_view s); pct_string_view s);
@ -1276,7 +1259,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host_ipv4( set_host_ipv4(
ipv4_address const& addr); ipv4_address const& addr);
@ -1341,7 +1323,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host_ipv6( set_host_ipv6(
ipv6_address const& addr); ipv6_address const& addr);
@ -1394,7 +1375,6 @@ public:
@ref set_host_ipv6, @ref set_host_ipv6,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host_ipvfuture( set_host_ipvfuture(
core::string_view s); core::string_view s);
@ -1442,7 +1422,6 @@ public:
@ref set_host_ipv6, @ref set_host_ipv6,
@ref set_host_ipvfuture. @ref set_host_ipvfuture.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_host_name( set_host_name(
core::string_view s); core::string_view s);
@ -1496,7 +1475,6 @@ public:
@ref set_host_ipvfuture, @ref set_host_ipvfuture,
@ref set_host_name. @ref set_host_name.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_host_name( set_encoded_host_name(
pct_string_view s); pct_string_view s);
@ -1541,7 +1519,6 @@ public:
@ref remove_port, @ref remove_port,
@ref set_port. @ref set_port.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_port_number(std::uint16_t n); set_port_number(std::uint16_t n);
@ -1585,7 +1562,6 @@ public:
@ref remove_port, @ref remove_port,
@ref set_port. @ref set_port.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_port(core::string_view s); set_port(core::string_view s);
@ -1624,7 +1600,6 @@ public:
@see @see
@ref set_port. @ref set_port.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_port() noexcept; remove_port() noexcept;
@ -1687,7 +1662,6 @@ public:
@ref set_encoded_path, @ref set_encoded_path,
@ref set_path. @ref set_path.
*/ */
BOOST_URL_DECL
bool bool
set_path_absolute(bool absolute); set_path_absolute(bool absolute);
@ -1754,7 +1728,6 @@ public:
@ref set_encoded_path, @ref set_encoded_path,
@ref set_path_absolute. @ref set_path_absolute.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_path( set_path(
core::string_view s); core::string_view s);
@ -1820,7 +1793,6 @@ public:
@ref set_path, @ref set_path,
@ref set_path_absolute. @ref set_path_absolute.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_path( set_encoded_path(
pct_string_view s); pct_string_view s);
@ -1876,7 +1848,6 @@ public:
@ref set_path, @ref set_path,
@ref set_path_absolute. @ref set_path_absolute.
*/ */
BOOST_URL_DECL
urls::segments_ref urls::segments_ref
segments() noexcept; segments() noexcept;
@ -1938,7 +1909,6 @@ public:
@ref set_path, @ref set_path,
@ref set_path_absolute. @ref set_path_absolute.
*/ */
BOOST_URL_DECL
segments_encoded_ref segments_encoded_ref
encoded_segments() noexcept; encoded_segments() noexcept;
@ -2000,7 +1970,6 @@ public:
@ref remove_query, @ref remove_query,
@ref set_encoded_query. @ref set_encoded_query.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_query( set_query(
core::string_view s); core::string_view s);
@ -2056,7 +2025,6 @@ public:
@ref remove_query, @ref remove_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_query( set_encoded_query(
pct_string_view s); pct_string_view s);
@ -2105,7 +2073,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
params_ref params_ref
params() noexcept; params() noexcept;
@ -2166,7 +2133,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
params_ref params_ref
params(encoding_opts opt) noexcept; params(encoding_opts opt) noexcept;
@ -2221,7 +2187,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
params_encoded_ref params_encoded_ref
encoded_params() noexcept; encoded_params() noexcept;
@ -2275,7 +2240,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_params( std::initializer_list<param_view> ps ) noexcept; set_params( std::initializer_list<param_view> ps ) noexcept;
@ -2336,7 +2300,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_params( std::initializer_list< param_pct_view > ps ) noexcept; set_encoded_params( std::initializer_list< param_pct_view > ps ) noexcept;
@ -2379,7 +2342,6 @@ public:
@ref set_encoded_query, @ref set_encoded_query,
@ref set_query. @ref set_query.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_query() noexcept; remove_query() noexcept;
@ -2425,7 +2387,6 @@ public:
@ref set_encoded_fragment, @ref set_encoded_fragment,
@ref set_fragment. @ref set_fragment.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_fragment() noexcept; remove_fragment() noexcept;
@ -2470,7 +2431,6 @@ public:
@ref remove_fragment, @ref remove_fragment,
@ref set_encoded_fragment. @ref set_encoded_fragment.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_fragment( set_fragment(
core::string_view s); core::string_view s);
@ -2522,7 +2482,6 @@ public:
@ref remove_fragment, @ref remove_fragment,
@ref set_fragment. @ref set_fragment.
*/ */
BOOST_URL_DECL
url_base& url_base&
set_encoded_fragment( set_encoded_fragment(
pct_string_view s); pct_string_view s);
@ -2554,7 +2513,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
url_base& url_base&
remove_origin(); remove_origin();
@ -2578,7 +2536,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize(); normalize();
@ -2598,7 +2555,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize_scheme(); normalize_scheme();
@ -2621,7 +2577,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize_authority(); normalize_authority();
@ -2645,7 +2600,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize_path(); normalize_path();
@ -2668,7 +2622,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize_query(); normalize_query();
@ -2691,7 +2644,6 @@ public:
>6.2.2 Syntax-Based Normalization (rfc3986)</a> >6.2.2 Syntax-Based Normalization (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_base& url_base&
normalize_fragment(); normalize_fragment();
@ -2785,7 +2737,6 @@ public:
@ref url, @ref url,
@ref url_view. @ref url_view.
*/ */
BOOST_URL_DECL
system::result<void> system::result<void>
resolve( resolve(
url_view_base const& ref); url_view_base const& ref);
@ -2822,7 +2773,6 @@ private:
core::string_view core::string_view
first_segment() const noexcept; first_segment() const noexcept;
BOOST_URL_DECL
detail::segments_iter_impl detail::segments_iter_impl
edit_segments( edit_segments(
detail::segments_iter_impl const&, detail::segments_iter_impl const&,
@ -2830,7 +2780,6 @@ private:
detail::any_segments_iter&& it0, detail::any_segments_iter&& it0,
int absolute = -1); int absolute = -1);
BOOST_URL_DECL
auto auto
edit_params( edit_params(
detail::params_iter_impl const&, detail::params_iter_impl const&,
@ -2838,7 +2787,6 @@ private:
detail::any_params_iter&&) -> detail::any_params_iter&&) ->
detail::params_iter_impl; detail::params_iter_impl;
BOOST_URL_DECL
system::result<void> system::result<void>
resolve_impl( resolve_impl(
url_view_base const& base, url_view_base const& base,

View File

@ -71,7 +71,7 @@ namespace urls {
@ref parse_uri, @ref parse_uri,
@ref parse_uri_reference. @ref parse_uri_reference.
*/ */
class BOOST_SYMBOL_VISIBLE url_view class BOOST_URL_DECL url_view
: public url_view_base : public url_view_base
{ {
friend std::hash<url_view>; friend std::hash<url_view>;
@ -143,7 +143,6 @@ public:
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2" <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-4.2"
>4.2. Relative Reference (rfc3986)</a> >4.2. Relative Reference (rfc3986)</a>
*/ */
BOOST_URL_DECL
url_view() noexcept; url_view() noexcept;
/** Constructor /** Constructor
@ -195,7 +194,6 @@ public:
@see @see
@ref parse_uri_reference. @ref parse_uri_reference.
*/ */
BOOST_URL_DECL
url_view(core::string_view s); url_view(core::string_view s);
/// @copydoc url_view(core::string_view) /// @copydoc url_view(core::string_view)
@ -257,7 +255,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
url_view( url_view(
url_view_base const& other) noexcept; url_view_base const& other) noexcept;
@ -305,7 +302,6 @@ public:
@par Exception Safety @par Exception Safety
Throws nothing. Throws nothing.
*/ */
BOOST_URL_DECL
url_view& operator=( url_view& operator=(
url_view_base const& other) noexcept; url_view_base const& other) noexcept;

View File

@ -62,7 +62,7 @@ struct pattern;
@li @ref parse_uri @li @ref parse_uri
@li @ref parse_uri_reference @li @ref parse_uri_reference
*/ */
class BOOST_SYMBOL_VISIBLE class BOOST_URL_DECL
url_view_base url_view_base
: private detail::parts_base : private detail::parts_base
{ {
@ -89,10 +89,8 @@ class BOOST_SYMBOL_VISIBLE
struct shared_impl; struct shared_impl;
BOOST_URL_DECL
url_view_base() noexcept; url_view_base() noexcept;
BOOST_URL_DECL
explicit url_view_base( explicit url_view_base(
detail::url_impl const&) noexcept; detail::url_impl const&) noexcept;
@ -113,7 +111,6 @@ class BOOST_SYMBOL_VISIBLE
#ifndef BOOST_URL_DOCS #ifndef BOOST_URL_DOCS
public: public:
#endif #endif
BOOST_URL_DECL
std::size_t std::size_t
digest(std::size_t = 0) const noexcept; digest(std::size_t = 0) const noexcept;
@ -297,7 +294,6 @@ public:
@par Exception Safety @par Exception Safety
Calls to allocate may throw. Calls to allocate may throw.
*/ */
BOOST_URL_DECL
std::shared_ptr< std::shared_ptr<
url_view const> persist() const; url_view const> persist() const;
@ -340,7 +336,6 @@ public:
@ref scheme, @ref scheme,
@ref scheme_id. @ref scheme_id.
*/ */
BOOST_URL_DECL
bool bool
has_scheme() const noexcept; has_scheme() const noexcept;
@ -377,7 +372,6 @@ public:
@ref has_scheme, @ref has_scheme,
@ref scheme_id. @ref scheme_id.
*/ */
BOOST_URL_DECL
core::string_view core::string_view
scheme() const noexcept; scheme() const noexcept;
@ -427,7 +421,6 @@ public:
@ref has_scheme, @ref has_scheme,
@ref scheme. @ref scheme.
*/ */
BOOST_URL_DECL
urls::scheme urls::scheme
scheme_id() const noexcept; scheme_id() const noexcept;
@ -519,7 +512,6 @@ public:
@ref encoded_authority, @ref encoded_authority,
@ref has_authority. @ref has_authority.
*/ */
BOOST_URL_DECL
authority_view authority_view
authority() const noexcept; authority() const noexcept;
@ -556,7 +548,6 @@ public:
@ref authority, @ref authority,
@ref has_authority. @ref has_authority.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_authority() const noexcept; encoded_authority() const noexcept;
@ -603,7 +594,6 @@ public:
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
bool bool
has_userinfo() const noexcept; has_userinfo() const noexcept;
@ -645,7 +635,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
bool bool
has_password() const noexcept; has_password() const noexcept;
@ -754,7 +743,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_userinfo() const noexcept; encoded_userinfo() const noexcept;
@ -853,7 +841,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_user() const noexcept; encoded_user() const noexcept;
@ -946,7 +933,6 @@ public:
@ref user, @ref user,
@ref userinfo. @ref userinfo.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_password() const noexcept; encoded_password() const noexcept;
@ -1067,7 +1053,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host() const noexcept; encoded_host() const noexcept;
@ -1182,7 +1167,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_address() const noexcept; encoded_host_address() const noexcept;
@ -1222,7 +1206,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
ipv4_address ipv4_address
host_ipv4_address() const noexcept; host_ipv4_address() const noexcept;
@ -1270,7 +1253,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
ipv6_address ipv6_address
host_ipv6_address() const noexcept; host_ipv6_address() const noexcept;
@ -1303,7 +1285,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
core::string_view core::string_view
host_ipvfuture() const noexcept; host_ipvfuture() const noexcept;
@ -1384,7 +1365,6 @@ public:
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2" @li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2"
>3.2.2. Host (rfc3986)</a> >3.2.2. Host (rfc3986)</a>
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_name() const noexcept; encoded_host_name() const noexcept;
@ -1426,7 +1406,6 @@ public:
@ref port, @ref port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
bool bool
has_port() const noexcept; has_port() const noexcept;
@ -1462,7 +1441,6 @@ public:
@ref has_port, @ref has_port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
core::string_view core::string_view
port() const noexcept; port() const noexcept;
@ -1498,7 +1476,6 @@ public:
@ref has_port, @ref has_port,
@ref port. @ref port.
*/ */
BOOST_URL_DECL
std::uint16_t std::uint16_t
port_number() const noexcept; port_number() const noexcept;
@ -1654,7 +1631,6 @@ public:
@ref path, @ref path,
@ref segments. @ref segments.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_path() const noexcept; encoded_path() const noexcept;
@ -1695,7 +1671,6 @@ public:
@ref path, @ref path,
@ref segments_view. @ref segments_view.
*/ */
BOOST_URL_DECL
segments_view segments_view
segments() const noexcept; segments() const noexcept;
@ -1746,7 +1721,6 @@ public:
@ref segments, @ref segments,
@ref segments_encoded_view. @ref segments_encoded_view.
*/ */
BOOST_URL_DECL
segments_encoded_view segments_encoded_view
encoded_segments() const noexcept; encoded_segments() const noexcept;
@ -1793,7 +1767,6 @@ public:
@ref params, @ref params,
@ref query. @ref query.
*/ */
BOOST_URL_DECL
bool bool
has_query() const noexcept; has_query() const noexcept;
@ -1895,7 +1868,6 @@ public:
@ref params, @ref params,
@ref query. @ref query.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_query() const noexcept; encoded_query() const noexcept;
@ -1940,11 +1912,9 @@ public:
@ref has_query, @ref has_query,
@ref query. @ref query.
*/ */
BOOST_URL_DECL
params_view params_view
params() const noexcept; params() const noexcept;
BOOST_URL_DECL
params_view params_view
params(encoding_opts opt) const noexcept; params(encoding_opts opt) const noexcept;
@ -1993,7 +1963,6 @@ public:
@ref params, @ref params,
@ref query. @ref query.
*/ */
BOOST_URL_DECL
params_encoded_view params_encoded_view
encoded_params() const noexcept; encoded_params() const noexcept;
@ -2036,7 +2005,6 @@ public:
@ref encoded_fragment, @ref encoded_fragment,
@ref fragment. @ref fragment.
*/ */
BOOST_URL_DECL
bool bool
has_fragment() const noexcept; has_fragment() const noexcept;
@ -2141,7 +2109,6 @@ public:
@ref fragment, @ref fragment,
@ref has_fragment. @ref has_fragment.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_fragment() const noexcept; encoded_fragment() const noexcept;
@ -2187,7 +2154,6 @@ public:
@ref port, @ref port,
@ref port_number. @ref port_number.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_host_and_port() const noexcept; encoded_host_and_port() const noexcept;
@ -2216,7 +2182,6 @@ public:
@ref encoded_resource, @ref encoded_resource,
@ref encoded_target. @ref encoded_target.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_origin() const noexcept; encoded_origin() const noexcept;
@ -2249,7 +2214,6 @@ public:
@ref encoded_origin, @ref encoded_origin,
@ref encoded_target. @ref encoded_target.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_resource() const noexcept; encoded_resource() const noexcept;
@ -2282,7 +2246,6 @@ public:
@ref encoded_origin, @ref encoded_origin,
@ref encoded_resource. @ref encoded_resource.
*/ */
BOOST_URL_DECL
pct_string_view pct_string_view
encoded_target() const noexcept; encoded_target() const noexcept;
@ -2311,7 +2274,6 @@ public:
@return -1 if `*this < other`, 0 if @return -1 if `*this < other`, 0 if
`this == other`, and 1 if `this > other`. `this == other`, and 1 if `this > other`.
*/ */
BOOST_URL_DECL
int int
compare(url_view_base const& other) const noexcept; compare(url_view_base const& other) const noexcept;
@ -2690,7 +2652,6 @@ private:
// implementation // implementation
// //
//-------------------------------------------- //--------------------------------------------
BOOST_URL_DECL
static static
int int
segments_compare( segments_compare(

View File

@ -158,6 +158,146 @@ apply_frag(
decoded_[id_frag] = s.decoded_size(); decoded_[id_frag] = s.decoded_size();
} }
// return length of [first, last)
auto
url_impl::
len(
int first,
int last) const noexcept ->
std::size_t
{
BOOST_ASSERT(first <= last);
BOOST_ASSERT(last <= id_end);
return offset(last) - offset(first);
}
// return length of part
auto
url_impl::
len(int id) const noexcept ->
std::size_t
{
return id == id_end
? zero_
: ( offset(id + 1) -
offset(id) );
}
// return offset of id
auto
url_impl::
offset(int id) const noexcept ->
std::size_t
{
return
id == id_scheme
? zero_
: offset_[id];
}
// return id as string
core::string_view
url_impl::
get(int id) const noexcept
{
return {
cs_ + offset(id), len(id) };
}
// return [first, last) as string
core::string_view
url_impl::
get(int first,
int last) const noexcept
{
return { cs_ + offset(first),
offset(last) - offset(first) };
}
// return id as pct-string
pct_string_view
url_impl::
pct_get(
int id) const noexcept
{
return make_pct_string_view_unsafe(
cs_ + offset(id),
len(id),
decoded_[id]);
}
// return [first, last) as pct-string
pct_string_view
url_impl::
pct_get(
int first,
int last) const noexcept
{
auto const pos = offset(first);
std::size_t n = 0;
for(auto i = first; i < last;)
n += decoded_[i++];
return make_pct_string_view_unsafe(
cs_ + pos,
offset(last) - pos,
n);
}
//------------------------------------------------
// change id to size n
void
url_impl::
set_size(
int id,
std::size_t n) noexcept
{
auto d = n - len(id);
for(auto i = id + 1;
i <= id_end; ++i)
offset_[i] += d;
}
// trim id to size n,
// moving excess into id+1
void
url_impl::
split(
int id,
std::size_t n) noexcept
{
BOOST_ASSERT(id < id_end - 1);
//BOOST_ASSERT(n <= len(id));
offset_[id + 1] = offset(id) + n;
}
// add n to [first, last]
void
url_impl::
adjust(
int first,
int last,
std::size_t n) noexcept
{
for(int i = first;
i <= last; ++i)
offset_[i] += n;
}
// set [first, last) offset
void
url_impl::
collapse(
int first,
int last,
std::size_t n) noexcept
{
for(int i = first + 1;
i < last; ++i)
offset_[i] = n;
}
//------------------------------------------------ //------------------------------------------------
// //
// path_ref // path_ref

32
src/encoding_opts.cpp Normal file
View File

@ -0,0 +1,32 @@
//
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/url
//
#ifndef BOOST_URL_IMPL_ENCONDING_OPTS_IPP
#define BOOST_URL_IMPL_ENCONDING_OPTS_IPP
#include <boost/url/detail/config.hpp>
#include <boost/url/encoding_opts.hpp>
namespace boost {
namespace urls {
encoding_opts::
encoding_opts(
bool space_as_plus_,
bool lower_case_,
bool disallow_null_) noexcept
: space_as_plus(space_as_plus_)
, lower_case(lower_case_)
, disallow_null(disallow_null_)
{}
} // urls
} // boost
#endif

View File

@ -20,6 +20,8 @@
namespace boost { namespace boost {
namespace urls { namespace urls {
//------------------------------------------------
params_base:: params_base::
iterator:: iterator::
iterator( iterator(
@ -41,7 +43,6 @@ iterator(
{ {
} }
//------------------------------------------------
auto auto
params_base:: params_base::
@ -67,6 +68,77 @@ operator*() const ->
// //
//------------------------------------------------ //------------------------------------------------
params_base::
params_base() noexcept
// space_as_plus = true
: opt_(true, false, false)
{
}
bool
params_base::
contains(
core::string_view key,
ignore_case_param ic) const noexcept
{
return find(
begin(),key, ic) != end();
}
auto
params_base::
find(
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_impl(
begin().it_, key, ic),
opt_);
}
auto
params_base::
find(
iterator it,
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_impl(
it.it_, key, ic),
opt_);
}
auto
params_base::
find_last(
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_last_impl(
end().it_, key, ic),
opt_);
}
auto
params_base::
find_last(
iterator it,
core::string_view key,
ignore_case_param ic) const noexcept ->
iterator
{
return iterator(
find_last_impl(
it.it_, key, ic),
opt_);
}
params_base:: params_base::
params_base( params_base(
detail::query_ref const& ref, detail::query_ref const& ref,

View File

@ -219,6 +219,32 @@ set(
} }
} }
auto
params_encoded_ref::
erase(
iterator pos) noexcept ->
iterator
{
return erase(
pos,
std::next(pos));
}
auto
params_encoded_ref::
erase(
iterator first,
iterator last) noexcept ->
iterator
{
core::string_view s("", 0);
return u_->edit_params(
first.it_,
last.it_,
detail::query_iter(s));
}
//------------------------------------------------ //------------------------------------------------
// //
// (implementation) // (implementation)

View File

@ -211,6 +211,33 @@ set(
} }
} }
auto
params_ref::
erase(
iterator pos) noexcept ->
iterator
{
return erase(
pos,
std::next(pos));
}
auto
params_ref::
erase(
iterator first,
iterator last) noexcept ->
iterator
{
core::string_view s("", 0);
return iterator(
u_->edit_params(
first.it_,
last.it_,
detail::query_iter(s)),
opt_);
}
//------------------------------------------------ //------------------------------------------------
// //
// (implementation) // (implementation)