From c4ad35a606d3046843eaf1941c6264fdcc57fee2 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Mon, 30 Aug 2021 17:10:45 -0700 Subject: [PATCH] Refactor source structure --- CMakeLists.txt | 2 - include/boost/url.hpp | 3 +- include/boost/url/bnf/char_set.hpp | 92 +++++++++ include/boost/url/config.hpp | 51 +---- include/boost/url/detail/char_type.hpp | 3 +- include/boost/url/detail/config.hpp | 274 +++---------------------- include/boost/url/detail/parse.hpp | 2 +- include/boost/url/detail/parts.hpp | 2 +- include/boost/url/detail/storage.hpp | 2 +- include/boost/url/error.hpp | 19 +- include/boost/url/host_type.hpp | 2 +- include/boost/url/impl/error.hpp | 2 +- include/boost/url/impl/error.ipp | 2 +- include/boost/url/impl/scheme.ipp | 2 +- include/boost/url/impl/url.hpp | 2 +- include/boost/url/impl/url.ipp | 2 +- include/boost/url/impl/url_view.hpp | 2 +- include/boost/url/impl/url_view.ipp | 2 +- include/boost/url/scheme.hpp | 7 +- include/boost/url/src.hpp | 14 +- include/boost/url/static_pool.hpp | 2 +- include/boost/url/storage_ptr.hpp | 2 +- include/boost/url/string.hpp | 33 +++ include/boost/url/url.hpp | 2 +- include/boost/url/url_view.hpp | 2 +- include/boost/url/urls.hpp | 2 +- src/src.cpp | 4 +- test/_detail_char_type.cpp | 2 +- test/_detail_parse.cpp | 2 +- test/bnf/char_set.cpp | 11 + test/error.cpp | 2 +- test/host_type.cpp | 2 +- test/sandbox.cpp | 2 +- test/scheme.cpp | 2 +- test/static_pool.cpp | 2 +- test/storage_ptr.cpp | 2 +- test/string.cpp | 11 + test/url.cpp | 2 +- test/url_view.cpp | 2 +- test/urls.cpp | 2 +- 40 files changed, 229 insertions(+), 349 deletions(-) create mode 100644 include/boost/url/bnf/char_set.hpp create mode 100644 include/boost/url/string.hpp create mode 100644 test/bnf/char_set.cpp create mode 100644 test/string.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c3efc5f..3019bfd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,6 @@ if(BOOST_URL_IS_ROOT) exception json mp11 - optional system throw_exception utility @@ -104,7 +103,6 @@ function(boost_url_setup_properties target) Boost::container Boost::exception Boost::json - Boost::optional Boost::mp11 Boost::system Boost::throw_exception diff --git a/include/boost/url.hpp b/include/boost/url.hpp index d8e1f62d..23e2c5d0 100644 --- a/include/boost/url.hpp +++ b/include/boost/url.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_HPP @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/url/bnf/char_set.hpp b/include/boost/url/bnf/char_set.hpp new file mode 100644 index 00000000..c2b0b1a7 --- /dev/null +++ b/include/boost/url/bnf/char_set.hpp @@ -0,0 +1,92 @@ +// +// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot 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/CPPAlliance/url +// + +#ifndef BOOST_URL_CHAR_SET_HPP +#define BOOST_URL_CHAR_SET_HPP + +#include + +namespace boost { +namespace urls { +namespace bnf { + +/** A table-driven character set +*/ +class char_set_table +{ + char const* const tab_; + +public: + char_set_table( + char const* tab) noexcept + : tab_(tab) + { + } + + bool + contains( + char c) const noexcept + { + auto const u = static_cast< + unsigned char>(c); + return tab_[u] != 0; + } + + template + Char* + skip( + Char* first, + char const* end) const noexcept + { + while(first != end) + { + if(! contains(*first)) + break; + ++first; + } + return first; + } +}; + +//------------------------------------------------ + +template +class char_set_function +{ +public: + bool + contains( + char c) const noexcept + { + auto const u = static_cast< + unsigned char>(c); + return F(u) != 0; + } + + template + Char* + skip( + Char* first, + char const* end) const noexcept + { + while(first != end) + { + if(! contains(*first)) + break; + ++first; + } + return first; + } +}; + +} // bnf +} // urls +} // boost + +#endif diff --git a/include/boost/url/config.hpp b/include/boost/url/config.hpp index 03570bdb..c157aac4 100644 --- a/include/boost/url/config.hpp +++ b/include/boost/url/config.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_CONFIG_HPP @@ -16,55 +16,6 @@ namespace boost { namespace urls { -/// The string alias template return type for allocating member functions. -template -using string_type = - std::basic_string, Allocator>; - -#ifndef BOOST_URL_STANDALONE - -/// The type of string view used by the library. -using string_view = boost::string_view; - -/// The type of error code used by the library. -using error_code = boost::system::error_code; - -/// The type of system error thrown by the library. -using system_error = boost::system::system_error; - -/// The type of error category used by the library. -using error_category = boost::system::error_category; - -/// The type of error condition used by the library. -using error_condition = boost::system::error_condition; - -/// The type of optional used by the library. -template -using optional = boost::optional; - -#ifdef BOOST_URL_DOCS -/// Returns the generic error category used by the library. -error_category const& -generic_category(); -#else -using boost::system::generic_category; -#endif - -#else - -using error_code = std::error_code; -using error_category = std::error_category; -using error_condition = std::error_condition; -using string_view = std::string_view; -using system_error = std::system_error; -using std::generic_category; - -template -using optional = std::optional; - -#endif - } // urls } // boost diff --git a/include/boost/url/detail/char_type.hpp b/include/boost/url/detail/char_type.hpp index 7366d3b5..dec94cf7 100644 --- a/include/boost/url/detail/char_type.hpp +++ b/include/boost/url/detail/char_type.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_DETAIL_CHAR_TYPE_HPP @@ -12,6 +12,7 @@ #include #include +#include #include namespace boost { diff --git a/include/boost/url/detail/config.hpp b/include/boost/url/detail/config.hpp index 881401e5..c8c56334 100644 --- a/include/boost/url/detail/config.hpp +++ b/include/boost/url/detail/config.hpp @@ -4,38 +4,18 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_DETAIL_CONFIG_HPP #define BOOST_URL_DETAIL_CONFIG_HPP -#ifndef BOOST_URL_STANDALONE -# include -# include -# include -# include -# include -# include -# include -# include -#else -# include -# include -# include -# include -#endif +#include +#include +#include +#include #include -// detect 32/64 bit -#if UINTPTR_MAX == UINT64_MAX -# define BOOST_URL_ARCH 64 -#elif UINTPTR_MAX == UINT32_MAX -# define BOOST_URL_ARCH 32 -#else -# error Unknown or unsupported architecture, please open an issue -#endif - // VFALCO Copied from // This is a derivative work. #ifdef __has_cpp_attribute @@ -49,235 +29,27 @@ # define BOOST_URL_NODISCARD #endif -#ifndef BOOST_URL_FORCEINLINE -# ifdef _MSC_VER -# define BOOST_URL_FORCEINLINE __forceinline -# else -# define BOOST_URL_FORCEINLINE inline -# endif -#endif - -// BOOST_NORETURN ---------------------------------------------// -// Macro to use before a function declaration/definition to designate -// the function as not returning normally (i.e. with a return statement -// or by leaving the function scope, if the function return type is void). -#if !defined(BOOST_NORETURN) -# if defined(_MSC_VER) -# define BOOST_NORETURN __declspec(noreturn) -# elif defined(__GNUC__) -# define BOOST_NORETURN __attribute__ ((__noreturn__)) -# elif defined(__has_attribute) && defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x5130) -# if __has_attribute(noreturn) -# define BOOST_NORETURN [[noreturn]] -# endif -# elif defined(__has_cpp_attribute) -# if __has_cpp_attribute(noreturn) -# define BOOST_NORETURN [[noreturn]] -# endif -# endif -#endif - -#ifndef BOOST_SYMBOL_VISIBLE -#define BOOST_SYMBOL_VISIBLE -#endif - -#ifndef BOOST_ASSERT -#define BOOST_ASSERT assert -#endif - -#ifndef BOOST_STATIC_ASSERT -#define BOOST_STATIC_ASSERT( ... ) static_assert(__VA_ARGS__, #__VA_ARGS__) -#endif - -#ifndef BOOST_FALLTHROUGH -#define BOOST_FALLTHROUGH [[fallthrough]] -#endif - -#ifndef BOOST_THROW_EXCEPTION -# ifndef BOOST_NO_EXCEPTIONS -# define BOOST_THROW_EXCEPTION(x) throw(x) -# else -# define BOOST_THROW_EXCEPTION(x) do{}while(0) -# endif -#endif - -#ifndef BOOST_URL_NO_SSE2 -# if (defined(_M_IX86) && _M_IX86_FP == 2) || \ - defined(_M_X64) || defined(__SSE2__) -# define BOOST_URL_USE_SSE2 -# endif -#endif - -#ifndef BOOST_URL_STANDALONE -# if defined(BOOST_URL_DOCS) -# define BOOST_URL_DECL -# elif defined(BOOST_URL_HEADER_ONLY) -# define BOOST_URL_DECL inline -# else -# if (defined(BOOST_URL_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_URL_STATIC_LINK) -# if defined(BOOST_URL_SOURCE) -# define BOOST_URL_DECL BOOST_SYMBOL_EXPORT -# define BOOST_URL_BUILD_DLL -# 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) -# define BOOST_LIB_NAME boost_uri -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_URL_DYN_LINK) -# define BOOST_DYN_LINK -# endif -# include -# endif -# endif +#if defined(BOOST_URL_DOCS) +# define BOOST_URL_DECL #else -# ifdef BOOST_URL_HEADER_ONLY -# define BOOST_URL_DECL inline -# else +# if (defined(BOOST_URL_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_URL_STATIC_LINK) +# if defined(BOOST_URL_SOURCE) +# define BOOST_URL_DECL BOOST_SYMBOL_EXPORT +# define BOOST_URL_BUILD_DLL +# 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) +# define BOOST_LIB_NAME boost_url +# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_URL_DYN_LINK) +# define BOOST_DYN_LINK +# endif +# include +# endif #endif -// These macros are private, for tests, do not change -// them or else previously built libraries won't match. -#ifndef BOOST_URL_MAX_OBJECT_SIZE -# define BOOST_URL_NO_MAX_OBJECT_SIZE -# define BOOST_URL_MAX_OBJECT_SIZE 0x7ffffffe -#endif -#ifndef BOOST_URL_MAX_ARRAY_SIZE -# define BOOST_URL_NO_MAX_ARRAY_SIZE -# define BOOST_URL_MAX_ARRAY_SIZE 0x7ffffffe -#endif -#ifndef BOOST_URL_MAX_STRING_SIZE -# define BOOST_URL_NO_MAX_STRING_SIZE -# define BOOST_URL_MAX_STRING_SIZE 0x7ffffffe -#endif -#ifndef BOOST_URL_MAX_STACK_SIZE -# define BOOST_URL_NO_MAX_STACK_SIZE -# define BOOST_URL_MAX_STACK_SIZE ((::size_t)(-1)) -#endif -#ifndef BOOST_URL_PARSER_BUFFER_SIZE -# define BOOST_URL_NO_PARSER_BUFFER_SIZE -# define BOOST_URL_PARSER_BUFFER_SIZE 2048 -#endif - -namespace boost { -namespace urls { - -#ifndef BOOST_URL_STANDALONE -using string_view = boost::string_view; -#else -using string_view = std::string_view; -#endif - -namespace detail { - -template -struct make_void -{ - using type =void; -}; - -template -using void_t = typename - make_void::type; - -template -struct remove_const -{ - using type = T; -}; - -template -struct remove_const -{ - using type = T; -}; - -template -struct remove_reference -{ - using type = T; -}; - -template -struct remove_reference -{ - using type = T; -}; - -template -constexpr -typename remove_reference::type&& -move(T&& t) noexcept -{ - return static_cast::type&&>(t); -} - -template -inline -T -exchange(T& t, U u) noexcept -{ - T v = move(t); - t = move(u); - return v; -} - -template -using is_string_viewish = typename std::enable_if< - std::is_convertible< - T const&, string_view>::value && - ! std::is_convertible< - T const&, char const*>::value - >::type; - -/* This is a derivative work, original copyright: - - Copyright Eric Niebler 2013-present - - Use, modification and distribution is subject to 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) - - Project home: https://github.com/ericniebler/range-v3 -*/ -template -struct static_const -{ - static constexpr T value {}; -}; -template -constexpr T static_const::value; - -#define BOOST_URL_INLINE_VARIABLE(name, type) \ - namespace \ - { \ - constexpr auto& name = \ - ::boost::urls::detail::static_const::value; \ - } - -struct primary_template -{ -}; - -template -using is_specialized = - std::integral_constant::value>; - -template -using remove_cr = - typename remove_const< - typename remove_reference::type>::type; - -} // detail -} // urls -} // boost - #endif diff --git a/include/boost/url/detail/parse.hpp b/include/boost/url/detail/parse.hpp index b0894d8f..56e2ee3f 100644 --- a/include/boost/url/detail/parse.hpp +++ b/include/boost/url/detail/parse.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_DETAIL_PARSE_HPP diff --git a/include/boost/url/detail/parts.hpp b/include/boost/url/detail/parts.hpp index 5790940e..6a7f84f3 100644 --- a/include/boost/url/detail/parts.hpp +++ b/include/boost/url/detail/parts.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_DETAIL_PARTS_HPP diff --git a/include/boost/url/detail/storage.hpp b/include/boost/url/detail/storage.hpp index 225d8015..f0c4ca16 100644 --- a/include/boost/url/detail/storage.hpp +++ b/include/boost/url/detail/storage.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_DETAIL_STORAGE_HPP diff --git a/include/boost/url/error.hpp b/include/boost/url/error.hpp index f7ee0da1..73905c9e 100644 --- a/include/boost/url/error.hpp +++ b/include/boost/url/error.hpp @@ -4,18 +4,32 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_ERROR_HPP #define BOOST_URL_ERROR_HPP #include +#include +#include #include namespace boost { namespace urls { +/// The type of error code used by the library +using error_code = boost::system::error_code; + +/// The type of system error thrown by the library +using system_error = boost::system::system_error; + +/// The type of error category used by the library +using error_category = boost::system::error_category; + +/// The type of error condition used by the library +using error_condition = boost::system::error_condition; + struct BOOST_SYMBOL_VISIBLE parse_error : std::invalid_argument { @@ -133,8 +147,5 @@ enum class condition } // boost #include -#ifdef BOOST_URL_HEADER_ONLY -#include -#endif #endif diff --git a/include/boost/url/host_type.hpp b/include/boost/url/host_type.hpp index 95d3aa4f..82e86ca5 100644 --- a/include/boost/url/host_type.hpp +++ b/include/boost/url/host_type.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_HOST_TYPE_HPP diff --git a/include/boost/url/impl/error.hpp b/include/boost/url/impl/error.hpp index a7599371..8790070c 100644 --- a/include/boost/url/impl/error.hpp +++ b/include/boost/url/impl/error.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_ERROR_HPP diff --git a/include/boost/url/impl/error.ipp b/include/boost/url/impl/error.ipp index 4601cad4..f08c76e4 100644 --- a/include/boost/url/impl/error.ipp +++ b/include/boost/url/impl/error.ipp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_ERROR_IPP diff --git a/include/boost/url/impl/scheme.ipp b/include/boost/url/impl/scheme.ipp index 18855504..9471ec3f 100644 --- a/include/boost/url/impl/scheme.ipp +++ b/include/boost/url/impl/scheme.ipp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_SCHEME_IPP diff --git a/include/boost/url/impl/url.hpp b/include/boost/url/impl/url.hpp index 3e5ac96a..862cc05e 100644 --- a/include/boost/url/impl/url.hpp +++ b/include/boost/url/impl/url.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_URL_HPP diff --git a/include/boost/url/impl/url.ipp b/include/boost/url/impl/url.ipp index 046c5f6c..6d6ad198 100644 --- a/include/boost/url/impl/url.ipp +++ b/include/boost/url/impl/url.ipp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_URL_BASE_IPP diff --git a/include/boost/url/impl/url_view.hpp b/include/boost/url/impl/url_view.hpp index 049ffb7b..a9b12158 100644 --- a/include/boost/url/impl/url_view.hpp +++ b/include/boost/url/impl/url_view.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_URL_VIEW_HPP diff --git a/include/boost/url/impl/url_view.ipp b/include/boost/url/impl/url_view.ipp index 659dea3e..e33a3e18 100644 --- a/include/boost/url/impl/url_view.ipp +++ b/include/boost/url/impl/url_view.ipp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_IMPL_URL_VIEW_IPP diff --git a/include/boost/url/scheme.hpp b/include/boost/url/scheme.hpp index 15a30c1d..227044fb 100644 --- a/include/boost/url/scheme.hpp +++ b/include/boost/url/scheme.hpp @@ -4,13 +4,14 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_SCHEME_HPP #define BOOST_URL_SCHEME_HPP #include +#include namespace boost { namespace urls { @@ -60,8 +61,4 @@ is_special(string_view s) noexcept } // urls } // boost -#ifdef BOOST_URL_HEADER_ONLY -#include -#endif - #endif diff --git a/include/boost/url/src.hpp b/include/boost/url/src.hpp index 4eb579d7..2f9844c8 100644 --- a/include/boost/url/src.hpp +++ b/include/boost/url/src.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_SRC_HPP @@ -17,12 +17,16 @@ in a translation unit of the program. */ -#include - -#if defined(BOOST_URL_HEADER_ONLY) -# error Do not compile library source with the header only macro defined +#ifndef BOOST_URL_SOURCE +#define BOOST_URL_SOURCE #endif +// We include this in case someone is +// using src.hpp as their main header file +#include + +#include + #include #include #include diff --git a/include/boost/url/static_pool.hpp b/include/boost/url/static_pool.hpp index 57ebcb5a..15c1e974 100644 --- a/include/boost/url/static_pool.hpp +++ b/include/boost/url/static_pool.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_STATIC_POOL_HPP diff --git a/include/boost/url/storage_ptr.hpp b/include/boost/url/storage_ptr.hpp index c1137572..5371cd24 100644 --- a/include/boost/url/storage_ptr.hpp +++ b/include/boost/url/storage_ptr.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_STORAGE_PTR_HPP diff --git a/include/boost/url/string.hpp b/include/boost/url/string.hpp new file mode 100644 index 00000000..28d21848 --- /dev/null +++ b/include/boost/url/string.hpp @@ -0,0 +1,33 @@ +// +// 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/CPPAllinace/url +// + +#ifndef BOOST_URL_STRING_HPP +#define BOOST_URL_STRING_HPP + +#include +#include +#include + +namespace boost { +namespace urls { + +/** The type of string_view used by the library +*/ +using string_view = boost::string_view; + +/// The string alias template return type for allocating member functions. +template +using string_type = + std::basic_string, Allocator>; + +} // urls +} // boost + +#endif diff --git a/include/boost/url/url.hpp b/include/boost/url/url.hpp index b91d76fd..29f3cb24 100644 --- a/include/boost/url/url.hpp +++ b/include/boost/url/url.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_URL_HPP diff --git a/include/boost/url/url_view.hpp b/include/boost/url/url_view.hpp index f5063792..c944bde9 100644 --- a/include/boost/url/url_view.hpp +++ b/include/boost/url/url_view.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_URL_VIEW_HPP diff --git a/include/boost/url/urls.hpp b/include/boost/url/urls.hpp index c7290be7..aeb9ad09 100644 --- a/include/boost/url/urls.hpp +++ b/include/boost/url/urls.hpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #ifndef BOOST_URL_URLS_HPP diff --git a/src/src.cpp b/src/src.cpp index 26daa09a..1740073f 100644 --- a/src/src.cpp +++ b/src/src.cpp @@ -4,9 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // -#ifndef BOOST_URL_HEADER_ONLY #include -#endif diff --git a/test/_detail_char_type.cpp b/test/_detail_char_type.cpp index 46dd20e1..473e6100 100644 --- a/test/_detail_char_type.cpp +++ b/test/_detail_char_type.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #include diff --git a/test/_detail_parse.cpp b/test/_detail_parse.cpp index c065a65a..9e508692 100644 --- a/test/_detail_parse.cpp +++ b/test/_detail_parse.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #include diff --git a/test/bnf/char_set.cpp b/test/bnf/char_set.cpp new file mode 100644 index 00000000..11b2bfd2 --- /dev/null +++ b/test/bnf/char_set.cpp @@ -0,0 +1,11 @@ +// +// 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/CPPAlliance/url +// + +// Test that header file is self-contained. +#include diff --git a/test/error.cpp b/test/error.cpp index 5747fbae..4c07d9c8 100644 --- a/test/error.cpp +++ b/test/error.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/host_type.cpp b/test/host_type.cpp index 37c5aa5c..0bc4d0d8 100644 --- a/test/host_type.cpp +++ b/test/host_type.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/sandbox.cpp b/test/sandbox.cpp index 54ce7e3e..7d5c4151 100644 --- a/test/sandbox.cpp +++ b/test/sandbox.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // #include "test_suite.hpp" diff --git a/test/scheme.cpp b/test/scheme.cpp index d33bb133..be9da7cb 100644 --- a/test/scheme.cpp +++ b/test/scheme.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/static_pool.cpp b/test/static_pool.cpp index 9818f355..79fc4fac 100644 --- a/test/static_pool.cpp +++ b/test/static_pool.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/storage_ptr.cpp b/test/storage_ptr.cpp index 58845df2..966e96ef 100644 --- a/test/storage_ptr.cpp +++ b/test/storage_ptr.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/string.cpp b/test/string.cpp new file mode 100644 index 00000000..e40c1baf --- /dev/null +++ b/test/string.cpp @@ -0,0 +1,11 @@ +// +// 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/CPPAlliance/url +// + +// Test that header file is self-contained. +#include diff --git a/test/url.cpp b/test/url.cpp index 9c1c4998..274ed8f4 100644 --- a/test/url.cpp +++ b/test/url.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/url_view.cpp b/test/url_view.cpp index dbc231cf..2e37625b 100644 --- a/test/url_view.cpp +++ b/test/url_view.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained. diff --git a/test/urls.cpp b/test/urls.cpp index ce56e15b..9f5b0966 100644 --- a/test/urls.cpp +++ b/test/urls.cpp @@ -4,7 +4,7 @@ // 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/vinniefalco/url +// Official repository: https://github.com/CPPAlliance/url // // Test that header file is self-contained.