From 629d37d303187d9c2d139666d1c855f7d98ef692 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Mon, 17 Nov 2025 19:53:26 -0600 Subject: [PATCH 01/10] Use core::string_view directly instead of alias Replaced all uses of string_view and basic_string_view with core::string_view and core::basic_string_view respectively throughout the codebase. Closes #3046 --- .gitignore | 1 - doc/qbk/04_http/08_chunked_encoding.qbk | 12 +-- doc/qbk/07_concepts/Fields.qbk | 8 +- doc/qbk/08_design/1_http_message.qbk | 26 +++--- doc/qbk/release_notes.qbk | 4 +- example/doc/http_examples.hpp | 14 +-- .../beast/_experimental/test/impl/stream.ipp | 8 +- .../boost/beast/_experimental/test/stream.hpp | 8 +- .../core/detail/impl/temporary_buffer.ipp | 6 +- .../beast/core/detail/static_ostream.hpp | 4 +- include/boost/beast/core/detail/string.hpp | 4 +- .../beast/core/detail/temporary_buffer.hpp | 8 +- include/boost/beast/core/impl/string.ipp | 4 +- .../boost/beast/core/impl/string_param.hpp | 6 +- include/boost/beast/core/string.hpp | 12 +-- include/boost/beast/core/string_param.hpp | 14 +-- include/boost/beast/core/string_type.hpp | 12 +-- include/boost/beast/http/basic_parser.hpp | 22 ++--- include/boost/beast/http/chunk_encode.hpp | 28 +++--- .../beast/http/detail/basic_parsed_list.hpp | 4 +- .../boost/beast/http/detail/basic_parser.hpp | 14 +-- .../boost/beast/http/detail/basic_parser.ipp | 12 +-- .../boost/beast/http/detail/chunk_encode.hpp | 2 +- include/boost/beast/http/detail/rfc7230.hpp | 10 +-- include/boost/beast/http/detail/rfc7230.ipp | 8 +- .../boost/beast/http/detail/type_traits.hpp | 30 +++---- include/boost/beast/http/field.hpp | 4 +- include/boost/beast/http/fields.hpp | 86 +++++++++---------- .../boost/beast/http/impl/basic_parser.ipp | 20 ++--- .../boost/beast/http/impl/chunk_encode.hpp | 16 ++-- include/boost/beast/http/impl/field.ipp | 14 +-- include/boost/beast/http/impl/fields.hpp | 82 +++++++++--------- include/boost/beast/http/impl/fields.ipp | 6 +- include/boost/beast/http/impl/message.hpp | 18 ++-- include/boost/beast/http/impl/rfc7230.hpp | 2 +- include/boost/beast/http/impl/rfc7230.ipp | 16 ++-- include/boost/beast/http/impl/status.ipp | 2 +- include/boost/beast/http/impl/verb.ipp | 4 +- include/boost/beast/http/message.hpp | 26 +++--- .../boost/beast/http/message_generator.hpp | 2 +- include/boost/beast/http/parser.hpp | 42 ++++----- include/boost/beast/http/rfc7230.hpp | 24 +++--- include/boost/beast/http/status.hpp | 2 +- include/boost/beast/http/verb.hpp | 4 +- .../boost/beast/websocket/detail/hybi13.hpp | 2 +- .../boost/beast/websocket/detail/hybi13.ipp | 2 +- .../beast/websocket/detail/pmd_extension.hpp | 2 +- .../beast/websocket/detail/pmd_extension.ipp | 2 +- include/boost/beast/websocket/impl/accept.hpp | 4 +- .../boost/beast/websocket/impl/handshake.hpp | 28 +++--- include/boost/beast/websocket/impl/stream.hpp | 2 +- .../beast/websocket/impl/stream_impl.hpp | 4 +- include/boost/beast/websocket/rfc6455.hpp | 4 +- include/boost/beast/websocket/stream.hpp | 32 +++---- test/beast/_experimental/icy_stream.cpp | 2 +- test/beast/core/_detail_base64.cpp | 4 +- test/beast/core/basic_stream.cpp | 10 +-- test/beast/core/bind_handler.cpp | 10 +-- test/beast/core/buffers_cat.cpp | 2 +- test/beast/core/buffers_range.cpp | 2 +- test/beast/core/buffers_suffix.cpp | 2 +- test/beast/core/detect_ssl.cpp | 6 +- test/beast/core/file_test.hpp | 2 +- test/beast/core/flat_buffer.cpp | 2 +- test/beast/core/flat_static_buffer.cpp | 2 +- test/beast/core/make_printable.cpp | 2 +- test/beast/core/multi_buffer.cpp | 4 +- test/beast/core/ostream.cpp | 8 +- test/beast/core/static_buffer.cpp | 2 +- test/beast/core/static_string.cpp | 26 +++--- test/beast/core/test_buffer.hpp | 16 ++-- test/beast/http/basic_parser.cpp | 32 +++---- test/beast/http/chunk_encode.cpp | 14 +-- test/beast/http/field.cpp | 4 +- test/beast/http/fields.cpp | 28 +++--- test/beast/http/file_body.cpp | 8 +- test/beast/http/message.cpp | 26 +++--- test/beast/http/message_fuzz.hpp | 2 +- test/beast/http/parser.cpp | 4 +- test/beast/http/read.cpp | 14 +-- test/beast/http/rfc7230.cpp | 12 +-- test/beast/http/test_parser.hpp | 20 ++--- test/beast/http/verb.cpp | 2 +- test/beast/http/write.cpp | 2 +- test/beast/websocket/accept.cpp | 4 +- test/beast/websocket/close.cpp | 10 +-- test/beast/websocket/handshake.cpp | 12 +-- test/beast/websocket/ping.cpp | 8 +- test/beast/websocket/read1.cpp | 2 +- test/beast/websocket/read2.cpp | 16 ++-- test/beast/websocket/read3.cpp | 14 +-- test/beast/websocket/test.hpp | 60 ++++++------- test/beast/websocket/timer.cpp | 2 +- test/beast/websocket/write.cpp | 2 +- test/beast/zlib/deflate_stream.cpp | 8 +- test/beast/zlib/inflate_stream.cpp | 2 +- test/bench/buffers/bench_buffers.cpp | 2 +- test/bench/parser/bench_parser.cpp | 28 +++--- test/bench/zlib/deflate_stream.cpp | 4 +- test/bench/zlib/inflate_stream.cpp | 6 +- test/doc/core_1_refresher.cpp | 4 +- test/doc/core_snippets.cpp | 2 +- test/doc/exemplars.cpp | 12 +-- test/doc/http_10_custom_parser.cpp | 32 +++---- test/doc/http_examples.cpp | 4 +- test/doc/http_snippets.cpp | 2 +- test/doc/websocket_2_handshaking.cpp | 4 +- test/doc/websocket_5_control_frames.cpp | 2 +- test/extras/include/boost/beast/test/fuzz.hpp | 2 +- test/fuzz/http_response.cpp | 2 +- test/fuzz/websocket_server.cpp | 2 +- 111 files changed, 621 insertions(+), 630 deletions(-) diff --git a/.gitignore b/.gitignore index 1740b535d7..37e6aaf894 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ bin64/ # Because of CMake and VS2017 Win32/ x64/ - diff --git a/doc/qbk/04_http/08_chunked_encoding.qbk b/doc/qbk/04_http/08_chunked_encoding.qbk index e0d01a055e..0201e9d845 100644 --- a/doc/qbk/04_http/08_chunked_encoding.qbk +++ b/doc/qbk/04_http/08_chunked_encoding.qbk @@ -178,9 +178,9 @@ interface provided by __parser__: ``` void callback( - std::uint64_t size, // Size of the chunk, zero for the last chunk - string_view extensions, // The chunk-extensions in raw form - error_code& ec); // May be set by the callback to indicate an error + std::uint64_t size, // Size of the chunk, zero for the last chunk + core::string_view extensions, // The chunk-extensions in raw form + error_code& ec); // May be set by the callback to indicate an error ``` ] ][ @@ -204,9 +204,9 @@ interface provided by __parser__: ``` std::size_t callback( - std::uint64_t remain, // Octets remaining in this chunk, includes `body` - string_view body, // A buffer holding some or all of the remainder of the chunk body - error_code& ec); // May be set by the callback to indicate an error + std::uint64_t remain, // Octets remaining in this chunk, includes `body` + core::string_view body, // A buffer holding some or all of the remainder of the chunk body + error_code& ec); // May be set by the callback to indicate an error ``` ] ]] diff --git a/doc/qbk/07_concepts/Fields.qbk b/doc/qbk/07_concepts/Fields.qbk index 381463f389..cb3c8d5f7e 100644 --- a/doc/qbk/07_concepts/Fields.qbk +++ b/doc/qbk/07_concepts/Fields.qbk @@ -30,7 +30,7 @@ In this table: * `c` denotes a (possibly const) value of type `F`. * `b` is a value of type `bool` * `n` is a value of type `boost::optional`. -* `s` is a value of type [link beast.ref.boost__beast__string_view `string_view`]. +* `s` is a value of type [link beast.ref.boost__beast__string_view `core::string_view`]. * `v` is a value of type `unsigned int` representing the HTTP-version. [table Valid expressions @@ -43,7 +43,7 @@ In this table: ] ][ [`c.get_method_impl()`] - [`string_view`] + [`core::string_view`] [ Returns the method text. The implementation only calls this function for request @@ -52,14 +52,14 @@ In this table: ] ][ [`c.get_target_impl()`] - [`string_view`] + [`core::string_view`] [ Returns the target string. The implementation only calls this function for request headers. ] ][ [`c.get_reason_impl()`] - [`string_view`] + [`core::string_view`] [ Returns the obsolete request text. The implementation only calls this for response headers when diff --git a/doc/qbk/08_design/1_http_message.qbk b/doc/qbk/08_design/1_http_message.qbk index cd3154c3df..435b2f2a69 100644 --- a/doc/qbk/08_design/1_http_message.qbk +++ b/doc/qbk/08_design/1_http_message.qbk @@ -254,15 +254,15 @@ a requirement to the [*Fields] type. First, the interface change: template struct header : Fields { - int version; + int version; - verb method() const; - string_view method_string() const; - void method(verb); - void method(string_view); + verb method() const; + core::string_view method_string() const; + void method(verb); + void method(core::string_view); - string_view target(); const; - void target(string_view); + core::string_view target(); const; + void target(core::string_view); private: verb method_; @@ -272,10 +272,10 @@ private: template struct header : Fields { - int version; - int result; - string_view reason() const; - void reason(string_view); + int version; + int result; + core::string_view reason() const; + void reason(core::string_view); }; ``` @@ -298,14 +298,14 @@ struct header : Fields int version; int status; - string_view + core::string_view reason() const { return this->reason_impl(); // protected member of Fields } void - reason(string_view s) + reason(core::string_view s) { this->reason_impl(s); // protected member of Fields } diff --git a/doc/qbk/release_notes.qbk b/doc/qbk/release_notes.qbk index 85768e9904..6cbca33a0b 100644 --- a/doc/qbk/release_notes.qbk +++ b/doc/qbk/release_notes.qbk @@ -258,7 +258,7 @@ [*Miscellaneous] * [issue 2363] Remove `BOOST_BEAST_USE_STD_STRING_VIEW` -* [issue 2417] use boost::core::string_view. This improves inter-conversion between string_view implementations. Some observable differences for users: +* [issue 2417] use boost::core::string_view. This improves inter-conversion between core::string_view implementations. Some observable differences for users: * `core::string_view` no longer supports the `.to_string()` or `.clear()` extensions from Utility * code that relied on `.max_size()` returning `.size(),` needs to be fixed to use `.size()` instead * `remove_suffix()` and `remove_prefix()` were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range @@ -426,7 +426,7 @@ * [issue 1956] Deprecate `string_param` (API Change) ['Actions Required] `string_param`, which was previously the argument type when setting field values - has been replaced by `string_view`. Because of this, it is no longer possible to + has been replaced by `core::string_view`. Because of this, it is no longer possible to set message field values directly as integrals. Users are requied to convert numeric arguments to a string type prior to calling `fields::set` et. al. diff --git a/example/doc/http_examples.hpp b/example/doc/http_examples.hpp index dac3e248b2..95e01f3f05 100644 --- a/example/doc/http_examples.hpp +++ b/example/doc/http_examples.hpp @@ -376,7 +376,7 @@ response do_head_request( SyncStream& stream, DynamicBuffer& buffer, - string_view target, + core::string_view target, error_code& ec) { // Do some type checking to be a good citizen @@ -978,9 +978,9 @@ print_chunked_body( // Declare our chunk header callback This is invoked // after each chunk header and also after the last chunk. auto header_cb = - [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk - string_view extensions, // The raw chunk-extensions string. Already validated. - error_code& ev) // We can set this to indicate an error + [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk + core::string_view extensions, // The raw chunk-extensions string. Already validated. + error_code& ev) // We can set this to indicate an error { // Parse the chunk extensions so we can access them easily ce.parse(extensions, ev); @@ -1007,9 +1007,9 @@ print_chunked_body( // Declare the chunk body callback. This is called one or // more times for each piece of a chunk body. auto body_cb = - [&](std::uint64_t remain, // The number of bytes left in this chunk - string_view body, // A buffer holding chunk body data - error_code& ec) // We can set this to indicate an error + [&](std::uint64_t remain, // The number of bytes left in this chunk + core::string_view body, // A buffer holding chunk body data + error_code& ec) // We can set this to indicate an error { // If this is the last piece of the chunk body, // set the error so that the call to `read` returns diff --git a/include/boost/beast/_experimental/test/impl/stream.ipp b/include/boost/beast/_experimental/test/impl/stream.ipp index 82395ba140..790c17df07 100644 --- a/include/boost/beast/_experimental/test/impl/stream.ipp +++ b/include/boost/beast/_experimental/test/impl/stream.ipp @@ -123,7 +123,7 @@ template basic_stream:: basic_stream( net::io_context& ioc, - string_view s) + core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), nullptr)) { in_->b.commit(net::buffer_copy( @@ -136,7 +136,7 @@ basic_stream:: basic_stream( net::io_context& ioc, fail_count& fc, - string_view s) + core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), &fc)) { in_->b.commit(net::buffer_copy( @@ -161,7 +161,7 @@ connect(basic_stream& remote) } template -string_view +core::string_view basic_stream:: str() const { @@ -175,7 +175,7 @@ str() const template void basic_stream:: -append(string_view s) +append(core::string_view s) { std::lock_guard lock{in_->m}; in_->b.commit(net::buffer_copy( diff --git a/include/boost/beast/_experimental/test/stream.hpp b/include/boost/beast/_experimental/test/stream.hpp index 4afc79e10b..a7689b3e7b 100644 --- a/include/boost/beast/_experimental/test/stream.hpp +++ b/include/boost/beast/_experimental/test/stream.hpp @@ -281,7 +281,7 @@ class basic_stream */ basic_stream( net::io_context& ioc, - string_view s); + core::string_view s); /** Construct a stream @@ -301,7 +301,7 @@ class basic_stream basic_stream( net::io_context& ioc, fail_count& fc, - string_view s); + core::string_view s); /// Establish a connection void @@ -333,12 +333,12 @@ class basic_stream } /// Returns a string view representing the pending input data - string_view + core::string_view str() const; /// Appends a string to the pending input data void - append(string_view s); + append(core::string_view s); /// Clear the pending input area void diff --git a/include/boost/beast/core/detail/impl/temporary_buffer.ipp b/include/boost/beast/core/detail/impl/temporary_buffer.ipp index 932e847371..9ea06be1a5 100644 --- a/include/boost/beast/core/detail/impl/temporary_buffer.ipp +++ b/include/boost/beast/core/detail/impl/temporary_buffer.ipp @@ -23,7 +23,7 @@ namespace detail { void temporary_buffer:: -append(string_view s) +append(core::string_view s) { grow(s.size()); unchecked_append(s); @@ -31,7 +31,7 @@ append(string_view s) void temporary_buffer:: -append(string_view s1, string_view s2) +append(core::string_view s1, core::string_view s2) { grow(s1.size() + s2.size()); unchecked_append(s1); @@ -40,7 +40,7 @@ append(string_view s1, string_view s2) void temporary_buffer:: -unchecked_append(string_view s) +unchecked_append(core::string_view s) { auto n = s.size(); std::memcpy(&data_[size_], s.data(), n); diff --git a/include/boost/beast/core/detail/static_ostream.hpp b/include/boost/beast/core/detail/static_ostream.hpp index 5eaa413b30..22014b6175 100644 --- a/include/boost/beast/core/detail/static_ostream.hpp +++ b/include/boost/beast/core/detail/static_ostream.hpp @@ -50,7 +50,7 @@ class static_ostream_buffer { } - string_view + core::string_view str() const { if(! s_.empty()) @@ -128,7 +128,7 @@ class static_ostream : public std::basic_ostream imbue(std::locale::classic()); } - string_view + core::string_view str() const { return osb_.str(); diff --git a/include/boost/beast/core/detail/string.hpp b/include/boost/beast/core/detail/string.hpp index fcaefb8822..bf7b059549 100644 --- a/include/boost/beast/core/detail/string.hpp +++ b/include/boost/beast/core/detail/string.hpp @@ -22,10 +22,10 @@ namespace detail { namespace string_literals { inline -string_view +core::string_view operator""_sv(char const* p, std::size_t n) { - return string_view{p, n}; + return core::string_view{p, n}; } } // string_literals diff --git a/include/boost/beast/core/detail/temporary_buffer.hpp b/include/boost/beast/core/detail/temporary_buffer.hpp index 8285b8f7eb..14526b1333 100644 --- a/include/boost/beast/core/detail/temporary_buffer.hpp +++ b/include/boost/beast/core/detail/temporary_buffer.hpp @@ -32,13 +32,13 @@ struct temporary_buffer BOOST_BEAST_DECL void - append(string_view s); + append(core::string_view s); BOOST_BEAST_DECL void - append(string_view s1, string_view s2); + append(core::string_view s1, core::string_view s2); - string_view + core::string_view view() const noexcept { return {data_, size_}; @@ -53,7 +53,7 @@ struct temporary_buffer private: BOOST_BEAST_DECL void - unchecked_append(string_view s); + unchecked_append(core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/core/impl/string.ipp b/include/boost/beast/core/impl/string.ipp index 7f0949eae4..62f9b07cfe 100644 --- a/include/boost/beast/core/impl/string.ipp +++ b/include/boost/beast/core/impl/string.ipp @@ -50,8 +50,8 @@ slow: bool iless::operator()( - string_view lhs, - string_view rhs) const + core::string_view lhs, + core::string_view rhs) const { using std::begin; using std::end; diff --git a/include/boost/beast/core/impl/string_param.hpp b/include/boost/beast/core/impl/string_param.hpp index 9d9278382a..4ec1028e33 100644 --- a/include/boost/beast/core/impl/string_param.hpp +++ b/include/boost/beast/core/impl/string_param.hpp @@ -30,7 +30,7 @@ print(T const& t) template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type string_param:: print(T const& t) @@ -44,7 +44,7 @@ print(T const& t) inline void string_param:: -print(string_view sv) +print(core::string_view sv) { sv_ = sv; } @@ -60,7 +60,7 @@ print_1(T const& t) auto const it = detail::raw_to_string< char, T, std::char_traits>( last, sizeof(buf), t); - *os_ << string_view{it, + *os_ << core::string_view{it, static_cast(last - it)}; } diff --git a/include/boost/beast/core/string.hpp b/include/boost/beast/core/string.hpp index 61883643f3..1dbec3172a 100644 --- a/include/boost/beast/core/string.hpp +++ b/include/boost/beast/core/string.hpp @@ -36,15 +36,15 @@ iequals( As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref string_view. + @ref core::string_view. */ struct iless { BOOST_BEAST_DECL bool operator()( - string_view lhs, - string_view rhs) const; + core::string_view lhs, + core::string_view rhs) const; using is_transparent = void; }; @@ -55,14 +55,14 @@ struct iless As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref string_view. + @ref core::string_view. */ struct iequal { bool operator()( - string_view lhs, - string_view rhs) const + core::string_view lhs, + core::string_view rhs) const { return iequals(lhs, rhs); } diff --git a/include/boost/beast/core/string_param.hpp b/include/boost/beast/core/string_param.hpp index 71e231c295..16f0edbc7a 100644 --- a/include/boost/beast/core/string_param.hpp +++ b/include/boost/beast/core/string_param.hpp @@ -43,7 +43,7 @@ namespace beast { */ class string_param { - string_view sv_; + core::string_view sv_; char buf_[128]; boost::optional os_; @@ -55,12 +55,12 @@ class string_param template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type print(T const&); void - print(string_view); + print(core::string_view); template typename std::enable_if< @@ -98,7 +98,7 @@ class string_param the result of streaming each argument in order into an output stream. It is used as a notational convenience at call sites which expect a parameter with the semantics - of a @ref string_view. + of a @ref core::string_view. The implementation uses a small, internal static buffer to avoid memory allocations especially for the case where @@ -111,14 +111,14 @@ class string_param string_param(Args const&... args); /// Returns the contained string - string_view + core::string_view str() const { return sv_; } - /// Implicit conversion to @ref string_view - operator string_view const() const + /// Implicit conversion to @ref core::string_view + operator core::string_view const() const { return sv_; } diff --git a/include/boost/beast/core/string_type.hpp b/include/boost/beast/core/string_type.hpp index 4bc6e5c67f..5c09c7172d 100644 --- a/include/boost/beast/core/string_type.hpp +++ b/include/boost/beast/core/string_type.hpp @@ -16,19 +16,11 @@ namespace boost { namespace beast { -/// The type of string view used by the library -using string_view = boost::core::string_view; - -/// The type of `basic_string_view` used by the library -template -using basic_string_view = - boost::core::basic_string_view; - template -inline string_view +inline core::string_view to_string_view(const S& s) { - return string_view(s.data(), s.size()); + return core::string_view(s.data(), s.size()); } } // beast diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index b84de80520..392d25bbcb 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -461,8 +461,8 @@ class basic_parser void on_request_impl( verb method, - string_view method_str, - string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec) = 0; @@ -488,7 +488,7 @@ class basic_parser void on_response_impl( int code, - string_view reason, + core::string_view reason, int version, error_code& ec) = 0; @@ -512,8 +512,8 @@ class basic_parser void on_field_impl( field name, - string_view name_string, - string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) = 0; /** Called once for each complete field in the HTTP trailer header. @@ -536,8 +536,8 @@ class basic_parser void on_trailer_field_impl( field name, - string_view name_string, - string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) = 0; /** Called once after the complete HTTP header is received. @@ -587,7 +587,7 @@ class basic_parser virtual std::size_t on_body_impl( - string_view body, + core::string_view body, error_code& ec) = 0; /** Called each time a new chunk header of a chunk encoded body is received. @@ -607,7 +607,7 @@ class basic_parser void on_chunk_header_impl( std::uint64_t size, - string_view extensions, + core::string_view extensions, error_code& ec) = 0; /** Called each time additional data is received representing part of a body chunk. @@ -636,7 +636,7 @@ class basic_parser std::size_t on_chunk_body_impl( std::uint64_t remain, - string_view body, + core::string_view body, error_code& ec) = 0; /** Called once when the complete message is received. @@ -714,7 +714,7 @@ class basic_parser void do_field(field f, - string_view value, error_code& ec); + core::string_view value, error_code& ec); }; } // http diff --git a/include/boost/beast/http/chunk_encode.hpp b/include/boost/beast/http/chunk_encode.hpp index 8b8ff651c7..d46a392eae 100644 --- a/include/boost/beast/http/chunk_encode.hpp +++ b/include/boost/beast/http/chunk_encode.hpp @@ -154,7 +154,7 @@ class chunk_header */ chunk_header( std::size_t size, - string_view extensions); + core::string_view extensions); /** Constructor @@ -169,7 +169,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -202,7 +202,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -342,7 +342,7 @@ class chunk_body */ chunk_body( ConstBufferSequence const& buffers, - string_view extensions); + core::string_view extensions); /** Constructor @@ -360,7 +360,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -373,7 +373,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, string_view>::value>::type + ChunkExtensions>::type, core::string_view>::value>::type #endif > chunk_body( @@ -396,7 +396,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -412,7 +412,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, string_view>::value>::type + ChunkExtensions>::type, core::string_view>::value>::type #endif > chunk_body( @@ -582,7 +582,7 @@ class basic_chunk_extensions do_parse(FwdIt it, FwdIt last, error_code& ec); void - do_insert(string_view name, string_view value); + do_insert(core::string_view name, core::string_view value); public: /** The type of value when iterating. @@ -591,7 +591,7 @@ class basic_chunk_extensions element is the value which may be empty. The value is stored in its raw representation, without quotes or escapes. */ - using value_type = std::pair; + using value_type = std::pair; class const_iterator; @@ -630,14 +630,14 @@ class basic_chunk_extensions Any previous extensions will be cleared */ void - parse(string_view s, error_code& ec); + parse(core::string_view s, error_code& ec); /** Insert an extension name with an empty value @param name The name of the extension */ void - insert(string_view name); + insert(core::string_view name); /** Insert an extension value @@ -647,10 +647,10 @@ class basic_chunk_extensions contents, the serialized extension may use a quoted string. */ void - insert(string_view name, string_view value); + insert(core::string_view name, core::string_view value); /// Return the serialized representation of the chunk extension - string_view + core::string_view str() const { return s_; diff --git a/include/boost/beast/http/detail/basic_parsed_list.hpp b/include/boost/beast/http/detail/basic_parsed_list.hpp index 53ce60976d..764271e3d3 100644 --- a/include/boost/beast/http/detail/basic_parsed_list.hpp +++ b/include/boost/beast/http/detail/basic_parsed_list.hpp @@ -25,7 +25,7 @@ namespace detail { template class basic_parsed_list { - string_view s_; + core::string_view s_; public: /// The type of policy this list uses for parsing. @@ -130,7 +130,7 @@ class basic_parsed_list /// Construct a list from a string explicit - basic_parsed_list(string_view s) + basic_parsed_list(core::string_view s) : s_(s) { } diff --git a/include/boost/beast/http/detail/basic_parser.hpp b/include/boost/beast/http/detail/basic_parser.hpp index 5fa25333f8..c998bb2a5b 100644 --- a/include/boost/beast/http/detail/basic_parser.hpp +++ b/include/boost/beast/http/detail/basic_parser.hpp @@ -74,7 +74,7 @@ struct basic_parser_base char const* it, char const* first); static - string_view + core::string_view make_string(char const* first, char const* last) { return {first, static_cast< @@ -123,7 +123,7 @@ struct basic_parser_base BOOST_BEAST_DECL static bool - parse_dec(string_view s, std::uint64_t& v); + parse_dec(core::string_view s, std::uint64_t& v); BOOST_BEAST_DECL static @@ -140,14 +140,14 @@ struct basic_parser_base void parse_method( char const*& it, char const* last, - string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static void parse_target( char const*& it, char const* last, - string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -168,7 +168,7 @@ struct basic_parser_base void parse_reason( char const*& it, char const* last, - string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -176,8 +176,8 @@ struct basic_parser_base parse_field( char const*& p, char const* last, - string_view& name, - string_view& value, + core::string_view& name, + core::string_view& value, beast::detail::char_buffer& buf, error_code& ec); diff --git a/include/boost/beast/http/detail/basic_parser.ipp b/include/boost/beast/http/detail/basic_parser.ipp index 117fd36a38..105468d1e0 100644 --- a/include/boost/beast/http/detail/basic_parser.ipp +++ b/include/boost/beast/http/detail/basic_parser.ipp @@ -155,7 +155,7 @@ find_eol( bool basic_parser_base:: parse_dec( - string_view s, + core::string_view s, std::uint64_t& v) { char const* it = s.data(); @@ -271,7 +271,7 @@ void basic_parser_base:: parse_method( char const*& it, char const* last, - string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { // parse token SP auto const first = it; @@ -308,7 +308,7 @@ void basic_parser_base:: parse_target( char const*& it, char const* last, - string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { // parse target SP auto const first = it; @@ -437,7 +437,7 @@ void basic_parser_base:: parse_reason( char const*& it, char const* last, - string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { auto const first = it; char const* token_last = nullptr; @@ -459,8 +459,8 @@ basic_parser_base:: parse_field( char const*& p, char const* last, - string_view& name, - string_view& value, + core::string_view& name, + core::string_view& value, beast::detail::char_buffer& buf, error_code& ec) { diff --git a/include/boost/beast/http/detail/chunk_encode.hpp b/include/boost/beast/http/detail/chunk_encode.hpp index fe38e7a6c8..dba405d2ec 100644 --- a/include/boost/beast/http/detail/chunk_encode.hpp +++ b/include/boost/beast/http/detail/chunk_encode.hpp @@ -56,7 +56,7 @@ struct is_chunk_extensions : std::false_type {}; template struct is_chunk_extensions() = std::declval().str() + std::declval() = std::declval().str() )>> : std::true_type { }; diff --git a/include/boost/beast/http/detail/rfc7230.hpp b/include/boost/beast/http/detail/rfc7230.hpp index 1699f0c7f3..91c5c7504e 100644 --- a/include/boost/beast/http/detail/rfc7230.hpp +++ b/include/boost/beast/http/detail/rfc7230.hpp @@ -58,8 +58,8 @@ std::int8_t unhex(char c); BOOST_BEAST_DECL -string_view -trim(string_view s); +core::string_view +trim(core::string_view s); struct param_iter { @@ -68,7 +68,7 @@ struct param_iter iter_type it; iter_type first; iter_type last; - std::pair v; + std::pair v; bool empty() const @@ -86,12 +86,12 @@ struct param_iter */ struct opt_token_list_policy { - using value_type = string_view; + using value_type = core::string_view; BOOST_BEAST_DECL bool operator()(value_type& v, - char const*& it, string_view s) const; + char const*& it, core::string_view s) const; }; } // detail diff --git a/include/boost/beast/http/detail/rfc7230.ipp b/include/boost/beast/http/detail/rfc7230.ipp index 3efa1032a4..144e1883b3 100644 --- a/include/boost/beast/http/detail/rfc7230.ipp +++ b/include/boost/beast/http/detail/rfc7230.ipp @@ -239,8 +239,8 @@ skip_token(ForwardIt& it, ForwardIt last) ++it; } -string_view -trim(string_view s) +core::string_view +trim(core::string_view s) { auto first = s.begin(); auto last = s.end(); @@ -344,7 +344,7 @@ increment() bool opt_token_list_policy::operator()(value_type& v, - char const*& it, string_view s) const + char const*& it, core::string_view s) const { v = {}; auto need_comma = it != s.data(); @@ -370,7 +370,7 @@ opt_token_list_policy::operator()(value_type& v, if(! detail::is_token_char(*it)) break; } - v = string_view{p0, + v = core::string_view{p0, static_cast(it - p0)}; return true; } diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index a9b5d64088..ee2a483164 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -45,20 +45,20 @@ struct fields_model { struct writer; - string_view method() const; - string_view reason() const; - string_view target() const; + core::string_view method() const; + core::string_view reason() const; + core::string_view target() const; protected: - string_view get_method_impl() const; - string_view get_target_impl() const; - string_view get_reason_impl() const; + core::string_view get_method_impl() const; + core::string_view get_target_impl() const; + core::string_view get_reason_impl() const; bool get_chunked_impl() const; bool get_keep_alive_impl(unsigned) const; bool has_content_length_impl() const; - void set_method_impl(string_view); - void set_target_impl(string_view); - void set_reason_impl(string_view); + void set_method_impl(core::string_view); + void set_target_impl(core::string_view); + void set_reason_impl(core::string_view); void set_chunked_impl(bool); void set_content_length_impl(boost::optional); void set_keep_alive_impl(unsigned, bool); @@ -93,21 +93,21 @@ struct is_fields_helper : T { template static auto f1(int) -> decltype( - std::declval() = std::declval().get_method_impl(), + std::declval() = std::declval().get_method_impl(), std::true_type()); static auto f1(...) -> std::false_type; using t1 = decltype(f1(0)); template static auto f2(int) -> decltype( - std::declval() = std::declval().get_target_impl(), + std::declval() = std::declval().get_target_impl(), std::true_type()); static auto f2(...) -> std::false_type; using t2 = decltype(f2(0)); template static auto f3(int) -> decltype( - std::declval() = std::declval().get_reason_impl(), + std::declval() = std::declval().get_reason_impl(), std::true_type()); static auto f3(...) -> std::false_type; using t3 = decltype(f3(0)); @@ -136,21 +136,21 @@ struct is_fields_helper : T template static auto f7(int) -> decltype( - void(std::declval().set_method_impl(std::declval())), + void(std::declval().set_method_impl(std::declval())), std::true_type()); static auto f7(...) -> std::false_type; using t7 = decltype(f7(0)); template static auto f8(int) -> decltype( - void(std::declval().set_target_impl(std::declval())), + void(std::declval().set_target_impl(std::declval())), std::true_type()); static auto f8(...) -> std::false_type; using t8 = decltype(f8(0)); template static auto f9(int) -> decltype( - void(std::declval().set_reason_impl(std::declval())), + void(std::declval().set_reason_impl(std::declval())), std::true_type()); static auto f9(...) -> std::false_type; using t9 = decltype(f9(0)); diff --git a/include/boost/beast/http/field.hpp b/include/boost/beast/http/field.hpp index 62a89ec540..6fad94ab4f 100644 --- a/include/boost/beast/http/field.hpp +++ b/include/boost/beast/http/field.hpp @@ -157,7 +157,7 @@ namespace http { @param f The field to convert */ BOOST_BEAST_DECL -string_view +core::string_view to_string(field f); /** Attempt to convert a string to a field enum. @@ -169,7 +169,7 @@ to_string(field f); */ BOOST_BEAST_DECL field -string_to_field(string_view s); +string_to_field(core::string_view s); /// Write the text for a field name to an output stream. BOOST_BEAST_DECL diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 8dd92a44a7..0412cb8c72 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -91,7 +91,7 @@ class basic_fields protected: value_type(field name, - string_view sname, string_view value); + core::string_view sname, core::string_view value); public: /// Constructor (deleted) @@ -105,11 +105,11 @@ class basic_fields name() const; /// Returns the field name as a string - string_view const + core::string_view const name_string() const; /// Returns the value of the field - string_view const + core::string_view const value() const; }; @@ -126,7 +126,7 @@ class basic_fields /// Returns `true` if lhs is less than rhs using a strict ordering bool operator()( - string_view lhs, + core::string_view lhs, value_type const& rhs) const noexcept { if(lhs.size() < rhs.name_string().size()) @@ -140,7 +140,7 @@ class basic_fields bool operator()( value_type const& lhs, - string_view rhs) const noexcept + core::string_view rhs) const noexcept { if(lhs.name_string().size() < rhs.size()) return true; @@ -181,7 +181,7 @@ class basic_fields , public value_type { element(field name, - string_view sname, string_view value); + core::string_view sname, core::string_view value); }; using list_t = typename boost::intrusive::make_list< @@ -327,7 +327,7 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - string_view const + core::string_view const at(field name) const; /** Returns the value for a field, or throws an exception. @@ -341,8 +341,8 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - string_view const - at(string_view name) const; + core::string_view const + at(core::string_view name) const; /** Returns the value for a field, or `""` if it does not exist. @@ -351,7 +351,7 @@ class basic_fields @param name The name of the field. */ - string_view const + core::string_view const operator[](field name) const; /** Returns the value for a case-insensitive matching header, or `""` if it does not exist. @@ -361,8 +361,8 @@ class basic_fields @param name The name of the field. It is interpreted as a case-insensitive string. */ - string_view const - operator[](string_view name) const; + core::string_view const + operator[](core::string_view name) const; //-------------------------------------------------------------------------- // @@ -450,7 +450,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, string_view value); + insert(field name, core::string_view value); void insert(field, std::nullptr_t) = delete; @@ -473,10 +473,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(string_view name, string_view value); + insert(core::string_view name, core::string_view value); void - insert(string_view, std::nullptr_t) = delete; + insert(core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -501,11 +501,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, string_view name_string, - string_view value); + insert(field name, core::string_view name_string, + core::string_view value); void - insert(field, string_view, std::nullptr_t) = delete; + insert(field, core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -530,11 +530,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, string_view name_string, - string_view value, error_code& ec); + insert(field name, core::string_view name_string, + core::string_view value, error_code& ec); void - insert(field, string_view, std::nullptr_t, error_code& ec) = delete; + insert(field, core::string_view, std::nullptr_t, error_code& ec) = delete; /** Set a field value, removing any other instances of that field. @@ -550,7 +550,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(field name, string_view value); + set(field name, core::string_view value); void set(field, std::nullptr_t) = delete; @@ -571,10 +571,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(string_view name, string_view value); + set(core::string_view name, core::string_view value); void - set(string_view, std::nullptr_t) = delete; + set(core::string_view, std::nullptr_t) = delete; /** Remove a field. @@ -619,7 +619,7 @@ class basic_fields @return The number of fields removed. */ std::size_t - erase(string_view name); + erase(core::string_view name); /** Return a buffer sequence representing the trailers. @@ -659,7 +659,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ bool - contains(string_view name) const; + contains(core::string_view name) const; /** Return the number of fields with the specified name. @@ -673,7 +673,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ std::size_t - count(string_view name) const; + count(core::string_view name) const; /** Returns an iterator to the case-insensitive matching field. @@ -699,7 +699,7 @@ class basic_fields no match was found. */ const_iterator - find(string_view name) const; + find(core::string_view name) const; /** Returns a range of iterators to the fields with the specified name. @@ -721,7 +721,7 @@ class basic_fields /// @copydoc boost::beast::http::basic_fields::equal_range(boost::beast::http::field) const std::pair - equal_range(string_view name) const; + equal_range(core::string_view name) const; //-------------------------------------------------------------------------- // @@ -741,21 +741,21 @@ class basic_fields @note Only called for requests. */ - string_view + core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - string_view + core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - string_view + core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -778,21 +778,21 @@ class basic_fields @note Only called for requests. */ void - set_method_impl(string_view s); + set_method_impl(core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(string_view s); + set_target_impl(core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(string_view s); + set_reason_impl(core::string_view s); /** Adjusts the chunked Transfer-Encoding value */ @@ -818,15 +818,15 @@ class basic_fields element* try_create_new_element( field name, - string_view sname, - string_view value, + core::string_view sname, + core::string_view value, error_code& ec); element& new_element( field name, - string_view sname, - string_view value); + core::string_view sname, + core::string_view value); void insert_element(element& e); @@ -838,11 +838,11 @@ class basic_fields set_element(element& e); void - realloc_string(string_view& dest, string_view s); + realloc_string(core::string_view& dest, core::string_view s); void realloc_target( - string_view& dest, string_view s); + core::string_view& dest, core::string_view s); template void @@ -874,8 +874,8 @@ class basic_fields set_t set_; list_t list_; - string_view method_; - string_view target_or_reason_; + core::string_view method_; + core::string_view target_or_reason_; }; #if BOOST_BEAST_DOXYGEN diff --git a/include/boost/beast/http/impl/basic_parser.ipp b/include/boost/beast/http/impl/basic_parser.ipp index 9a6fcb13fa..6d918aba82 100644 --- a/include/boost/beast/http/impl/basic_parser.ipp +++ b/include/boost/beast/http/impl/basic_parser.ipp @@ -236,12 +236,12 @@ inner_parse_start_line( */ auto p = in; - string_view method; + core::string_view method; parse_method(p, last, method, ec); if(ec) return; - string_view target; + core::string_view target; parse_target(p, last, target, ec); if(ec) return; @@ -321,7 +321,7 @@ inner_parse_start_line( return; // parse reason CRLF - string_view reason; + core::string_view reason; parse_reason(p, last, reason, ec); if(ec) return; @@ -361,8 +361,8 @@ basic_parser:: inner_parse_fields(char const*& in, char const* last, error_code& ec) { - string_view name; - string_view value; + core::string_view name; + core::string_view value; // https://stackoverflow.com/questions/686217/maximum-on-http-header-values beast::detail::char_buffer buf; auto p = in; @@ -533,7 +533,7 @@ parse_body(char const*& p, std::size_t n, error_code& ec) { ec = {}; - n = this->on_body_impl(string_view{p, + n = this->on_body_impl(core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -561,7 +561,7 @@ parse_body_to_eof(char const*& p, *body_limit_ -= n; } ec = {}; - n = this->on_body_impl(string_view{p, n}, ec); + n = this->on_body_impl(core::string_view{p, n}, ec); p += n; if(ec) return; @@ -666,7 +666,7 @@ parse_chunk_body(char const*& p, { ec = {}; n = this->on_chunk_body_impl( - len_, string_view{p, + len_, core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -678,7 +678,7 @@ template void basic_parser:: do_field(field f, - string_view value, error_code& ec) + core::string_view value, error_code& ec) { using namespace beast::detail::string_literals; // Connection @@ -790,7 +790,7 @@ do_field(field f, ec = {}; auto const v = token_list{value}; auto const p = std::find_if(v.begin(), v.end(), - [&](string_view const& s) + [&](core::string_view const& s) { return beast::iequals("chunked"_sv, s); }); diff --git a/include/boost/beast/http/impl/chunk_encode.hpp b/include/boost/beast/http/impl/chunk_encode.hpp index b057571faf..704a2d4754 100644 --- a/include/boost/beast/http/impl/chunk_encode.hpp +++ b/include/boost/beast/http/impl/chunk_encode.hpp @@ -35,7 +35,7 @@ inline chunk_header:: chunk_header( std::size_t size, - string_view extensions) + core::string_view extensions) : view_( size, net::const_buffer{ @@ -102,7 +102,7 @@ template chunk_body:: chunk_body( ConstBufferSequence const& buffers, - string_view extensions) + core::string_view extensions) : view_( buffer_bytes(buffers), net::const_buffer{ @@ -311,10 +311,10 @@ operator*() -> using beast::detail::varint_read; auto it = it_; auto n = varint_read(it); - value_.first = string_view{it, n}; + value_.first = core::string_view{it, n}; it += n; n = varint_read(it); - value_.second = string_view{it, n}; + value_.second = core::string_view{it, n}; return value_; } @@ -560,7 +560,7 @@ do_parse(FwdIt it, FwdIt last, error_code& ec) template void basic_chunk_extensions:: -do_insert(string_view name, string_view value) +do_insert(core::string_view name, core::string_view value) { /* chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) @@ -623,7 +623,7 @@ do_insert(string_view name, string_view value) template void basic_chunk_extensions:: -parse(string_view s, error_code& ec) +parse(core::string_view s, error_code& ec) { do_parse(s.data(), s.data() + s.size(), ec); if(! ec) @@ -637,7 +637,7 @@ parse(string_view s, error_code& ec) template void basic_chunk_extensions:: -insert(string_view name) +insert(core::string_view name) { do_insert(name, {}); @@ -659,7 +659,7 @@ insert(string_view name) template void basic_chunk_extensions:: -insert(string_view name, string_view value) +insert(core::string_view name, core::string_view value) { do_insert(name, value); diff --git a/include/boost/beast/http/impl/field.ipp b/include/boost/beast/http/impl/field.ipp index 09da20f414..fc1089c6a3 100644 --- a/include/boost/beast/http/impl/field.ipp +++ b/include/boost/beast/http/impl/field.ipp @@ -42,12 +42,12 @@ struct field_table } using array_type = - std::array; + std::array; // Strings are converted to lowercase static std::uint32_t - digest(string_view s) + digest(core::string_view s) { std::uint32_t r = 0; std::size_t n = s.size(); @@ -77,7 +77,7 @@ struct field_table // strings must contain only valid http field characters. static bool - equals(string_view lhs, string_view rhs) + equals(core::string_view lhs, core::string_view rhs) { using Int = std::uint32_t; // VFALCO std::size_t? auto n = lhs.size(); @@ -257,7 +257,7 @@ struct field_table } field - string_to_field(string_view s) const + string_to_field(core::string_view s) const { auto h = digest(s); auto j = h % N; @@ -302,7 +302,7 @@ get_field_table() } BOOST_BEAST_DECL -string_view +core::string_view to_string(field f) { auto const& v = get_field_table(); @@ -312,14 +312,14 @@ to_string(field f) } // detail -string_view +core::string_view to_string(field f) { return detail::to_string(f); } field -string_to_field(string_view s) +string_to_field(core::string_view s) { return detail::get_field_table().string_to_field(s); } diff --git a/include/boost/beast/http/impl/fields.hpp b/include/boost/beast/http/impl/fields.hpp index b42a3ccdd0..c387ab966c 100644 --- a/include/boost/beast/http/impl/fields.hpp +++ b/include/boost/beast/http/impl/fields.hpp @@ -192,7 +192,7 @@ writer(basic_fields const& f, " " " HTTP/X.Y\r\n" (11 chars) */ - string_view sv; + core::string_view sv; if(v == verb::unknown) sv = f_.get_method_impl(); else @@ -248,7 +248,7 @@ writer(basic_fields const& f, buf_[11]= '0' + static_cast(code % 10); buf_[12]= ' '; - string_view sv; + core::string_view sv; if(! f_.target_or_reason_.empty()) sv = f_.target_or_reason_; else @@ -289,7 +289,7 @@ template basic_fields:: value_type:: value_type(field name, - string_view sname, string_view value) + core::string_view sname, core::string_view value) : off_(static_cast(sname.size() + 2)) , len_(static_cast(value.size())) , f_(name) @@ -315,7 +315,7 @@ name() const } template -string_view const +core::string_view const basic_fields:: value_type:: name_string() const @@ -325,7 +325,7 @@ name_string() const } template -string_view const +core::string_view const basic_fields:: value_type:: value() const @@ -338,7 +338,7 @@ template basic_fields:: element:: element(field name, - string_view sname, string_view value) + core::string_view sname, core::string_view value) : value_type(name, sname, value) { } @@ -470,7 +470,7 @@ operator=(basic_fields const& other) -> //------------------------------------------------------------------------------ template -string_view const +core::string_view const basic_fields:: at(field name) const { @@ -483,9 +483,9 @@ at(field name) const } template -string_view const +core::string_view const basic_fields:: -at(string_view name) const +at(core::string_view name) const { auto const it = find(name); if(it == end()) @@ -495,7 +495,7 @@ at(string_view name) const } template -string_view const +core::string_view const basic_fields:: operator[](field name) const { @@ -507,9 +507,9 @@ operator[](field name) const } template -string_view const +core::string_view const basic_fields:: -operator[](string_view name) const +operator[](core::string_view name) const { auto const it = find(name); if(it == end()) @@ -537,7 +537,7 @@ template inline void basic_fields:: -insert(field name, string_view value) +insert(field name, core::string_view value) { BOOST_ASSERT(name != field::unknown); insert(name, to_string(name), value); @@ -546,7 +546,7 @@ insert(field name, string_view value) template void basic_fields:: -insert(string_view sname, string_view value) +insert(core::string_view sname, core::string_view value) { insert( string_to_field(sname), sname, value); @@ -557,8 +557,8 @@ void basic_fields:: insert( field name, - string_view sname, - string_view value, + core::string_view sname, + core::string_view value, error_code& ec) { ec = {}; @@ -572,7 +572,7 @@ template void basic_fields:: insert(field name, - string_view sname, string_view value) + core::string_view sname, core::string_view value) { insert_element( new_element(name, sname, value)); @@ -581,7 +581,7 @@ insert(field name, template void basic_fields:: -set(field name, string_view value) +set(field name, core::string_view value) { BOOST_ASSERT(name != field::unknown); set_element( @@ -591,7 +591,7 @@ set(field name, string_view value) template void basic_fields:: -set(string_view sname, string_view value) +set(core::string_view sname, core::string_view value) { set_element(new_element( string_to_field(sname), sname, value)); @@ -623,7 +623,7 @@ erase(field name) template std::size_t basic_fields:: -erase(string_view name) +erase(core::string_view name) { std::size_t n =0; set_.erase_and_dispose(name, key_compare{}, @@ -672,7 +672,7 @@ contains(field name) const template bool basic_fields:: -contains(string_view name) const +contains(core::string_view name) const { return find(name) != end(); } @@ -690,7 +690,7 @@ count(field name) const template std::size_t basic_fields:: -count(string_view name) const +count(core::string_view name) const { return set_.count(name, key_compare{}); } @@ -709,7 +709,7 @@ find(field name) const -> template auto basic_fields:: -find(string_view name) const -> +find(core::string_view name) const -> const_iterator { auto const it = set_.find( @@ -733,7 +733,7 @@ equal_range(field name) const -> template auto basic_fields:: -equal_range(string_view name) const -> +equal_range(core::string_view name) const -> std::pair { auto result = @@ -752,13 +752,13 @@ namespace detail { struct iequals_predicate { bool - operator()(string_view s) const + operator()(core::string_view s) const { return beast::iequals(s, sv1) || beast::iequals(s, sv2); } - string_view sv1; - string_view sv2; + core::string_view sv1; + core::string_view sv2; }; // Filter the last item in a token list @@ -766,13 +766,13 @@ BOOST_BEAST_DECL void filter_token_list_last( beast::detail::temporary_buffer& s, - string_view value, + core::string_view value, iequals_predicate const& pred); BOOST_BEAST_DECL void keep_alive_impl( - beast::detail::temporary_buffer& s, string_view value, + beast::detail::temporary_buffer& s, core::string_view value, unsigned version, bool keep_alive); } // detail @@ -783,7 +783,7 @@ keep_alive_impl( template inline -string_view +core::string_view basic_fields:: get_method_impl() const { @@ -792,7 +792,7 @@ get_method_impl() const template inline -string_view +core::string_view basic_fields:: get_target_impl() const { @@ -805,7 +805,7 @@ get_target_impl() const template inline -string_view +core::string_view basic_fields:: get_reason_impl() const { @@ -860,7 +860,7 @@ template inline void basic_fields:: -set_method_impl(string_view s) +set_method_impl(core::string_view s) { realloc_string(method_, s); } @@ -869,7 +869,7 @@ template inline void basic_fields:: -set_target_impl(string_view s) +set_target_impl(core::string_view s) { realloc_target( target_or_reason_, s); @@ -879,7 +879,7 @@ template inline void basic_fields:: -set_reason_impl(string_view s) +set_reason_impl(core::string_view s) { realloc_string( target_or_reason_, s); @@ -967,8 +967,8 @@ auto basic_fields:: try_create_new_element( field name, - string_view sname, - string_view value, + core::string_view sname, + core::string_view value, error_code& ec) -> element* { if(sname.size() > max_name_size) @@ -998,8 +998,8 @@ auto basic_fields:: new_element( field name, - string_view sname, - string_view value) -> element& + core::string_view sname, + core::string_view value) -> element& { error_code ec; auto* e = try_create_new_element(name, sname, value, ec); @@ -1083,7 +1083,7 @@ set_element(element& e) template void basic_fields:: -realloc_string(string_view& dest, string_view s) +realloc_string(core::string_view& dest, core::string_view s) { if(dest.empty() && s.empty()) return; @@ -1109,7 +1109,7 @@ template void basic_fields:: realloc_target( - string_view& dest, string_view s) + core::string_view& dest, core::string_view s) { // The target string are stored with an // extra space at the beginning to help diff --git a/include/boost/beast/http/impl/fields.ipp b/include/boost/beast/http/impl/fields.ipp index 487f052835..8450b90576 100644 --- a/include/boost/beast/http/impl/fields.ipp +++ b/include/boost/beast/http/impl/fields.ipp @@ -29,7 +29,7 @@ inline void filter_token_list( beast::detail::temporary_buffer& s, - string_view value, + core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -53,7 +53,7 @@ filter_token_list( void filter_token_list_last( beast::detail::temporary_buffer& s, - string_view value, + core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -87,7 +87,7 @@ filter_token_list_last( void keep_alive_impl( - beast::detail::temporary_buffer& s, string_view value, + beast::detail::temporary_buffer& s, core::string_view value, unsigned version, bool keep_alive) { if(version < 11) diff --git a/include/boost/beast/http/impl/message.hpp b/include/boost/beast/http/impl/message.hpp index 4b101ad3b9..27cc3b6e6f 100644 --- a/include/boost/beast/http/impl/message.hpp +++ b/include/boost/beast/http/impl/message.hpp @@ -49,7 +49,7 @@ method(verb v) } template -string_view +core::string_view header:: method_string() const { @@ -61,7 +61,7 @@ method_string() const template void header:: -method_string(string_view s) +method_string(core::string_view s) { method_ = string_to_verb(s); if(method_ != verb::unknown) @@ -71,7 +71,7 @@ method_string(string_view s) } template -string_view +core::string_view header:: target() const { @@ -81,7 +81,7 @@ target() const template void header:: -target(string_view s) +target(core::string_view s) { this->set_target_impl(s); } @@ -149,7 +149,7 @@ result_int() const } template -string_view +core::string_view header:: reason() const { @@ -162,7 +162,7 @@ reason() const template void header:: -reason(string_view s) +reason(core::string_view s) { this->set_reason_impl(s); } @@ -208,7 +208,7 @@ message(header_type const& h, BodyArgs&&... body_args) template template message:: -message(verb method, string_view target, Version version) +message(verb method, core::string_view target, Version version) : header_type(method, target, version) { } @@ -216,7 +216,7 @@ message(verb method, string_view target, Version version) template template message:: -message(verb method, string_view target, +message(verb method, core::string_view target, Version version, BodyArg&& body_arg) : header_type(method, target, version) , boost::empty_value< @@ -229,7 +229,7 @@ template template message:: message( - verb method, string_view target, Version version, + verb method, core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg) : header_type(method, target, version, diff --git a/include/boost/beast/http/impl/rfc7230.hpp b/include/boost/beast/http/impl/rfc7230.hpp index 2310cec8ef..d8bd25fa2b 100644 --- a/include/boost/beast/http/impl/rfc7230.hpp +++ b/include/boost/beast/http/impl/rfc7230.hpp @@ -89,7 +89,7 @@ class param_list::const_iterator BOOST_BEAST_DECL static void - unquote(string_view sr, std::string & s); + unquote(core::string_view sr, std::string & s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/http/impl/rfc7230.ipp b/include/boost/beast/http/impl/rfc7230.ipp index 5bb0372e95..a060ece23d 100644 --- a/include/boost/beast/http/impl/rfc7230.ipp +++ b/include/boost/beast/http/impl/rfc7230.ipp @@ -19,7 +19,7 @@ namespace http { void param_list::const_iterator:: -unquote(string_view sr, std::string &s) +unquote(core::string_view sr, std::string &s) { s.clear(); s.reserve(sr.size()); @@ -49,7 +49,7 @@ increment() pi_.v.second.front() == '"') { unquote(pi_.v.second, s_); - pi_.v.second = string_view{ + pi_.v.second = core::string_view{ s_.data(), s_.size()}; } } @@ -96,7 +96,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_.first = string_view{&*p0, + v_.first = core::string_view{&*p0, static_cast(it_ - p0)}; if (it_ == last_) return; @@ -110,7 +110,7 @@ increment() if(pi.empty()) break; } - v_.second = param_list{string_view{&*it_, + v_.second = param_list{core::string_view{&*it_, static_cast(pi.it - it_)}}; it_ = pi.it; return; @@ -124,7 +124,7 @@ increment() auto ext_list:: -find(string_view const& s) -> const_iterator +find(core::string_view const& s) -> const_iterator { return std::find_if(begin(), end(), [&s](value_type const& v) @@ -135,7 +135,7 @@ find(string_view const& s) -> const_iterator bool ext_list:: -exists(string_view const& s) +exists(core::string_view const& s) { return find(s) != end(); } @@ -175,7 +175,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_ = string_view{&*p0, + v_ = core::string_view{&*p0, static_cast(it_ - p0)}; return; } @@ -188,7 +188,7 @@ increment() bool token_list:: -exists(string_view const& s) +exists(core::string_view const& s) { return std::find_if(begin(), end(), [&s](value_type const& v) diff --git a/include/boost/beast/http/impl/status.ipp b/include/boost/beast/http/impl/status.ipp index 61bcdbe1ce..7071f198f2 100644 --- a/include/boost/beast/http/impl/status.ipp +++ b/include/boost/beast/http/impl/status.ipp @@ -127,7 +127,7 @@ to_status_class(status v) return to_status_class(static_cast(v)); } -string_view +core::string_view obsolete_reason(status v) { switch(static_cast(v)) diff --git a/include/boost/beast/http/impl/verb.ipp b/include/boost/beast/http/impl/verb.ipp index 988f1b9430..24017da411 100644 --- a/include/boost/beast/http/impl/verb.ipp +++ b/include/boost/beast/http/impl/verb.ipp @@ -18,7 +18,7 @@ namespace boost { namespace beast { namespace http { -string_view +core::string_view to_string(verb v) { using namespace beast::detail::string_literals; @@ -72,7 +72,7 @@ to_string(verb v) } verb -string_to_verb(string_view v) +string_to_verb(core::string_view v) { /* ACL diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index 3c75ac26fe..ead1291e1e 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -149,7 +149,7 @@ class header : public Fields @see method */ - string_view + core::string_view method_string() const; /** Set the request-method. @@ -163,7 +163,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - method_string(string_view s); + method_string(core::string_view s); /** Returns the request-target string. @@ -174,7 +174,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ - string_view + core::string_view target() const; /** Set the request-target string. @@ -190,7 +190,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - target(string_view s); + target(core::string_view s); // VFALCO Don't rearrange these declarations or // ifdefs, or else the documentation will break. @@ -235,7 +235,7 @@ class header : public Fields template header( verb method, - string_view target_, + core::string_view target_, unsigned version_value, FieldsArgs&&... fields_args) : Fields(std::forward(fields_args)...) @@ -390,7 +390,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ - string_view + core::string_view reason() const; /** Set the response reason-phrase (deprecated) @@ -412,7 +412,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ void - reason(string_view s); + reason(core::string_view s); private: #if ! BOOST_BEAST_DOXYGEN @@ -557,12 +557,12 @@ class message @note This function is only available when `isRequest == true`. */ #if BOOST_BEAST_DOXYGEN - message(verb method, string_view target, unsigned version); + message(verb method, core::string_view target, unsigned version); #else template::value>::type> - message(verb method, string_view target, Version version); + message(verb method, core::string_view target, Version version); #endif /** Constructor @@ -579,13 +579,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, string_view target, + message(verb method, core::string_view target, unsigned version, BodyArg&& body_arg); #else template::value>::type> - message(verb method, string_view target, + message(verb method, core::string_view target, Version version, BodyArg&& body_arg); #endif @@ -605,13 +605,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, string_view target, unsigned version, + message(verb method, core::string_view target, unsigned version, BodyArg&& body_arg, FieldsArg&& fields_arg); #else template::value>::type> - message(verb method, string_view target, Version version, + message(verb method, core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg); #endif diff --git a/include/boost/beast/http/message_generator.hpp b/include/boost/beast/http/message_generator.hpp index b81184b901..f77c1a1c8a 100644 --- a/include/boost/beast/http/message_generator.hpp +++ b/include/boost/beast/http/message_generator.hpp @@ -34,7 +34,7 @@ namespace http { @code template http::message_generator handle_request( - string_view doc_root, + core::string_view doc_root, http::request&& request); @endcode diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index 3e00a15ea6..4eb60281ed 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -76,12 +76,12 @@ class parser std::function cb_h_; std::function cb_b_; public: @@ -225,7 +225,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t size, string_view extensions, error_code& ec) + [](std::uint64_t size, core::string_view extensions, error_code& ec) { //... }; @@ -238,7 +238,7 @@ class parser void on_chunk_header( std::uint64_t size, // Size of the chunk, zero for the last chunk - string_view extensions, // The chunk-extensions in raw form + core::string_view extensions, // The chunk-extensions in raw form error_code& ec); // May be set by the callback to indicate an error @endcode */ @@ -273,7 +273,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t remain, string_view body, error_code& ec) + [](std::uint64_t remain, core::string_view body, error_code& ec) { //... }; @@ -286,7 +286,7 @@ class parser std::size_t on_chunk_header( std::uint64_t remain, // Octets remaining in this chunk, includes `body` - string_view body, // A buffer holding some or all of the remainder of the chunk body + core::string_view body, // A buffer holding some or all of the remainder of the chunk body error_code& ec); // May be set by the callback to indicate an error @endcode */ @@ -387,8 +387,8 @@ class parser void on_request_impl( verb method, - string_view method_str, - string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec, std::true_type) @@ -417,7 +417,7 @@ class parser void on_request_impl( - verb, string_view, string_view, + verb, core::string_view, core::string_view, int, error_code&, std::false_type) { } @@ -425,8 +425,8 @@ class parser void on_request_impl( verb method, - string_view method_str, - string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec) override { @@ -438,7 +438,7 @@ class parser void on_response_impl( int code, - string_view reason, + core::string_view reason, int version, error_code& ec, std::true_type) @@ -464,7 +464,7 @@ class parser void on_response_impl( - int, string_view, int, + int, core::string_view, int, error_code&, std::false_type) { } @@ -472,7 +472,7 @@ class parser void on_response_impl( int code, - string_view reason, + core::string_view reason, int version, error_code& ec) override { @@ -484,8 +484,8 @@ class parser void on_field_impl( field name, - string_view name_string, - string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) override { m_.insert(name, name_string, value, ec); @@ -494,8 +494,8 @@ class parser void on_trailer_field_impl( field name, - string_view name_string, - string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) override { if(! token_list{m_[field::trailer]}.exists(name_string)) @@ -538,7 +538,7 @@ class parser std::size_t on_body_impl( - string_view body, + core::string_view body, error_code& ec) override { return rd_.put(net::buffer( @@ -548,7 +548,7 @@ class parser void on_chunk_header_impl( std::uint64_t size, - string_view extensions, + core::string_view extensions, error_code& ec) override { if(cb_h_) @@ -558,7 +558,7 @@ class parser std::size_t on_chunk_body_impl( std::uint64_t remain, - string_view body, + core::string_view body, error_code& ec) override { if(cb_b_) diff --git a/include/boost/beast/http/rfc7230.hpp b/include/boost/beast/http/rfc7230.hpp index c83494e666..1f5ab7a51d 100644 --- a/include/boost/beast/http/rfc7230.hpp +++ b/include/boost/beast/http/rfc7230.hpp @@ -52,7 +52,7 @@ namespace http { */ class param_list { - string_view s_; + core::string_view s_; public: /** The type of each element in the list. @@ -62,7 +62,7 @@ class param_list be empty). */ using value_type = - std::pair; + std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -80,7 +80,7 @@ class param_list must remain valid for the lifetime of the container. */ explicit - param_list(string_view s) + param_list(core::string_view s) : s_(s) { } @@ -142,7 +142,7 @@ class ext_list { using iter_type = string_view::const_iterator; - string_view s_; + core::string_view s_; public: /** The type of each element in the list. @@ -151,7 +151,7 @@ class ext_list second element of the pair is an iterable container holding the extension's name/value parameters. */ - using value_type = std::pair; + using value_type = std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -166,7 +166,7 @@ class ext_list must remain valid for the lifetime of the container. */ explicit - ext_list(string_view s) + ext_list(core::string_view s) : s_(s) { } @@ -192,7 +192,7 @@ class ext_list */ BOOST_BEAST_DECL const_iterator - find(string_view const& s); + find(core::string_view const& s); /** Return `true` if a token is present in the list. @@ -200,7 +200,7 @@ class ext_list */ BOOST_BEAST_DECL bool - exists(string_view const& s); + exists(core::string_view const& s); }; //------------------------------------------------------------------------------ @@ -235,11 +235,11 @@ class token_list { using iter_type = string_view::const_iterator; - string_view s_; + core::string_view s_; public: /// The type of each element in the token list. - using value_type = string_view; + using value_type = core::string_view; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -254,7 +254,7 @@ class token_list must remain valid for the lifetime of the container. */ explicit - token_list(string_view s) + token_list(core::string_view s) : s_(s) { } @@ -277,7 +277,7 @@ class token_list */ BOOST_BEAST_DECL bool - exists(string_view const& s); + exists(core::string_view const& s); }; /** A list of tokens in a comma separated HTTP field value. diff --git a/include/boost/beast/http/status.hpp b/include/boost/beast/http/status.hpp index 377ade6a0f..084d442a72 100644 --- a/include/boost/beast/http/status.hpp +++ b/include/boost/beast/http/status.hpp @@ -163,7 +163,7 @@ to_status_class(status v); @param v The status code to use. */ BOOST_BEAST_DECL -string_view +core::string_view obsolete_reason(status v); /// Outputs the standard reason phrase of a status code to a stream. diff --git a/include/boost/beast/http/verb.hpp b/include/boost/beast/http/verb.hpp index 5352851a48..bd4217b9bf 100644 --- a/include/boost/beast/http/verb.hpp +++ b/include/boost/beast/http/verb.hpp @@ -135,11 +135,11 @@ enum class verb */ BOOST_BEAST_DECL verb -string_to_verb(string_view s); +string_to_verb(core::string_view s); /// Returns the text representation of a request method verb. BOOST_BEAST_DECL -string_view +core::string_view to_string(verb v); /// Write the text for a request method verb to an output stream. diff --git a/include/boost/beast/websocket/detail/hybi13.hpp b/include/boost/beast/websocket/detail/hybi13.hpp index 7aeae2a386..7783762e39 100644 --- a/include/boost/beast/websocket/detail/hybi13.hpp +++ b/include/boost/beast/websocket/detail/hybi13.hpp @@ -34,7 +34,7 @@ BOOST_BEAST_DECL void make_sec_ws_accept( sec_ws_accept_type& accept, - string_view key); + core::string_view key); } // detail } // websocket diff --git a/include/boost/beast/websocket/detail/hybi13.ipp b/include/boost/beast/websocket/detail/hybi13.ipp index 3e22c3130b..dcf7ded705 100644 --- a/include/boost/beast/websocket/detail/hybi13.ipp +++ b/include/boost/beast/websocket/detail/hybi13.ipp @@ -38,7 +38,7 @@ make_sec_ws_key(sec_ws_key_type& key) void make_sec_ws_accept( sec_ws_accept_type& accept, - string_view key) + core::string_view key) { BOOST_ASSERT(key.size() <= sec_ws_key_type::static_capacity); using namespace beast::detail::string_literals; diff --git a/include/boost/beast/websocket/detail/pmd_extension.hpp b/include/boost/beast/websocket/detail/pmd_extension.hpp index 8a52a26393..6e3acedc54 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.hpp +++ b/include/boost/beast/websocket/detail/pmd_extension.hpp @@ -45,7 +45,7 @@ struct pmd_offer BOOST_BEAST_DECL int -parse_bits(string_view s); +parse_bits(core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/websocket/detail/pmd_extension.ipp b/include/boost/beast/websocket/detail/pmd_extension.ipp index 005feec19d..b86455209e 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.ipp +++ b/include/boost/beast/websocket/detail/pmd_extension.ipp @@ -18,7 +18,7 @@ namespace websocket { namespace detail { int -parse_bits(string_view s) +parse_bits(core::string_view s) { if(s.size() == 0) return -1; diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index e20b4d1cfd..3385b3ebf1 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -79,7 +79,7 @@ build_response( decorator(res); if(! res.contains(http::field::server)) res.set(http::field::server, - string_view(BOOST_BEAST_VERSION_STRING)); + core::string_view(BOOST_BEAST_VERSION_STRING)); }; auto err = [&](error e) @@ -113,7 +113,7 @@ build_response( if(! http::token_list{it->value()}.exists("websocket")) return err(error::no_upgrade_websocket); } - string_view key; + core::string_view key; { auto const it = req.find(http::field::sec_websocket_key); if(it == req.end()) diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index f5bfb6c443..d21da0d305 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -231,8 +231,8 @@ void stream:: do_handshake( response_type* res_p, - string_view host, - string_view target, + core::string_view host, + core::string_view target, RequestDecorator const& decorator, error_code& ec) { @@ -310,8 +310,8 @@ template BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( - string_view host, - string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -335,8 +335,8 @@ BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( response_type& res, - string_view host, - string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -357,8 +357,8 @@ async_handshake( template void stream:: -handshake(string_view host, - string_view target) +handshake(core::string_view host, + core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -373,8 +373,8 @@ template void stream:: handshake(response_type& res, - string_view host, - string_view target) + core::string_view host, + core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -387,8 +387,8 @@ handshake(response_type& res, template void stream:: -handshake(string_view host, - string_view target, error_code& ec) +handshake(core::string_view host, + core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -400,8 +400,8 @@ template void stream:: handshake(response_type& res, - string_view host, - string_view target, + core::string_view host, + core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, diff --git a/include/boost/beast/websocket/impl/stream.hpp b/include/boost/beast/websocket/impl/stream.hpp index 2c044ebdf4..0ee5e51102 100644 --- a/include/boost/beast/websocket/impl/stream.hpp +++ b/include/boost/beast/websocket/impl/stream.hpp @@ -251,7 +251,7 @@ template void stream:: control_callback(std::function< - void(frame_type, string_view)> cb) + void(frame_type, core::string_view)> cb) { impl_->ctrl_cb = std::move(cb); } diff --git a/include/boost/beast/websocket/impl/stream_impl.hpp b/include/boost/beast/websocket/impl/stream_impl.hpp index 701919ddc9..edf960f91c 100644 --- a/include/boost/beast/websocket/impl/stream_impl.hpp +++ b/include/boost/beast/websocket/impl/stream_impl.hpp @@ -257,7 +257,7 @@ struct stream::impl_type request_type build_request( detail::sec_ws_key_type& key, - string_view host, string_view target, + core::string_view host, core::string_view target, Decorator const& decorator); void @@ -623,7 +623,7 @@ request_type stream::impl_type:: build_request( detail::sec_ws_key_type& key, - string_view host, string_view target, + core::string_view host, core::string_view target, Decorator const& decorator) { request_type req; diff --git a/include/boost/beast/websocket/rfc6455.hpp b/include/boost/beast/websocket/rfc6455.hpp index 7611096bba..19582657cc 100644 --- a/include/boost/beast/websocket/rfc6455.hpp +++ b/include/boost/beast/websocket/rfc6455.hpp @@ -187,7 +187,7 @@ struct close_reason } /// Construct from a reason string. code is @ref close_code::normal. - close_reason(string_view s) + close_reason(core::string_view s) : code(close_code::normal) , reason(s.data(), s.size()) { @@ -201,7 +201,7 @@ struct close_reason } /// Construct from a close code and reason string. - close_reason(close_code code_, string_view s) + close_reason(close_code code_, core::string_view s) : code(code_) , reason(s.data(), s.size()) { diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index 1aa47e359b..01f92a0ffd 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -156,7 +156,7 @@ class stream std::chrono::steady_clock::time_point; using control_cb_type = - std::function; + std::function; #ifndef BOOST_BEAST_DOXYGEN friend class close_test; @@ -525,7 +525,7 @@ class stream void callback( frame_type kind, // The type of frame - string_view payload // The payload in the frame + core::string_view payload // The payload in the frame ); @endcode The implementation type-erases the callback which may require @@ -545,7 +545,7 @@ class stream in undefined behavior. */ void - control_callback(std::function cb); + control_callback(std::function cb); /** Reset the control frame callback. @@ -762,8 +762,8 @@ class stream */ void handshake( - string_view host, - string_view target); + core::string_view host, + core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -820,8 +820,8 @@ class stream void handshake( response_type& res, - string_view host, - string_view target); + core::string_view host, + core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -868,8 +868,8 @@ class stream */ void handshake( - string_view host, - string_view target, + core::string_view host, + core::string_view target, error_code& ec); /** Perform the WebSocket handshake in the client role. @@ -925,8 +925,8 @@ class stream void handshake( response_type& res, - string_view host, - string_view target, + core::string_view host, + core::string_view target, error_code& ec); /** Perform the WebSocket handshake asynchronously in the client role. @@ -1002,8 +1002,8 @@ class stream > BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( - string_view host, - string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -1091,8 +1091,8 @@ class stream BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( response_type& res, - string_view host, - string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -2909,7 +2909,7 @@ class stream template void do_handshake(response_type* res_p, - string_view host, string_view target, + core::string_view host, core::string_view target, RequestDecorator const& decorator, error_code& ec); diff --git a/test/beast/_experimental/icy_stream.cpp b/test/beast/_experimental/icy_stream.cpp index d7913c6f29..fcafd4153f 100644 --- a/test/beast/_experimental/icy_stream.cpp +++ b/test/beast/_experimental/icy_stream.cpp @@ -28,7 +28,7 @@ class icy_stream_test { public: void - doMatrix(string_view in, string_view out) + doMatrix(core::string_view in, core::string_view out) { using net::mutable_buffer; net::io_context ioc; diff --git a/test/beast/core/_detail_base64.cpp b/test/beast/core/_detail_base64.cpp index c4c06f240d..f1d02c9347 100644 --- a/test/beast/core/_detail_base64.cpp +++ b/test/beast/core/_detail_base64.cpp @@ -32,14 +32,14 @@ class base64_test : public beast::unit_test::suite } std::string - base64_encode(string_view s) + base64_encode(core::string_view s) { return base64_encode (reinterpret_cast < std::uint8_t const*> (s.data()), s.size()); } std::string - base64_decode(string_view data) + base64_decode(core::string_view data) { std::string dest; dest.resize(base64::decoded_size(data.size())); diff --git a/test/beast/core/basic_stream.cpp b/test/beast/core/basic_stream.cpp index 2db8d63987..5d8912b4d4 100644 --- a/test/beast/core/basic_stream.cpp +++ b/test/beast/core/basic_stream.cpp @@ -167,7 +167,7 @@ struct test_acceptor class test_server { - string_view s_; + core::string_view s_; std::ostream& log_; net::io_context ioc_; net::ip::tcp::acceptor acceptor_; @@ -175,7 +175,7 @@ class test_server std::thread t_; void - fail(error_code const& ec, string_view what) + fail(error_code const& ec, core::string_view what) { if(ec != net::error::operation_aborted) log_ << what << ": " << ec.message() << "\n"; @@ -183,7 +183,7 @@ class test_server public: test_server( - string_view s, + core::string_view s, net::ip::tcp::endpoint ep, std::ostream& log) : s_(s) @@ -253,12 +253,12 @@ class test_server class session : public std::enable_shared_from_this { - string_view s_; + core::string_view s_; net::ip::tcp::socket socket_; public: session( - string_view s, + core::string_view s, net::ip::tcp::socket sock, std::ostream&) : s_(s) diff --git a/test/beast/core/bind_handler.cpp b/test/beast/core/bind_handler.cpp index 1a074dd0a5..2298adf7ab 100644 --- a/test/beast/core/bind_handler.cpp +++ b/test/beast/core/bind_handler.cpp @@ -287,7 +287,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, string_view s) + operator()(int v, core::string_view s) { fail_ = false; BEAST_EXPECT(v == 42); @@ -295,7 +295,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, string_view s, move_arg<1>) + operator()(int v, core::string_view s, move_arg<1>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -303,7 +303,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, string_view s, move_arg<1>, move_arg<2>) + operator()(int v, core::string_view s, move_arg<1>, move_arg<2>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -319,7 +319,7 @@ class bind_handler_test : public unit_test::suite void operator()( - error_code, std::size_t n, string_view s) + error_code, std::size_t n, core::string_view s) { boost::ignore_unused(s); fail_ = false; @@ -527,7 +527,7 @@ class bind_handler_test : public unit_test::suite // void(error_code, size_t) bind_front_handler(test_cb{}, ec, n)(); - // void(error_code, size_t)(string_view) + // void(error_code, size_t)(core::string_view) bind_front_handler(test_cb{}, ec, n)("s"); // perfect forwarding diff --git a/test/beast/core/buffers_cat.cpp b/test/beast/core/buffers_cat.cpp index 7cd3e64234..588b98ddde 100644 --- a/test/beast/core/buffers_cat.cpp +++ b/test/beast/core/buffers_cat.cpp @@ -72,7 +72,7 @@ class buffers_cat_test : public unit_test::suite void testBufferSequence() { - string_view s = "Hello, world!"; + core::string_view s = "Hello, world!"; net::const_buffer b1(s.data(), 6); net::const_buffer b2( s.data() + b1.size(), s.size() - b1.size()); diff --git a/test/beast/core/buffers_range.cpp b/test/beast/core/buffers_range.cpp index d809841dc5..579326f7b9 100644 --- a/test/beast/core/buffers_range.cpp +++ b/test/beast/core/buffers_range.cpp @@ -69,7 +69,7 @@ class buffers_range_test : public beast::unit_test::suite testBufferSequence() { { - string_view s = "Hello, world!"; + core::string_view s = "Hello, world!"; test_buffer_sequence(buffers_range( net::const_buffer{s.data(), s.size()})); } diff --git a/test/beast/core/buffers_suffix.cpp b/test/beast/core/buffers_suffix.cpp index e08bfdf300..284bc2e93f 100644 --- a/test/beast/core/buffers_suffix.cpp +++ b/test/beast/core/buffers_suffix.cpp @@ -37,7 +37,7 @@ class buffers_suffix_test : public beast::unit_test::suite // const { - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; std::array b{{ net::const_buffer(src.data(), 3), net::const_buffer(src.data() + 3, 4), diff --git a/test/beast/core/detect_ssl.cpp b/test/beast/core/detect_ssl.cpp index 1155fb1571..1339826fee 100644 --- a/test/beast/core/detect_ssl.cpp +++ b/test/beast/core/detect_ssl.cpp @@ -31,21 +31,21 @@ class detect_ssl_test : public unit_test::suite testDetect() { auto const yes = - [](int n, string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const no = - [](int n, string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(! detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const maybe = - [](int n, string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(boost::indeterminate( detail::is_tls_client_hello( diff --git a/test/beast/core/file_test.hpp b/test/beast/core/file_test.hpp index e5a54b9d20..2a8e6c1558 100644 --- a/test/beast/core/file_test.hpp +++ b/test/beast/core/file_test.hpp @@ -393,7 +393,7 @@ test_file() // read and write { - string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // write { diff --git a/test/beast/core/flat_buffer.cpp b/test/beast/core/flat_buffer.cpp index a17acfe9f0..0035a26ec9 100644 --- a/test/beast/core/flat_buffer.cpp +++ b/test/beast/core/flat_buffer.cpp @@ -255,7 +255,7 @@ class flat_buffer_test : public beast::unit_test::suite // operations { - string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; flat_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); diff --git a/test/beast/core/flat_static_buffer.cpp b/test/beast/core/flat_static_buffer.cpp index d70338e586..064ad03c1f 100644 --- a/test/beast/core/flat_static_buffer.cpp +++ b/test/beast/core/flat_static_buffer.cpp @@ -41,7 +41,7 @@ class flat_static_buffer_test : public beast::unit_test::suite void testMembers() { - string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // flat_static_buffer_base { diff --git a/test/beast/core/make_printable.cpp b/test/beast/core/make_printable.cpp index 0b081cd438..423bb66284 100644 --- a/test/beast/core/make_printable.cpp +++ b/test/beast/core/make_printable.cpp @@ -43,7 +43,7 @@ class make_printable_test : public beast::unit_test::suite { char buf[13]; buffers_triple b(buf, sizeof(buf)); - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; BEAST_EXPECT(src.size() == sizeof(buf)); net::buffer_copy(b, net::const_buffer(src.data(), src.size())); diff --git a/test/beast/core/multi_buffer.cpp b/test/beast/core/multi_buffer.cpp index cc32543942..40cf12dad4 100644 --- a/test/beast/core/multi_buffer.cpp +++ b/test/beast/core/multi_buffer.cpp @@ -418,7 +418,7 @@ class multi_buffer_test : public beast::unit_test::suite } } { - string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; multi_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); @@ -683,7 +683,7 @@ class multi_buffer_test : public beast::unit_test::suite void testMatrix1() { - string_view s = "Hello, world"; + core::string_view s = "Hello, world"; BEAST_EXPECT(s.size() == 12); for(std::size_t i = 1; i < 12; ++i) { for(std::size_t x = 1; x < 4; ++x) { diff --git a/test/beast/core/ostream.cpp b/test/beast/core/ostream.cpp index 1a4f6cb08b..b0fcd4c920 100644 --- a/test/beast/core/ostream.cpp +++ b/test/beast/core/ostream.cpp @@ -27,7 +27,7 @@ class ostream_test : public beast::unit_test::suite void testOstream() { - string_view const s = "0123456789abcdef"; + core::string_view const s = "0123456789abcdef"; BEAST_EXPECT(s.size() == 16); // overflow @@ -75,7 +75,7 @@ class ostream_test : public beast::unit_test::suite { // Issue #1853 flat_static_buffer<16> b; - auto half_view = string_view(s.data(), 8); + auto half_view = core::string_view(s.data(), 8); { auto os = ostream(b); os << half_view; @@ -88,9 +88,9 @@ class ostream_test : public beast::unit_test::suite flat_static_buffer<16> b; { auto os = ostream(b); - os << string_view(s.data(), 8); + os << core::string_view(s.data(), 8); os.flush(); - os << string_view(s.data() + 8, 8); + os << core::string_view(s.data() + 8, 8); os.flush(); } BEAST_EXPECT(buffers_to_string(b.data()) == s); diff --git a/test/beast/core/static_buffer.cpp b/test/beast/core/static_buffer.cpp index 4bf17f6e28..e2310e5844 100644 --- a/test/beast/core/static_buffer.cpp +++ b/test/beast/core/static_buffer.cpp @@ -45,7 +45,7 @@ class static_buffer_test : public beast::unit_test::suite void testMembers() { - string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // static_buffer_base { diff --git a/test/beast/core/static_string.cpp b/test/beast/core/static_string.cpp index 7b73e877ce..f68b3d2502 100644 --- a/test/beast/core/static_string.cpp +++ b/test/beast/core/static_string.cpp @@ -126,13 +126,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1( - string_view("123")); + core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<2> s2( - string_view("123")); + core::string_view("123")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -235,13 +235,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1; - s1 = string_view("123"); + s1 = core::string_view("123"); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<1> s2; - s2 = string_view("123"); + s2 = core::string_view("123"); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -373,15 +373,15 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1; - s1.assign(string_view("123")); + s1.assign(core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); - s1.assign(string_view("12345")); + s1.assign(core::string_view("12345")); BEAST_EXPECT(s1 == "12345"); BEAST_EXPECT(*s1.end() == 0); try { - s1.assign(string_view("1234567")); + s1.assign(core::string_view("1234567")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -486,7 +486,7 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s("123"); - string_view sv = s; + core::string_view sv = s; BEAST_EXPECT(static_string<5>(sv) == "123"); } } @@ -754,13 +754,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1("123"); - s1.insert(1, string_view("UV")); + s1.insert(1, core::string_view("UV")); BEAST_EXPECT(s1 == "1UV23"); BEAST_EXPECT(*s1.end() == 0); try { static_string<4> s2("123"); - s2.insert(1, string_view("UV")); + s2.insert(1, core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -770,7 +770,7 @@ class static_string_test : public beast::unit_test::suite try { static_string<5> s2("123"); - s2.insert(5, string_view("UV")); + s2.insert(5, core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::out_of_range const&) @@ -1033,7 +1033,7 @@ class static_string_test : public beast::unit_test::suite } } { - string_view s1("XYZ"); + core::string_view s1("XYZ"); static_string<5> s2("12"); s2.append(s1); BEAST_EXPECT(s2 == "12XYZ"); @@ -1133,7 +1133,7 @@ class static_string_test : public beast::unit_test::suite } } { - string_view s1("34"); + core::string_view s1("34"); static_string<4> s2("12"); s2 += s1; BEAST_EXPECT(s2 == "1234"); diff --git a/test/beast/core/test_buffer.hpp b/test/beast/core/test_buffer.hpp index d534bc2932..f92c1fb9bd 100644 --- a/test/beast/core/test_buffer.hpp +++ b/test/beast/core/test_buffer.hpp @@ -119,7 +119,7 @@ void test_mutable_buffers( MutableBufferSequence const& b, net::mutable_buffer) { - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; BOOST_ASSERT(buffer_bytes(b) <= src.size()); if(src.size() > buffer_bytes(b)) src = {src.data(), buffer_bytes(b)}; @@ -298,7 +298,7 @@ test_mutable_dynamic_buffer( typename MutableDynamicBuffer_v0::mutable_buffers_type, typename MutableDynamicBuffer_v0::const_buffers_type>::value); - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; @@ -385,7 +385,7 @@ test_dynamic_buffer( // members { - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -524,7 +524,7 @@ test_dynamic_buffer( // setup source buffer char buf[13]; unsigned char k0 = 0; - string_view src(buf, sizeof(buf)); + core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -559,7 +559,7 @@ test_dynamic_buffer( // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - string_view in(src.data(), h); + core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { @@ -620,7 +620,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // members { - string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -702,7 +702,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // setup source buffer char buf[13]; unsigned char k0 = 0; - string_view src(buf, sizeof(buf)); + core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -737,7 +737,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - string_view in(src.data(), h); + core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { diff --git a/test/beast/http/basic_parser.cpp b/test/beast/http/basic_parser.cpp index 60c5ddd972..009a76eca0 100644 --- a/test/beast/http/basic_parser.cpp +++ b/test/beast/http/basic_parser.cpp @@ -213,7 +213,7 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(string_view msg, Test const& test, bool skip = false) + parsegrind(core::string_view msg, Test const& test, bool skip = false) { parsegrind(net::const_buffer{ msg.data(), msg.size()}, test, skip); @@ -229,14 +229,14 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(string_view msg) + parsegrind(core::string_view msg) { parsegrind(msg, [](Parser const&){}); } template void - failgrind(string_view msg, error_code const& result) + failgrind(core::string_view msg, error_code const& result) { for(std::size_t i = 1; i < msg.size() - 1; ++i) { @@ -321,7 +321,7 @@ class basic_parser_test : public beast::unit_test::suite testObsFold() { auto const check = - [&](std::string const& s, string_view value) + [&](std::string const& s, core::string_view value) { std::string m = "GET / HTTP/1.1\r\n" @@ -952,7 +952,7 @@ class basic_parser_test : public beast::unit_test::suite static net::const_buffer - buf(string_view s) + buf(core::string_view s) { return {s.data(), s.size()}; } @@ -1140,7 +1140,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - string_view s = + core::string_view s = "GET / HTTP/1.1\r\n" "\r\n" "die!"; @@ -1177,7 +1177,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - string_view s = + core::string_view s = "HTTP/1.1 101 Switching Protocols\r\n" "Content-Length: 2147483648\r\n" "\r\n"; @@ -1194,12 +1194,12 @@ class basic_parser_test : public beast::unit_test::suite testFuzz() { auto const grind = - [&](string_view s) + [&](core::string_view s) { static_string<100> ss(s.data(), s.size()); test::fuzz_rand r; test::fuzz(ss, 4, 5, r, - [&](string_view s) + [&](core::string_view s) { error_code ec; test_parser p; @@ -1209,7 +1209,7 @@ class basic_parser_test : public beast::unit_test::suite }); }; auto const good = - [&](string_view s) + [&](core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1226,7 +1226,7 @@ class basic_parser_test : public beast::unit_test::suite grind(msg); }; auto const bad = - [&](string_view s) + [&](core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1282,7 +1282,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](string_view s, std::uint32_t v0) + [&](core::string_view s, std::uint32_t v0) { std::uint64_t v; auto const result = @@ -1291,7 +1291,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](string_view s) + [&](core::string_view s) { std::uint64_t v; auto const result = @@ -1318,7 +1318,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](string_view s, std::uint64_t v0) + [&](core::string_view s, std::uint64_t v0) { std::uint64_t v; auto it = s.data(); @@ -1328,7 +1328,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](string_view s) + [&](core::string_view s) { std::uint64_t v; auto it = s.data(); @@ -1513,7 +1513,7 @@ class basic_parser_test : public beast::unit_test::suite void testChunkedBodySize() { - string_view resp = + core::string_view resp = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Transfer-Encoding: chunked\r\n" diff --git a/test/beast/http/chunk_encode.cpp b/test/beast/http/chunk_encode.cpp index ceedf6368a..9e04fe97ab 100644 --- a/test/beast/http/chunk_encode.cpp +++ b/test/beast/http/chunk_encode.cpp @@ -38,7 +38,7 @@ class chunk_encode_test template void - check(string_view match, Args&&... args) + check(core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -50,7 +50,7 @@ class chunk_encode_test template void - check_fwd(string_view match, Args&&... args) + check_fwd(core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -64,7 +64,7 @@ class chunk_encode_test static cb_t - cb(string_view s) + cb(core::string_view s) { return {s.data(), s.size()}; } @@ -227,7 +227,7 @@ class chunk_encode_test testParseChunkExtensions() { auto const grind = - [&](string_view s) + [&](core::string_view s) { error_code ec; static_string<200> ss(s.data(), s.size()); @@ -235,7 +235,7 @@ class chunk_encode_test for(auto i = 3; i--;) { test::fuzz(ss, 5, 5, r, - [&](string_view s) + [&](core::string_view s) { chunk_extensions c1; c1.parse(s, ec); @@ -259,7 +259,7 @@ class chunk_encode_test } }; auto const good = - [&](string_view s) + [&](core::string_view s) { error_code ec; chunk_extensions ce; @@ -268,7 +268,7 @@ class chunk_encode_test grind(s); }; auto const bad = - [&](string_view s) + [&](core::string_view s) { error_code ec; chunk_extensions ce; diff --git a/test/beast/http/field.cpp b/test/beast/http/field.cpp index 78437c4b98..c6f5c98e69 100644 --- a/test/beast/http/field.cpp +++ b/test/beast/http/field.cpp @@ -23,7 +23,7 @@ class field_test : public beast::unit_test::suite testField() { auto const match = - [&](field f, string_view s) + [&](field f, core::string_view s) { BEAST_EXPECT(iequals(to_string(f), s)); BEAST_EXPECT(string_to_field(s) == f); @@ -163,7 +163,7 @@ class field_test : public beast::unit_test::suite match(field::x_xss_protection, "X-XSS-Protection"); auto const unknown = - [&](string_view s) + [&](core::string_view s) { BEAST_EXPECT(string_to_field(s) == field::unknown); }; diff --git a/test/beast/http/fields.cpp b/test/beast/http/fields.cpp index c1aa3bbe7c..0eb3036342 100644 --- a/test/beast/http/fields.cpp +++ b/test/beast/http/fields.cpp @@ -1042,30 +1042,30 @@ class fields_test : public beast::unit_test::suite BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); } template diff --git a/test/beast/http/file_body.cpp b/test/beast/http/file_body.cpp index 3f049cd442..00bf40fdff 100644 --- a/test/beast/http/file_body.cpp +++ b/test/beast/http/file_body.cpp @@ -103,7 +103,7 @@ class file_body_test : public beast::unit_test::suite doTestFileBody() { error_code ec; - string_view const s = + core::string_view const s = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Content-Length: 3\r\n" @@ -147,7 +147,7 @@ class file_body_test : public beast::unit_test::suite sr.next(ec, visit); BEAST_EXPECTS(! ec, ec.message()); auto const b = buffers_front(visit.buffer.data()); - string_view const s1{ + core::string_view const s1{ reinterpret_cast(b.data()), b.size()}; BEAST_EXPECTS(s1 == s, s1); @@ -164,7 +164,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - string_view const ten = + core::string_view const ten = "0123456789"; // 40 // create the temporary file { @@ -219,7 +219,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - string_view const ten = + core::string_view const ten = "0123456789"; // 40 // create the temporary file { diff --git a/test/beast/http/message.cpp b/test/beast/http/message.cpp index d24e130629..0392a47754 100644 --- a/test/beast/http/message.cpp +++ b/test/beast/http/message.cpp @@ -87,23 +87,23 @@ class message_test : public beast::unit_test::suite >::value); //BOOST_CORE_STATIC_ASSERT(! std::is_constructible, - // verb, string_view, unsigned>::value); + // verb, core::string_view, unsigned>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, string_view, unsigned, Arg1>::value); + verb, core::string_view, unsigned, Arg1>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, string_view, unsigned, Arg1&&>::value); + verb, core::string_view, unsigned, Arg1&&>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, string_view, unsigned, Arg1 const>::value); + verb, core::string_view, unsigned, Arg1 const>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, string_view, unsigned, Arg1 const&>::value); + verb, core::string_view, unsigned, Arg1 const&>::value); // 1-arg + fields BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, string_view, unsigned, Arg1, fields::allocator_type>::value); + verb, core::string_view, unsigned, Arg1, fields::allocator_type>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, std::piecewise_construct_t, std::tuple>::value); @@ -198,15 +198,15 @@ class message_test : public beast::unit_test::suite test_fields() = delete; test_fields(token) {} - string_view get_method_impl() const { return {}; } - string_view get_target_impl() const { return target; } - string_view get_reason_impl() const { return {}; } + core::string_view get_method_impl() const { return {}; } + core::string_view get_target_impl() const { return target; } + core::string_view get_reason_impl() const { return {}; } bool get_chunked_impl() const { return false; } bool get_keep_alive_impl(unsigned) const { return true; } bool has_content_length_impl() const { return false; } - void set_method_impl(string_view) {} - void set_target_impl(string_view s) { target = std::string(s); } - void set_reason_impl(string_view) {} + void set_method_impl(core::string_view) {} + void set_target_impl(core::string_view s) { target = std::string(s); } + void set_reason_impl(core::string_view) {} void set_chunked_impl(bool) {} void set_content_length_impl(boost::optional) {} void set_keep_alive_impl(unsigned, bool) {} @@ -352,7 +352,7 @@ class message_test : public beast::unit_test::suite BEAST_EXPECT(h.method_string() == to_string(v)); }; auto const scheck = - [&](string_view s) + [&](core::string_view s) { h.method_string(s); BEAST_EXPECT(h.method() == string_to_verb(s)); diff --git a/test/beast/http/message_fuzz.hpp b/test/beast/http/message_fuzz.hpp index f6d9f89db7..f719c2f055 100644 --- a/test/beast/http/message_fuzz.hpp +++ b/test/beast/http/message_fuzz.hpp @@ -22,7 +22,7 @@ namespace http { template std::string -escaped_string(string_view s) +escaped_string(core::string_view s) { std::string out; out.reserve(s.size()); diff --git a/test/beast/http/parser.cpp b/test/beast/http/parser.cpp index 05e5a0e5eb..09eef495db 100644 --- a/test/beast/http/parser.cpp +++ b/test/beast/http/parser.cpp @@ -36,7 +36,7 @@ class parser_test static net::const_buffer - buf(string_view s) + buf(core::string_view s) { return {s.data(), s.size()}; } @@ -70,7 +70,7 @@ class parser_test template void - doMatrix(string_view s0, F const& f) + doMatrix(core::string_view s0, F const& f) { // parse a single buffer { diff --git a/test/beast/http/read.cpp b/test/beast/http/read.cpp index 61a0c99444..b5888fb951 100644 --- a/test/beast/http/read.cpp +++ b/test/beast/http/read.cpp @@ -440,7 +440,7 @@ class read_test template void - readgrind(string_view s, Pred&& pred) + readgrind(core::string_view s, Pred&& pred) { for(std::size_t n = 1; n < s.size() - 1; ++n) { @@ -600,8 +600,8 @@ class read_test request_parser p; test::stream s(ioc_); - s.append(string_view(hdr)); - s.append(string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); flat_buffer fb; error_code ec; auto bt = async_read_header(s, fb, p, yield[ec]); @@ -685,8 +685,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(string_view(hdr)); - s.append(string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); flat_buffer fb; error_code ec; auto bt = read_header(s, fb, p, ec); @@ -703,8 +703,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(string_view(hdr)); - s.append(string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); std::string res ; auto fb = asio::dynamic_buffer(res); error_code ec; diff --git a/test/beast/http/rfc7230.cpp b/test/beast/http/rfc7230.cpp index 1bcc135349..52584295de 100644 --- a/test/beast/http/rfc7230.cpp +++ b/test/beast/http/rfc7230.cpp @@ -31,7 +31,7 @@ class rfc7230_test : public beast::unit_test::suite static std::string - str(string_view s) + str(core::string_view s) { return std::string(s.data(), s.size()); } @@ -246,7 +246,7 @@ class rfc7230_test : public beast::unit_test::suite template static std::vector - to_vector(string_view in) + to_vector(core::string_view in) { std::vector v; detail::basic_parsed_list list{in}; @@ -258,7 +258,7 @@ class rfc7230_test : public beast::unit_test::suite template void - validate(string_view in, + validate(core::string_view in, std::vector const& v) { BEAST_EXPECT(to_vector(in) == v); @@ -266,7 +266,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(string_view in) + good(core::string_view in) { BEAST_EXPECT(validate_list( detail::basic_parsed_list{in})); @@ -274,7 +274,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(string_view in, + good(core::string_view in, std::vector const& v) { BEAST_EXPECT(validate_list( @@ -284,7 +284,7 @@ class rfc7230_test : public beast::unit_test::suite template void - bad(string_view in) + bad(core::string_view in) { BEAST_EXPECT(! validate_list( detail::basic_parsed_list{in})); diff --git a/test/beast/http/test_parser.hpp b/test/beast/http/test_parser.hpp index 3a56d39700..681a28028e 100644 --- a/test/beast/http/test_parser.hpp +++ b/test/beast/http/test_parser.hpp @@ -55,8 +55,8 @@ class test_parser } void - on_request_impl(verb, string_view method_str_, - string_view path_, int version_, error_code& ec) + on_request_impl(verb, core::string_view method_str_, + core::string_view path_, int version_, error_code& ec) { method = std::string( method_str_.data(), method_str_.size()); @@ -70,7 +70,7 @@ class test_parser void on_response_impl(int code, - string_view reason_, + core::string_view reason_, int version_, error_code& ec) { status = code; @@ -83,8 +83,8 @@ class test_parser } void - on_field_impl(field, string_view name, - string_view value, error_code& ec) + on_field_impl(field, core::string_view name, + core::string_view value, error_code& ec) { ++got_on_field; if(fc_) @@ -93,8 +93,8 @@ class test_parser } void - on_trailer_field_impl(field, string_view name, - string_view value, error_code& ec) + on_trailer_field_impl(field, core::string_view name, + core::string_view value, error_code& ec) { ++got_on_trailer_field; if(fc_) @@ -125,7 +125,7 @@ class test_parser } std::size_t - on_body_impl(string_view s, + on_body_impl(core::string_view s, error_code& ec) { body.append(s.data(), s.size()); @@ -137,7 +137,7 @@ class test_parser void on_chunk_header_impl( std::uint64_t, - string_view, + core::string_view, error_code& ec) { ++got_on_chunk; @@ -148,7 +148,7 @@ class test_parser std::size_t on_chunk_body_impl( std::uint64_t, - string_view s, + core::string_view s, error_code& ec) { body.append(s.data(), s.size()); diff --git a/test/beast/http/verb.cpp b/test/beast/http/verb.cpp index 46ef531f0e..e9b956b4a7 100644 --- a/test/beast/http/verb.cpp +++ b/test/beast/http/verb.cpp @@ -66,7 +66,7 @@ class verb_test good(verb::unlink); auto const bad = - [&](string_view s) + [&](core::string_view s) { auto const v = string_to_verb(s); BEAST_EXPECTS(v == verb::unknown, to_string(v)); diff --git a/test/beast/http/write.cpp b/test/beast/http/write.cpp index a8a618a437..4bc7629dd3 100644 --- a/test/beast/http/write.cpp +++ b/test/beast/http/write.cpp @@ -274,7 +274,7 @@ class write_test template bool - equal_body(string_view sv, string_view body) + equal_body(core::string_view sv, core::string_view body) { test::stream ts{ioc_, sv}, tr{ioc_}; ts.connect(tr); diff --git a/test/beast/websocket/accept.cpp b/test/beast/websocket/accept.cpp index ca6d43572c..18a53b5c68 100644 --- a/test/beast/websocket/accept.cpp +++ b/test/beast/websocket/accept.cpp @@ -482,7 +482,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite net::io_context ioc; auto const check = - [&](error_code ev, string_view s) + [&](error_code ev, core::string_view s) { for(int i = 0; i < 3; ++i) { @@ -798,7 +798,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite { { stream ws1(ioc); - string_view s = + core::string_view s = "GET / HTTP/1.1\r\n" "Host: localhost\r\n" "Upgrade: websocket\r\n" diff --git a/test/beast/websocket/close.cpp b/test/beast/websocket/close.cpp index ddf7a53d65..f80d3a1c2b 100644 --- a/test/beast/websocket/close.cpp +++ b/test/beast/websocket/close.cpp @@ -361,7 +361,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; ws.async_read(b, @@ -402,7 +402,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x09\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -443,7 +443,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -485,7 +485,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), @@ -529,7 +529,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), diff --git a/test/beast/websocket/handshake.cpp b/test/beast/websocket/handshake.cpp index 3ac501699c..33ac381282 100644 --- a/test/beast/websocket/handshake.cpp +++ b/test/beast/websocket/handshake.cpp @@ -309,7 +309,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const accept = - [&](string_view s) + [&](core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -319,7 +319,7 @@ class handshake_test : public websocket_test_suite }; auto const reject = - [&](string_view s) + [&](core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -401,7 +401,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const check = - [&](string_view match) + [&](core::string_view match) { http::fields f; detail::pmd_write(f, po); @@ -447,7 +447,7 @@ class handshake_test : public websocket_test_suite auto const reject = [&]( - string_view offer) + core::string_view offer) { detail::pmd_offer po; { @@ -463,8 +463,8 @@ class handshake_test : public websocket_test_suite auto const accept = [&]( - string_view offer, - string_view result) + core::string_view offer, + core::string_view result) { detail::pmd_offer po; { diff --git a/test/beast/websocket/ping.cpp b/test/beast/websocket/ping.cpp index ba70628054..c2933e3fb7 100644 --- a/test/beast/websocket/ping.cpp +++ b/test/beast/websocket/ping.cpp @@ -148,7 +148,7 @@ class ping_test : public websocket_test_suite true }); unsigned n_pongs = 0; - ws1.control_callback({[&](frame_type kind, string_view) + ws1.control_callback({[&](frame_type kind, core::string_view) { if (kind == frame_type::pong) ++n_pongs; @@ -247,7 +247,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; @@ -288,7 +288,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x09\x00", 2}); std::size_t count = 0; @@ -330,7 +330,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/websocket/read1.cpp b/test/beast/websocket/read1.cpp index 0b03e230b8..e99e2c3558 100644 --- a/test/beast/websocket/read1.cpp +++ b/test/beast/websocket/read1.cpp @@ -185,7 +185,7 @@ class read1_test : public unit_test::suite stream_base::none(), false}); // add a close frame to the input - ws1.next_layer().append(string_view{ + ws1.next_layer().append(core::string_view{ "\x88\x00", 2}); ws1.async_read(b, test::fail_handler( beast::error::timeout)); diff --git a/test/beast/websocket/read2.cpp b/test/beast/websocket/read2.cpp index 3cb2408db3..d3150228b9 100644 --- a/test/beast/websocket/read2.cpp +++ b/test/beast/websocket/read2.cpp @@ -102,7 +102,7 @@ class read2_test [&](ws_type_t& ws) { ws.next_layer().append( - string_view( + core::string_view( "\x01\x00" "\x80\x00", 4)); multi_buffer b; w.read(ws, b); @@ -133,7 +133,7 @@ class read2_test {0x89, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, string_view) + [&](frame_type kind, core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::ping); @@ -155,7 +155,7 @@ class read2_test {0x88, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, string_view) + [&](frame_type kind, core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::close); @@ -171,7 +171,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, string_view s) + [&](frame_type kind, core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -194,7 +194,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, string_view s) + [&](frame_type kind, core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -389,7 +389,7 @@ class read2_test // close frames { auto const check = - [&](error_code ev, string_view s) + [&](error_code ev, core::string_view s) { echo_server es{log}; stream ws{ioc_}; @@ -560,7 +560,7 @@ class read2_test w.read_some(ws, net::buffer(buf, sizeof(buf))); BEAST_EXPECT(bytes_written > 0); BEAST_EXPECT( - string_view(buf, 3).substr(0, bytes_written) == + core::string_view(buf, 3).substr(0, bytes_written) == s.substr(0, bytes_written)); }); @@ -637,7 +637,7 @@ class read2_test // Read close frames { auto const check = - [&](error_code ev, string_view s) + [&](error_code ev, core::string_view s) { echo_server es{log}; stream ws{ioc_}; diff --git a/test/beast/websocket/read3.cpp b/test/beast/websocket/read3.cpp index a16060db9a..92ebc67e79 100644 --- a/test/beast/websocket/read3.cpp +++ b/test/beast/websocket/read3.cpp @@ -99,7 +99,7 @@ class read3_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // insert a ping - ws.next_layer().append(string_view( + ws.next_layer().append(core::string_view( "\x89\x00", 2)); std::size_t count = 0; std::string const s = "Hello, world"; @@ -139,7 +139,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a ping in between the frames. - ws.next_layer().append(string_view( + ws.next_layer().append(core::string_view( "\x01\x01*" "\x89\x00" "\x80\x01*", 8)); @@ -187,7 +187,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a close in between the frames. - ws.next_layer().append(string_view( + ws.next_layer().append(core::string_view( "\x01\x01*" "\x88\x00" "\x80\x01*", 8)); @@ -219,7 +219,7 @@ class read3_test : public websocket_test_suite testParseFrame() { auto const bad = - [&](string_view s) + [&](core::string_view s) { echo_server es{log}; net::io_context ioc; @@ -335,8 +335,8 @@ class read3_test : public websocket_test_suite } // length not canonical - bad(string_view("\x81\x7e\x00\x7d", 4)); - bad(string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); + bad(core::string_view("\x81\x7e\x00\x7d", 4)); + bad(core::string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); } void @@ -398,7 +398,7 @@ class read3_test : public websocket_test_suite bool called_cb = false; bool called_handler = false; ws.control_callback( - [&called_cb](frame_type, string_view) + [&called_cb](frame_type, core::string_view) { called_cb = true; }); diff --git a/test/beast/websocket/test.hpp b/test/beast/websocket/test.hpp index 1575db32bb..ee4b98af5b 100644 --- a/test/beast/websocket/test.hpp +++ b/test/beast/websocket/test.hpp @@ -526,8 +526,8 @@ class websocket_test_suite void handshake( stream& ws, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(uri, path); } @@ -537,8 +537,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(res, uri, path); } @@ -549,8 +549,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -563,8 +563,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -780,8 +780,8 @@ class websocket_test_suite void handshake( stream& ws, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -795,8 +795,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -811,8 +811,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -829,8 +829,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -1061,8 +1061,8 @@ struct test_sync_api handshake( stream& ws, response_type& res, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(res, uri, path); } @@ -1073,8 +1073,8 @@ struct test_sync_api void handshake_ex( stream& ws, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -1087,8 +1087,8 @@ struct test_sync_api handshake_ex( stream& ws, response_type& res, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -1361,8 +1361,8 @@ class test_async_api void handshake( stream& ws, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -1378,8 +1378,8 @@ class test_async_api handshake( stream& ws, response_type& res, - string_view uri, - string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -1396,8 +1396,8 @@ class test_async_api void handshake_ex( stream& ws, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -1416,8 +1416,8 @@ class test_async_api handshake_ex( stream& ws, response_type& res, - string_view uri, - string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; diff --git a/test/beast/websocket/timer.cpp b/test/beast/websocket/timer.cpp index 7ad3a59f17..311b971a03 100644 --- a/test/beast/websocket/timer.cpp +++ b/test/beast/websocket/timer.cpp @@ -48,7 +48,7 @@ struct timer_test : unit_test::suite flat_buffer b2; bool received = false; ws1.control_callback( - [&received](frame_type ft, string_view) + [&received](frame_type ft, core::string_view) { received = true; BEAST_EXPECT(ft == frame_type::ping); diff --git a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp index 84978969b8..a679fafaaa 100644 --- a/test/beast/websocket/write.cpp +++ b/test/beast/websocket/write.cpp @@ -375,7 +375,7 @@ class write_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/zlib/deflate_stream.cpp b/test/beast/zlib/deflate_stream.cpp index 6a003bff33..9557db1fec 100644 --- a/test/beast/zlib/deflate_stream.cpp +++ b/test/beast/zlib/deflate_stream.cpp @@ -203,7 +203,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string compress( - string_view const& in, + core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel) // 1..9 (8=default) @@ -240,7 +240,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string - decompress(string_view const& in) + decompress(core::string_view const& in) { int result; std::string out; @@ -474,7 +474,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - string_view s = "Hello"; + core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); @@ -501,7 +501,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - string_view s = "Hello"; + core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); diff --git a/test/beast/zlib/inflate_stream.cpp b/test/beast/zlib/inflate_stream.cpp index 900f78c1c7..03631d96e5 100644 --- a/test/beast/zlib/inflate_stream.cpp +++ b/test/beast/zlib/inflate_stream.cpp @@ -187,7 +187,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string compress( - string_view const& in, + core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel, // 1..9 (8=default) diff --git a/test/bench/buffers/bench_buffers.cpp b/test/bench/buffers/bench_buffers.cpp index fdd00a4703..8af640908b 100644 --- a/test/bench/buffers/bench_buffers.cpp +++ b/test/bench/buffers/bench_buffers.cpp @@ -174,7 +174,7 @@ class buffers_test : public beast::unit_test::suite template void - do_trials(string_view name, + do_trials(core::string_view name, std::size_t trials, F0&& f0, FN... fn) { using namespace std::chrono; diff --git a/test/bench/parser/bench_parser.cpp b/test/bench/parser/bench_parser.cpp index b796b1f795..e79ffe74e8 100644 --- a/test/bench/parser/bench_parser.cpp +++ b/test/bench/parser/bench_parser.cpp @@ -153,21 +153,21 @@ class parser_test : public beast::unit_test::suite { void on_request_impl( - verb, string_view, string_view, + verb, core::string_view, core::string_view, int, error_code&) override { } void on_response_impl( - int, string_view, int, + int, core::string_view, int, error_code&) override { } void on_field_impl( - field, string_view, string_view, + field, core::string_view, core::string_view, error_code&) override { } @@ -186,7 +186,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - string_view, + core::string_view, error_code&) override { return 0; @@ -195,7 +195,7 @@ class parser_test : public beast::unit_test::suite void on_chunk_header_impl( std::uint64_t, - string_view, + core::string_view, error_code&) override { } @@ -203,7 +203,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_chunk_body_impl( std::uint64_t, - string_view, + core::string_view, error_code&) override { return 0; @@ -222,26 +222,26 @@ class parser_test : public beast::unit_test::suite net::mutable_buffer; void - on_request_impl(verb, string_view, - string_view, int, error_code&) override + on_request_impl(verb, core::string_view, + core::string_view, int, error_code&) override { } void on_response_impl(int, - string_view, int, error_code&) override + core::string_view, int, error_code&) override { } void on_field_impl(field, - string_view, string_view, error_code&) override + core::string_view, core::string_view, error_code&) override { } void on_trailer_field_impl(field, - string_view, string_view, error_code&) override + core::string_view, core::string_view, error_code&) override { } @@ -259,20 +259,20 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - string_view s, error_code&) override + core::string_view s, error_code&) override { return s.size(); } void on_chunk_header_impl(std::uint64_t, - string_view, error_code&) override + core::string_view, error_code&) override { } std::size_t on_chunk_body_impl(std::uint64_t, - string_view s, error_code&) override + core::string_view s, error_code&) override { return s.size(); } diff --git a/test/bench/zlib/deflate_stream.cpp b/test/bench/zlib/deflate_stream.cpp index 72c039aaf8..912ddf0f1f 100644 --- a/test/bench/zlib/deflate_stream.cpp +++ b/test/bench/zlib/deflate_stream.cpp @@ -65,7 +65,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateBeast(string_view const& in) + doDeflateBeast(core::string_view const& in) { z_params zs; deflate_stream ds; @@ -88,7 +88,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateZLib(string_view const& in) + doDeflateZLib(core::string_view const& in) { int result; z_stream zs; diff --git a/test/bench/zlib/inflate_stream.cpp b/test/bench/zlib/inflate_stream.cpp index e2c1f5f02f..0c2e7fefe2 100644 --- a/test/bench/zlib/inflate_stream.cpp +++ b/test/bench/zlib/inflate_stream.cpp @@ -66,7 +66,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string - compress(string_view const& in) + compress(core::string_view const& in) { int result; z_stream zs; @@ -98,7 +98,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateBeast(string_view const& in) + doInflateBeast(core::string_view const& in) { z_params zs; std::string out; @@ -125,7 +125,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateZLib(string_view const& in) + doInflateZLib(core::string_view const& in) { int result; z_stream zs; diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 25362d87aa..69fc960922 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -33,13 +33,13 @@ snippets() { //[code_core_1_refresher_1s net::const_buffer cb("Hello, world!", 13); - assert(string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( cb.data()), cb.size()) == "Hello, world!"); char storage[13]; net::mutable_buffer mb(storage, sizeof(storage)); std::memcpy(mb.data(), cb.data(), mb.size()); - assert(string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( mb.data()), mb.size()) == "Hello, world!"); //] } diff --git a/test/doc/core_snippets.cpp b/test/doc/core_snippets.cpp index b4ab125733..d46f5473e0 100644 --- a/test/doc/core_snippets.cpp +++ b/test/doc/core_snippets.cpp @@ -68,7 +68,7 @@ net::connect(stream, r.resolve("www.example.com", "http")); //[snippet_core_3 template -void write_string(SyncWriteStream& stream, string_view s) +void write_string(SyncWriteStream& stream, core::string_view s) { static_assert(is_sync_write_stream::value, "SyncWriteStream type requirements not met"); diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index c09a58b007..5f502cd0e6 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -199,21 +199,21 @@ class Fields @note Only called for requests. */ - string_view + core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - string_view + core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - string_view + core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -236,21 +236,21 @@ class Fields @note Only called for requests. */ void - set_method_impl(string_view s); + set_method_impl(core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(string_view s); + set_target_impl(core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(string_view s); + set_reason_impl(core::string_view s); /** Sets or clears the chunked Transfer-Encoding value */ diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index cc3603a5a8..b0d616119e 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -41,8 +41,8 @@ class custom_parser : public basic_parser void on_request_impl( verb method, // The method verb, verb::unknown if no match - string_view method_str, // The method as a string - string_view target, // The request-target + core::string_view method_str, // The method as a string + core::string_view target, // The request-target int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -67,7 +67,7 @@ class custom_parser : public basic_parser void on_response_impl( int code, // The status-code - string_view reason, // The obsolete reason-phrase + core::string_view reason, // The obsolete reason-phrase int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -90,8 +90,8 @@ class custom_parser : public basic_parser void on_field_impl( field f, // The known-field enumeration constant - string_view name, // The field name string. - string_view value, // The field value + core::string_view name, // The field name string. + core::string_view value, // The field value error_code& ec) override; // The error returned to the caller, if any /** Called once after the complete HTTP header is received. @@ -141,7 +141,7 @@ class custom_parser : public basic_parser */ std::size_t on_body_impl( - string_view s, // A portion of the body + core::string_view s, // A portion of the body error_code& ec) override; // The error returned to the caller, if any /** Called each time a new chunk header of a chunk encoded body is received. @@ -161,7 +161,7 @@ class custom_parser : public basic_parser on_chunk_header_impl( std::uint64_t size, // The size of the upcoming chunk, // or zero for the last chunk - string_view extension, // The chunk extensions (may be empty) + core::string_view extension, // The chunk extensions (may be empty) error_code& ec) override; // The error returned to the caller, if any /** Called each time additional data is received representing part of a body chunk. @@ -191,7 +191,7 @@ class custom_parser : public basic_parser std::uint64_t remain, // The number of bytes remaining in the chunk, // including what is being passed here. // or zero for the last chunk - string_view body, // The next piece of the chunk body + core::string_view body, // The next piece of the chunk body error_code& ec) override; // The error returned to the caller, if any /** Called once when the complete message is received. @@ -216,8 +216,8 @@ class custom_parser : public basic_parser template void custom_parser:: -on_request_impl(verb method, string_view method_str, - string_view path, int version, error_code& ec) +on_request_impl(verb method, core::string_view method_str, + core::string_view path, int version, error_code& ec) { boost::ignore_unused(method, method_str, path, version); ec = {}; @@ -227,7 +227,7 @@ template void custom_parser:: on_response_impl( int status, - string_view reason, + core::string_view reason, int version, error_code& ec) { @@ -239,8 +239,8 @@ template void custom_parser:: on_field_impl( field f, - string_view name, - string_view value, + core::string_view name, + core::string_view value, error_code& ec) { boost::ignore_unused(f, name, value); @@ -266,7 +266,7 @@ on_body_init_impl( template std::size_t custom_parser:: -on_body_impl(string_view body, error_code& ec) +on_body_impl(core::string_view body, error_code& ec) { boost::ignore_unused(body); ec = {}; @@ -277,7 +277,7 @@ template void custom_parser:: on_chunk_header_impl( std::uint64_t size, - string_view extension, + core::string_view extension, error_code& ec) { boost::ignore_unused(size, extension); @@ -288,7 +288,7 @@ template std::size_t custom_parser:: on_chunk_body_impl( std::uint64_t remain, - string_view body, + core::string_view body, error_code& ec) { boost::ignore_unused(remain); diff --git a/test/doc/http_examples.cpp b/test/doc/http_examples.cpp index 6c99f34130..a8ffb565bf 100644 --- a/test/doc/http_examples.cpp +++ b/test/doc/http_examples.cpp @@ -55,7 +55,7 @@ class examples_test template bool - equal_body(string_view sv, string_view body) + equal_body(core::string_view sv, core::string_view body) { test::stream ts{ioc_, sv}; message m; @@ -271,7 +271,7 @@ class examples_test doExplicitChunkSerialize() { auto const buf = - [](string_view s) + [](core::string_view s) { return net::const_buffer{ s.data(), s.size()}; diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 52dfe9ee85..867f115573 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -251,7 +251,7 @@ void fxx() { //[http_snippet_23 // Manually emit a trailer. // We are responsible for ensuring that the trailer format adheres to the specification. - string_view ext = + core::string_view ext = "Content-Digest: f4a5c16584f03d90\r\n" "\r\n"; net::write(sock, make_chunk_last(net::const_buffer{ext.data(), ext.size()})); diff --git a/test/doc/websocket_2_handshaking.cpp b/test/doc/websocket_2_handshaking.cpp index 6dff929dcb..0f2532507b 100644 --- a/test/doc/websocket_2_handshaking.cpp +++ b/test/doc/websocket_2_handshaking.cpp @@ -136,14 +136,14 @@ snippets() //[code_websocket_2_6 // a function to select the most preferred protocol from a comma-separated list - auto select_protocol = [](string_view offered_tokens) -> std::string + auto select_protocol = [](core::string_view offered_tokens) -> std::string { // tokenize the Sec-Websocket-Protocol header offered by the client http::token_list offered( offered_tokens ); // an array of protocols supported by this server // in descending order of preference - static const std::array + static const std::array supported = {{ "v3.my.chat", "v2.my.chat", diff --git a/test/doc/websocket_5_control_frames.cpp b/test/doc/websocket_5_control_frames.cpp index dee0643316..54c587b660 100644 --- a/test/doc/websocket_5_control_frames.cpp +++ b/test/doc/websocket_5_control_frames.cpp @@ -33,7 +33,7 @@ snippets() //[code_websocket_5_1 ws.control_callback( - [](frame_type kind, string_view payload) + [](frame_type kind, core::string_view payload) { // Do something with the payload boost::ignore_unused(kind, payload); diff --git a/test/extras/include/boost/beast/test/fuzz.hpp b/test/extras/include/boost/beast/test/fuzz.hpp index 5491b2e284..f127d8234b 100644 --- a/test/extras/include/boost/beast/test/fuzz.hpp +++ b/test/extras/include/boost/beast/test/fuzz.hpp @@ -92,7 +92,7 @@ fuzz( break; } } - f(string_view{mod.data(), mod.size()}); + f(core::string_view{mod.data(), mod.size()}); if(depth > 0) fuzz(mod, repeat, depth - 1, r, f); } diff --git a/test/fuzz/http_response.cpp b/test/fuzz/http_response.cpp index 5a10fb8bbd..bdc029af07 100644 --- a/test/fuzz/http_response.cpp +++ b/test/fuzz/http_response.cpp @@ -21,7 +21,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) http::chunk_extensions ce; http::response_parser parser; - auto chunk_header_cb = [&ce](std::uint64_t, string_view extensions, error_code& ev) + auto chunk_header_cb = [&ce](std::uint64_t, core::string_view extensions, error_code& ev) { ce.parse(extensions, ev); }; diff --git a/test/fuzz/websocket_server.cpp b/test/fuzz/websocket_server.cpp index 996c6391c8..ab83da5e0e 100644 --- a/test/fuzz/websocket_server.cpp +++ b/test/fuzz/websocket_server.cpp @@ -18,7 +18,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) test::stream remote{ioc}; websocket::stream ws{ - ioc, string_view{reinterpret_cast(data), size}}; + ioc, core::string_view{reinterpret_cast(data), size}}; ws.set_option(websocket::stream_base::decorator( [](websocket::response_type& res) From c30a64c2d854d4a665dd2075d17f5b81e9e697a9 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 10:25:13 -0600 Subject: [PATCH 02/10] Fix remaining comment alignment issues --- include/boost/beast/http/parser.hpp | 8 +++--- include/boost/beast/websocket/stream.hpp | 4 +-- test/doc/http_10_custom_parser.cpp | 32 ++++++++++++------------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index 4eb60281ed..ed4239f1f1 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -237,9 +237,9 @@ class parser @code void on_chunk_header( - std::uint64_t size, // Size of the chunk, zero for the last chunk + std::uint64_t size, // Size of the chunk, zero for the last chunk core::string_view extensions, // The chunk-extensions in raw form - error_code& ec); // May be set by the callback to indicate an error + error_code& ec); // May be set by the callback to indicate an error @endcode */ template @@ -285,9 +285,9 @@ class parser @code std::size_t on_chunk_header( - std::uint64_t remain, // Octets remaining in this chunk, includes `body` + std::uint64_t remain, // Octets remaining in this chunk, includes `body` core::string_view body, // A buffer holding some or all of the remainder of the chunk body - error_code& ec); // May be set by the callback to indicate an error + error_code& ec); // May be set by the callback to indicate an error @endcode */ template diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index 01f92a0ffd..f9e3db5275 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -524,8 +524,8 @@ class stream @code void callback( - frame_type kind, // The type of frame - core::string_view payload // The payload in the frame + frame_type kind, // The type of frame + core::string_view payload // The payload in the frame ); @endcode The implementation type-erases the callback which may require diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index b0d616119e..4d01d91c37 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -40,11 +40,11 @@ class custom_parser : public basic_parser */ void on_request_impl( - verb method, // The method verb, verb::unknown if no match + verb method, // The method verb, verb::unknown if no match core::string_view method_str, // The method as a string core::string_view target, // The request-target - int version, // The HTTP-version - error_code& ec) override; // The error returned to the caller, if any + int version, // The HTTP-version + error_code& ec) override; // The error returned to the caller, if any /** Called after receiving the status-line. @@ -66,10 +66,10 @@ class custom_parser : public basic_parser */ void on_response_impl( - int code, // The status-code + int code, // The status-code core::string_view reason, // The obsolete reason-phrase - int version, // The HTTP-version - error_code& ec) override; // The error returned to the caller, if any + int version, // The HTTP-version + error_code& ec) override; // The error returned to the caller, if any /** Called once for each complete field in the HTTP header. @@ -89,10 +89,10 @@ class custom_parser : public basic_parser */ void on_field_impl( - field f, // The known-field enumeration constant + field f, // The known-field enumeration constant core::string_view name, // The field name string. core::string_view value, // The field value - error_code& ec) override; // The error returned to the caller, if any + error_code& ec) override; // The error returned to the caller, if any /** Called once after the complete HTTP header is received. @@ -142,7 +142,7 @@ class custom_parser : public basic_parser std::size_t on_body_impl( core::string_view s, // A portion of the body - error_code& ec) override; // The error returned to the caller, if any + error_code& ec) override; // The error returned to the caller, if any /** Called each time a new chunk header of a chunk encoded body is received. @@ -159,10 +159,10 @@ class custom_parser : public basic_parser */ void on_chunk_header_impl( - std::uint64_t size, // The size of the upcoming chunk, - // or zero for the last chunk + std::uint64_t size, // The size of the upcoming chunk, + // or zero for the last chunk core::string_view extension, // The chunk extensions (may be empty) - error_code& ec) override; // The error returned to the caller, if any + error_code& ec) override; // The error returned to the caller, if any /** Called each time additional data is received representing part of a body chunk. @@ -188,11 +188,11 @@ class custom_parser : public basic_parser */ std::size_t on_chunk_body_impl( - std::uint64_t remain, // The number of bytes remaining in the chunk, - // including what is being passed here. - // or zero for the last chunk + std::uint64_t remain, // The number of bytes remaining in the chunk, + // including what is being passed here. + // or zero for the last chunk core::string_view body, // The next piece of the chunk body - error_code& ec) override; // The error returned to the caller, if any + error_code& ec) override; // The error returned to the caller, if any /** Called once when the complete message is received. From 727d61fc6dbb3c3c0bd2951ab4fa89b2023259ba Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 11:45:35 -0600 Subject: [PATCH 03/10] Fix namespace qualification for core::string_view throughout codebase Use fully qualified boost::core::string_view instead of core::string_view or beast::string_view to ensure correct namespace resolution in nested boost::beast namespace contexts. This fixes compilation errors across all platforms where the compiler was looking for non-existent types like boost::beast::core::string_view. Fixes CI compilation failures in PR #3058. --- example/doc/http_examples.hpp | 6 +- .../beast/_experimental/test/impl/stream.ipp | 8 +- .../boost/beast/_experimental/test/stream.hpp | 8 +- .../core/detail/impl/temporary_buffer.ipp | 6 +- .../beast/core/detail/static_ostream.hpp | 4 +- include/boost/beast/core/detail/string.hpp | 4 +- .../beast/core/detail/temporary_buffer.hpp | 8 +- include/boost/beast/core/impl/string.ipp | 8 +- .../boost/beast/core/impl/string_param.hpp | 6 +- include/boost/beast/core/string.hpp | 16 ++-- include/boost/beast/core/string_param.hpp | 14 +-- include/boost/beast/core/string_type.hpp | 4 +- include/boost/beast/http/basic_parser.hpp | 22 ++--- include/boost/beast/http/chunk_encode.hpp | 28 +++--- .../beast/http/detail/basic_parsed_list.hpp | 4 +- .../boost/beast/http/detail/basic_parser.hpp | 14 +-- .../boost/beast/http/detail/basic_parser.ipp | 12 +-- .../boost/beast/http/detail/chunk_encode.hpp | 2 +- include/boost/beast/http/detail/rfc7230.hpp | 10 +-- include/boost/beast/http/detail/rfc7230.ipp | 8 +- .../boost/beast/http/detail/type_traits.hpp | 30 +++---- include/boost/beast/http/field.hpp | 4 +- include/boost/beast/http/fields.hpp | 86 +++++++++---------- .../boost/beast/http/impl/basic_parser.ipp | 20 ++--- .../boost/beast/http/impl/chunk_encode.hpp | 16 ++-- include/boost/beast/http/impl/field.ipp | 14 +-- include/boost/beast/http/impl/fields.hpp | 82 +++++++++--------- include/boost/beast/http/impl/fields.ipp | 6 +- include/boost/beast/http/impl/message.hpp | 18 ++-- include/boost/beast/http/impl/rfc7230.hpp | 2 +- include/boost/beast/http/impl/rfc7230.ipp | 16 ++-- include/boost/beast/http/impl/status.ipp | 2 +- include/boost/beast/http/impl/verb.ipp | 4 +- include/boost/beast/http/message.hpp | 26 +++--- .../boost/beast/http/message_generator.hpp | 2 +- include/boost/beast/http/parser.hpp | 42 ++++----- include/boost/beast/http/rfc7230.hpp | 24 +++--- include/boost/beast/http/status.hpp | 2 +- include/boost/beast/http/verb.hpp | 4 +- .../boost/beast/websocket/detail/hybi13.hpp | 2 +- .../boost/beast/websocket/detail/hybi13.ipp | 2 +- .../beast/websocket/detail/pmd_extension.hpp | 2 +- .../beast/websocket/detail/pmd_extension.ipp | 2 +- include/boost/beast/websocket/impl/accept.hpp | 4 +- .../boost/beast/websocket/impl/handshake.hpp | 28 +++--- include/boost/beast/websocket/impl/stream.hpp | 2 +- .../beast/websocket/impl/stream_impl.hpp | 4 +- include/boost/beast/websocket/rfc6455.hpp | 4 +- include/boost/beast/websocket/stream.hpp | 32 +++---- test/beast/_experimental/icy_stream.cpp | 2 +- test/beast/core/_detail_base64.cpp | 4 +- test/beast/core/basic_stream.cpp | 10 +-- test/beast/core/bind_handler.cpp | 10 +-- test/beast/core/buffers_cat.cpp | 2 +- test/beast/core/buffers_range.cpp | 2 +- test/beast/core/buffers_suffix.cpp | 2 +- test/beast/core/detect_ssl.cpp | 6 +- test/beast/core/file_test.hpp | 2 +- test/beast/core/flat_buffer.cpp | 2 +- test/beast/core/flat_static_buffer.cpp | 2 +- test/beast/core/make_printable.cpp | 2 +- test/beast/core/multi_buffer.cpp | 4 +- test/beast/core/ostream.cpp | 8 +- test/beast/core/static_buffer.cpp | 2 +- test/beast/core/static_string.cpp | 26 +++--- test/beast/core/test_buffer.hpp | 16 ++-- test/beast/http/basic_parser.cpp | 32 +++---- test/beast/http/chunk_encode.cpp | 14 +-- test/beast/http/field.cpp | 4 +- test/beast/http/fields.cpp | 28 +++--- test/beast/http/file_body.cpp | 8 +- test/beast/http/message.cpp | 26 +++--- test/beast/http/message_fuzz.hpp | 2 +- test/beast/http/parser.cpp | 4 +- test/beast/http/read.cpp | 14 +-- test/beast/http/rfc7230.cpp | 12 +-- test/beast/http/test_parser.hpp | 20 ++--- test/beast/http/verb.cpp | 2 +- test/beast/http/write.cpp | 2 +- test/beast/websocket/accept.cpp | 4 +- test/beast/websocket/close.cpp | 10 +-- test/beast/websocket/handshake.cpp | 12 +-- test/beast/websocket/ping.cpp | 8 +- test/beast/websocket/read1.cpp | 2 +- test/beast/websocket/read2.cpp | 16 ++-- test/beast/websocket/read3.cpp | 14 +-- test/beast/websocket/test.hpp | 60 ++++++------- test/beast/websocket/timer.cpp | 2 +- test/beast/websocket/write.cpp | 2 +- test/beast/zlib/deflate_stream.cpp | 8 +- test/beast/zlib/inflate_stream.cpp | 2 +- test/bench/buffers/bench_buffers.cpp | 2 +- test/bench/parser/bench_parser.cpp | 28 +++--- test/bench/zlib/deflate_stream.cpp | 4 +- test/bench/zlib/inflate_stream.cpp | 6 +- test/doc/core_1_refresher.cpp | 4 +- test/doc/core_snippets.cpp | 2 +- test/doc/exemplars.cpp | 12 +-- test/doc/http_10_custom_parser.cpp | 32 +++---- test/doc/http_examples.cpp | 4 +- test/doc/http_snippets.cpp | 2 +- test/doc/websocket_2_handshaking.cpp | 4 +- test/doc/websocket_5_control_frames.cpp | 2 +- test/extras/include/boost/beast/test/fuzz.hpp | 2 +- test/fuzz/http_response.cpp | 2 +- test/fuzz/websocket_server.cpp | 2 +- 106 files changed, 596 insertions(+), 596 deletions(-) diff --git a/example/doc/http_examples.hpp b/example/doc/http_examples.hpp index 95e01f3f05..4165b27c0a 100644 --- a/example/doc/http_examples.hpp +++ b/example/doc/http_examples.hpp @@ -376,7 +376,7 @@ response do_head_request( SyncStream& stream, DynamicBuffer& buffer, - core::string_view target, + boost::core::string_view target, error_code& ec) { // Do some type checking to be a good citizen @@ -979,7 +979,7 @@ print_chunked_body( // after each chunk header and also after the last chunk. auto header_cb = [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk - core::string_view extensions, // The raw chunk-extensions string. Already validated. + boost::core::string_view extensions, // The raw chunk-extensions string. Already validated. error_code& ev) // We can set this to indicate an error { // Parse the chunk extensions so we can access them easily @@ -1008,7 +1008,7 @@ print_chunked_body( // more times for each piece of a chunk body. auto body_cb = [&](std::uint64_t remain, // The number of bytes left in this chunk - core::string_view body, // A buffer holding chunk body data + boost::core::string_view body, // A buffer holding chunk body data error_code& ec) // We can set this to indicate an error { // If this is the last piece of the chunk body, diff --git a/include/boost/beast/_experimental/test/impl/stream.ipp b/include/boost/beast/_experimental/test/impl/stream.ipp index 790c17df07..4b1cd715b5 100644 --- a/include/boost/beast/_experimental/test/impl/stream.ipp +++ b/include/boost/beast/_experimental/test/impl/stream.ipp @@ -123,7 +123,7 @@ template basic_stream:: basic_stream( net::io_context& ioc, - core::string_view s) + boost::core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), nullptr)) { in_->b.commit(net::buffer_copy( @@ -136,7 +136,7 @@ basic_stream:: basic_stream( net::io_context& ioc, fail_count& fc, - core::string_view s) + boost::core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), &fc)) { in_->b.commit(net::buffer_copy( @@ -161,7 +161,7 @@ connect(basic_stream& remote) } template -core::string_view +boost::core::string_view basic_stream:: str() const { @@ -175,7 +175,7 @@ str() const template void basic_stream:: -append(core::string_view s) +append(boost::core::string_view s) { std::lock_guard lock{in_->m}; in_->b.commit(net::buffer_copy( diff --git a/include/boost/beast/_experimental/test/stream.hpp b/include/boost/beast/_experimental/test/stream.hpp index a7689b3e7b..9d997dd6ed 100644 --- a/include/boost/beast/_experimental/test/stream.hpp +++ b/include/boost/beast/_experimental/test/stream.hpp @@ -281,7 +281,7 @@ class basic_stream */ basic_stream( net::io_context& ioc, - core::string_view s); + boost::core::string_view s); /** Construct a stream @@ -301,7 +301,7 @@ class basic_stream basic_stream( net::io_context& ioc, fail_count& fc, - core::string_view s); + boost::core::string_view s); /// Establish a connection void @@ -333,12 +333,12 @@ class basic_stream } /// Returns a string view representing the pending input data - core::string_view + boost::core::string_view str() const; /// Appends a string to the pending input data void - append(core::string_view s); + append(boost::core::string_view s); /// Clear the pending input area void diff --git a/include/boost/beast/core/detail/impl/temporary_buffer.ipp b/include/boost/beast/core/detail/impl/temporary_buffer.ipp index 9ea06be1a5..46ee97e6a5 100644 --- a/include/boost/beast/core/detail/impl/temporary_buffer.ipp +++ b/include/boost/beast/core/detail/impl/temporary_buffer.ipp @@ -23,7 +23,7 @@ namespace detail { void temporary_buffer:: -append(core::string_view s) +append(boost::core::string_view s) { grow(s.size()); unchecked_append(s); @@ -31,7 +31,7 @@ append(core::string_view s) void temporary_buffer:: -append(core::string_view s1, core::string_view s2) +append(boost::core::string_view s1, boost::core::string_view s2) { grow(s1.size() + s2.size()); unchecked_append(s1); @@ -40,7 +40,7 @@ append(core::string_view s1, core::string_view s2) void temporary_buffer:: -unchecked_append(core::string_view s) +unchecked_append(boost::core::string_view s) { auto n = s.size(); std::memcpy(&data_[size_], s.data(), n); diff --git a/include/boost/beast/core/detail/static_ostream.hpp b/include/boost/beast/core/detail/static_ostream.hpp index 22014b6175..d4bc800d07 100644 --- a/include/boost/beast/core/detail/static_ostream.hpp +++ b/include/boost/beast/core/detail/static_ostream.hpp @@ -50,7 +50,7 @@ class static_ostream_buffer { } - core::string_view + boost::core::string_view str() const { if(! s_.empty()) @@ -128,7 +128,7 @@ class static_ostream : public std::basic_ostream imbue(std::locale::classic()); } - core::string_view + boost::core::string_view str() const { return osb_.str(); diff --git a/include/boost/beast/core/detail/string.hpp b/include/boost/beast/core/detail/string.hpp index bf7b059549..e734767fb1 100644 --- a/include/boost/beast/core/detail/string.hpp +++ b/include/boost/beast/core/detail/string.hpp @@ -22,10 +22,10 @@ namespace detail { namespace string_literals { inline -core::string_view +boost::core::string_view operator""_sv(char const* p, std::size_t n) { - return core::string_view{p, n}; + return boost::core::string_view{p, n}; } } // string_literals diff --git a/include/boost/beast/core/detail/temporary_buffer.hpp b/include/boost/beast/core/detail/temporary_buffer.hpp index 14526b1333..dff07bd625 100644 --- a/include/boost/beast/core/detail/temporary_buffer.hpp +++ b/include/boost/beast/core/detail/temporary_buffer.hpp @@ -32,13 +32,13 @@ struct temporary_buffer BOOST_BEAST_DECL void - append(core::string_view s); + append(boost::core::string_view s); BOOST_BEAST_DECL void - append(core::string_view s1, core::string_view s2); + append(boost::core::string_view s1, boost::core::string_view s2); - core::string_view + boost::core::string_view view() const noexcept { return {data_, size_}; @@ -53,7 +53,7 @@ struct temporary_buffer private: BOOST_BEAST_DECL void - unchecked_append(core::string_view s); + unchecked_append(boost::core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/core/impl/string.ipp b/include/boost/beast/core/impl/string.ipp index 62f9b07cfe..4f3c53d9cb 100644 --- a/include/boost/beast/core/impl/string.ipp +++ b/include/boost/beast/core/impl/string.ipp @@ -20,8 +20,8 @@ namespace beast { bool iequals( - beast::string_view lhs, - beast::string_view rhs) + boost::core::string_view lhs, + boost::core::string_view rhs) { if(lhs.size() != rhs.size()) return false; @@ -50,8 +50,8 @@ slow: bool iless::operator()( - core::string_view lhs, - core::string_view rhs) const + boost::core::string_view lhs, + boost::core::string_view rhs) const { using std::begin; using std::end; diff --git a/include/boost/beast/core/impl/string_param.hpp b/include/boost/beast/core/impl/string_param.hpp index 4ec1028e33..9653cf1a36 100644 --- a/include/boost/beast/core/impl/string_param.hpp +++ b/include/boost/beast/core/impl/string_param.hpp @@ -30,7 +30,7 @@ print(T const& t) template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type string_param:: print(T const& t) @@ -44,7 +44,7 @@ print(T const& t) inline void string_param:: -print(core::string_view sv) +print(boost::core::string_view sv) { sv_ = sv; } @@ -60,7 +60,7 @@ print_1(T const& t) auto const it = detail::raw_to_string< char, T, std::char_traits>( last, sizeof(buf), t); - *os_ << core::string_view{it, + *os_ << boost::core::string_view{it, static_cast(last - it)}; } diff --git a/include/boost/beast/core/string.hpp b/include/boost/beast/core/string.hpp index 1dbec3172a..9c61a4f534 100644 --- a/include/boost/beast/core/string.hpp +++ b/include/boost/beast/core/string.hpp @@ -27,8 +27,8 @@ namespace beast { BOOST_BEAST_DECL bool iequals( - beast::string_view lhs, - beast::string_view rhs); + boost::core::string_view lhs, + boost::core::string_view rhs); /** A case-insensitive less predicate for strings. @@ -36,15 +36,15 @@ iequals( As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref core::string_view. + @ref boost::core::string_view. */ struct iless { BOOST_BEAST_DECL bool operator()( - core::string_view lhs, - core::string_view rhs) const; + boost::core::string_view lhs, + boost::core::string_view rhs) const; using is_transparent = void; }; @@ -55,14 +55,14 @@ struct iless As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref core::string_view. + @ref boost::core::string_view. */ struct iequal { bool operator()( - core::string_view lhs, - core::string_view rhs) const + boost::core::string_view lhs, + boost::core::string_view rhs) const { return iequals(lhs, rhs); } diff --git a/include/boost/beast/core/string_param.hpp b/include/boost/beast/core/string_param.hpp index 16f0edbc7a..8decb6713f 100644 --- a/include/boost/beast/core/string_param.hpp +++ b/include/boost/beast/core/string_param.hpp @@ -43,7 +43,7 @@ namespace beast { */ class string_param { - core::string_view sv_; + boost::core::string_view sv_; char buf_[128]; boost::optional os_; @@ -55,12 +55,12 @@ class string_param template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type print(T const&); void - print(core::string_view); + print(boost::core::string_view); template typename std::enable_if< @@ -98,7 +98,7 @@ class string_param the result of streaming each argument in order into an output stream. It is used as a notational convenience at call sites which expect a parameter with the semantics - of a @ref core::string_view. + of a @ref boost::core::string_view. The implementation uses a small, internal static buffer to avoid memory allocations especially for the case where @@ -111,14 +111,14 @@ class string_param string_param(Args const&... args); /// Returns the contained string - core::string_view + boost::core::string_view str() const { return sv_; } - /// Implicit conversion to @ref core::string_view - operator core::string_view const() const + /// Implicit conversion to @ref boost::core::string_view + operator boost::core::string_view const() const { return sv_; } diff --git a/include/boost/beast/core/string_type.hpp b/include/boost/beast/core/string_type.hpp index 5c09c7172d..1c08a501ad 100644 --- a/include/boost/beast/core/string_type.hpp +++ b/include/boost/beast/core/string_type.hpp @@ -17,10 +17,10 @@ namespace boost { namespace beast { template -inline core::string_view +inline boost::core::string_view to_string_view(const S& s) { - return core::string_view(s.data(), s.size()); + return boost::core::string_view(s.data(), s.size()); } } // beast diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index 392d25bbcb..44c87eb9e7 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -461,8 +461,8 @@ class basic_parser void on_request_impl( verb method, - core::string_view method_str, - core::string_view target, + boost::core::string_view method_str, + boost::core::string_view target, int version, error_code& ec) = 0; @@ -488,7 +488,7 @@ class basic_parser void on_response_impl( int code, - core::string_view reason, + boost::core::string_view reason, int version, error_code& ec) = 0; @@ -512,8 +512,8 @@ class basic_parser void on_field_impl( field name, - core::string_view name_string, - core::string_view value, + boost::core::string_view name_string, + boost::core::string_view value, error_code& ec) = 0; /** Called once for each complete field in the HTTP trailer header. @@ -536,8 +536,8 @@ class basic_parser void on_trailer_field_impl( field name, - core::string_view name_string, - core::string_view value, + boost::core::string_view name_string, + boost::core::string_view value, error_code& ec) = 0; /** Called once after the complete HTTP header is received. @@ -587,7 +587,7 @@ class basic_parser virtual std::size_t on_body_impl( - core::string_view body, + boost::core::string_view body, error_code& ec) = 0; /** Called each time a new chunk header of a chunk encoded body is received. @@ -607,7 +607,7 @@ class basic_parser void on_chunk_header_impl( std::uint64_t size, - core::string_view extensions, + boost::core::string_view extensions, error_code& ec) = 0; /** Called each time additional data is received representing part of a body chunk. @@ -636,7 +636,7 @@ class basic_parser std::size_t on_chunk_body_impl( std::uint64_t remain, - core::string_view body, + boost::core::string_view body, error_code& ec) = 0; /** Called once when the complete message is received. @@ -714,7 +714,7 @@ class basic_parser void do_field(field f, - core::string_view value, error_code& ec); + boost::core::string_view value, error_code& ec); }; } // http diff --git a/include/boost/beast/http/chunk_encode.hpp b/include/boost/beast/http/chunk_encode.hpp index d46a392eae..7674560709 100644 --- a/include/boost/beast/http/chunk_encode.hpp +++ b/include/boost/beast/http/chunk_encode.hpp @@ -154,7 +154,7 @@ class chunk_header */ chunk_header( std::size_t size, - core::string_view extensions); + boost::core::string_view extensions); /** Constructor @@ -169,7 +169,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref core::string_view. This object will be copied + be convertible to @ref boost::core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -202,7 +202,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref core::string_view. This object will be copied + be convertible to @ref boost::core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -342,7 +342,7 @@ class chunk_body */ chunk_body( ConstBufferSequence const& buffers, - core::string_view extensions); + boost::core::string_view extensions); /** Constructor @@ -360,7 +360,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref core::string_view. This object will be copied + be convertible to @ref boost::core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -373,7 +373,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, core::string_view>::value>::type + ChunkExtensions>::type, boost::core::string_view>::value>::type #endif > chunk_body( @@ -396,7 +396,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref core::string_view. This object will be copied + be convertible to @ref boost::core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -412,7 +412,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, core::string_view>::value>::type + ChunkExtensions>::type, boost::core::string_view>::value>::type #endif > chunk_body( @@ -582,7 +582,7 @@ class basic_chunk_extensions do_parse(FwdIt it, FwdIt last, error_code& ec); void - do_insert(core::string_view name, core::string_view value); + do_insert(boost::core::string_view name, boost::core::string_view value); public: /** The type of value when iterating. @@ -591,7 +591,7 @@ class basic_chunk_extensions element is the value which may be empty. The value is stored in its raw representation, without quotes or escapes. */ - using value_type = std::pair; + using value_type = std::pair; class const_iterator; @@ -630,14 +630,14 @@ class basic_chunk_extensions Any previous extensions will be cleared */ void - parse(core::string_view s, error_code& ec); + parse(boost::core::string_view s, error_code& ec); /** Insert an extension name with an empty value @param name The name of the extension */ void - insert(core::string_view name); + insert(boost::core::string_view name); /** Insert an extension value @@ -647,10 +647,10 @@ class basic_chunk_extensions contents, the serialized extension may use a quoted string. */ void - insert(core::string_view name, core::string_view value); + insert(boost::core::string_view name, boost::core::string_view value); /// Return the serialized representation of the chunk extension - core::string_view + boost::core::string_view str() const { return s_; diff --git a/include/boost/beast/http/detail/basic_parsed_list.hpp b/include/boost/beast/http/detail/basic_parsed_list.hpp index 764271e3d3..3ffd65a4ac 100644 --- a/include/boost/beast/http/detail/basic_parsed_list.hpp +++ b/include/boost/beast/http/detail/basic_parsed_list.hpp @@ -25,7 +25,7 @@ namespace detail { template class basic_parsed_list { - core::string_view s_; + boost::core::string_view s_; public: /// The type of policy this list uses for parsing. @@ -130,7 +130,7 @@ class basic_parsed_list /// Construct a list from a string explicit - basic_parsed_list(core::string_view s) + basic_parsed_list(boost::core::string_view s) : s_(s) { } diff --git a/include/boost/beast/http/detail/basic_parser.hpp b/include/boost/beast/http/detail/basic_parser.hpp index c998bb2a5b..e5cbc57bd0 100644 --- a/include/boost/beast/http/detail/basic_parser.hpp +++ b/include/boost/beast/http/detail/basic_parser.hpp @@ -74,7 +74,7 @@ struct basic_parser_base char const* it, char const* first); static - core::string_view + boost::core::string_view make_string(char const* first, char const* last) { return {first, static_cast< @@ -123,7 +123,7 @@ struct basic_parser_base BOOST_BEAST_DECL static bool - parse_dec(core::string_view s, std::uint64_t& v); + parse_dec(boost::core::string_view s, std::uint64_t& v); BOOST_BEAST_DECL static @@ -140,14 +140,14 @@ struct basic_parser_base void parse_method( char const*& it, char const* last, - core::string_view& result, error_code& ec); + boost::core::string_view& result, error_code& ec); BOOST_BEAST_DECL static void parse_target( char const*& it, char const* last, - core::string_view& result, error_code& ec); + boost::core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -168,7 +168,7 @@ struct basic_parser_base void parse_reason( char const*& it, char const* last, - core::string_view& result, error_code& ec); + boost::core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -176,8 +176,8 @@ struct basic_parser_base parse_field( char const*& p, char const* last, - core::string_view& name, - core::string_view& value, + boost::core::string_view& name, + boost::core::string_view& value, beast::detail::char_buffer& buf, error_code& ec); diff --git a/include/boost/beast/http/detail/basic_parser.ipp b/include/boost/beast/http/detail/basic_parser.ipp index 105468d1e0..e725b820f8 100644 --- a/include/boost/beast/http/detail/basic_parser.ipp +++ b/include/boost/beast/http/detail/basic_parser.ipp @@ -155,7 +155,7 @@ find_eol( bool basic_parser_base:: parse_dec( - core::string_view s, + boost::core::string_view s, std::uint64_t& v) { char const* it = s.data(); @@ -271,7 +271,7 @@ void basic_parser_base:: parse_method( char const*& it, char const* last, - core::string_view& result, error_code& ec) + boost::core::string_view& result, error_code& ec) { // parse token SP auto const first = it; @@ -308,7 +308,7 @@ void basic_parser_base:: parse_target( char const*& it, char const* last, - core::string_view& result, error_code& ec) + boost::core::string_view& result, error_code& ec) { // parse target SP auto const first = it; @@ -437,7 +437,7 @@ void basic_parser_base:: parse_reason( char const*& it, char const* last, - core::string_view& result, error_code& ec) + boost::core::string_view& result, error_code& ec) { auto const first = it; char const* token_last = nullptr; @@ -459,8 +459,8 @@ basic_parser_base:: parse_field( char const*& p, char const* last, - core::string_view& name, - core::string_view& value, + boost::core::string_view& name, + boost::core::string_view& value, beast::detail::char_buffer& buf, error_code& ec) { diff --git a/include/boost/beast/http/detail/chunk_encode.hpp b/include/boost/beast/http/detail/chunk_encode.hpp index dba405d2ec..75643c69f8 100644 --- a/include/boost/beast/http/detail/chunk_encode.hpp +++ b/include/boost/beast/http/detail/chunk_encode.hpp @@ -56,7 +56,7 @@ struct is_chunk_extensions : std::false_type {}; template struct is_chunk_extensions() = std::declval().str() + std::declval() = std::declval().str() )>> : std::true_type { }; diff --git a/include/boost/beast/http/detail/rfc7230.hpp b/include/boost/beast/http/detail/rfc7230.hpp index 91c5c7504e..4b45fb3aa5 100644 --- a/include/boost/beast/http/detail/rfc7230.hpp +++ b/include/boost/beast/http/detail/rfc7230.hpp @@ -58,8 +58,8 @@ std::int8_t unhex(char c); BOOST_BEAST_DECL -core::string_view -trim(core::string_view s); +boost::core::string_view +trim(boost::core::string_view s); struct param_iter { @@ -68,7 +68,7 @@ struct param_iter iter_type it; iter_type first; iter_type last; - std::pair v; + std::pair v; bool empty() const @@ -86,12 +86,12 @@ struct param_iter */ struct opt_token_list_policy { - using value_type = core::string_view; + using value_type = boost::core::string_view; BOOST_BEAST_DECL bool operator()(value_type& v, - char const*& it, core::string_view s) const; + char const*& it, boost::core::string_view s) const; }; } // detail diff --git a/include/boost/beast/http/detail/rfc7230.ipp b/include/boost/beast/http/detail/rfc7230.ipp index 144e1883b3..b5d0ff1add 100644 --- a/include/boost/beast/http/detail/rfc7230.ipp +++ b/include/boost/beast/http/detail/rfc7230.ipp @@ -239,8 +239,8 @@ skip_token(ForwardIt& it, ForwardIt last) ++it; } -core::string_view -trim(core::string_view s) +boost::core::string_view +trim(boost::core::string_view s) { auto first = s.begin(); auto last = s.end(); @@ -344,7 +344,7 @@ increment() bool opt_token_list_policy::operator()(value_type& v, - char const*& it, core::string_view s) const + char const*& it, boost::core::string_view s) const { v = {}; auto need_comma = it != s.data(); @@ -370,7 +370,7 @@ opt_token_list_policy::operator()(value_type& v, if(! detail::is_token_char(*it)) break; } - v = core::string_view{p0, + v = boost::core::string_view{p0, static_cast(it - p0)}; return true; } diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index ee2a483164..3d96dfac1f 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -45,20 +45,20 @@ struct fields_model { struct writer; - core::string_view method() const; - core::string_view reason() const; - core::string_view target() const; + boost::core::string_view method() const; + boost::core::string_view reason() const; + boost::core::string_view target() const; protected: - core::string_view get_method_impl() const; - core::string_view get_target_impl() const; - core::string_view get_reason_impl() const; + boost::core::string_view get_method_impl() const; + boost::core::string_view get_target_impl() const; + boost::core::string_view get_reason_impl() const; bool get_chunked_impl() const; bool get_keep_alive_impl(unsigned) const; bool has_content_length_impl() const; - void set_method_impl(core::string_view); - void set_target_impl(core::string_view); - void set_reason_impl(core::string_view); + void set_method_impl(boost::core::string_view); + void set_target_impl(boost::core::string_view); + void set_reason_impl(boost::core::string_view); void set_chunked_impl(bool); void set_content_length_impl(boost::optional); void set_keep_alive_impl(unsigned, bool); @@ -93,21 +93,21 @@ struct is_fields_helper : T { template static auto f1(int) -> decltype( - std::declval() = std::declval().get_method_impl(), + std::declval() = std::declval().get_method_impl(), std::true_type()); static auto f1(...) -> std::false_type; using t1 = decltype(f1(0)); template static auto f2(int) -> decltype( - std::declval() = std::declval().get_target_impl(), + std::declval() = std::declval().get_target_impl(), std::true_type()); static auto f2(...) -> std::false_type; using t2 = decltype(f2(0)); template static auto f3(int) -> decltype( - std::declval() = std::declval().get_reason_impl(), + std::declval() = std::declval().get_reason_impl(), std::true_type()); static auto f3(...) -> std::false_type; using t3 = decltype(f3(0)); @@ -136,21 +136,21 @@ struct is_fields_helper : T template static auto f7(int) -> decltype( - void(std::declval().set_method_impl(std::declval())), + void(std::declval().set_method_impl(std::declval())), std::true_type()); static auto f7(...) -> std::false_type; using t7 = decltype(f7(0)); template static auto f8(int) -> decltype( - void(std::declval().set_target_impl(std::declval())), + void(std::declval().set_target_impl(std::declval())), std::true_type()); static auto f8(...) -> std::false_type; using t8 = decltype(f8(0)); template static auto f9(int) -> decltype( - void(std::declval().set_reason_impl(std::declval())), + void(std::declval().set_reason_impl(std::declval())), std::true_type()); static auto f9(...) -> std::false_type; using t9 = decltype(f9(0)); diff --git a/include/boost/beast/http/field.hpp b/include/boost/beast/http/field.hpp index 6fad94ab4f..15bc4cd5dd 100644 --- a/include/boost/beast/http/field.hpp +++ b/include/boost/beast/http/field.hpp @@ -157,7 +157,7 @@ namespace http { @param f The field to convert */ BOOST_BEAST_DECL -core::string_view +boost::core::string_view to_string(field f); /** Attempt to convert a string to a field enum. @@ -169,7 +169,7 @@ to_string(field f); */ BOOST_BEAST_DECL field -string_to_field(core::string_view s); +string_to_field(boost::core::string_view s); /// Write the text for a field name to an output stream. BOOST_BEAST_DECL diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 0412cb8c72..67aa93406a 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -91,7 +91,7 @@ class basic_fields protected: value_type(field name, - core::string_view sname, core::string_view value); + boost::core::string_view sname, boost::core::string_view value); public: /// Constructor (deleted) @@ -105,11 +105,11 @@ class basic_fields name() const; /// Returns the field name as a string - core::string_view const + boost::core::string_view const name_string() const; /// Returns the value of the field - core::string_view const + boost::core::string_view const value() const; }; @@ -126,7 +126,7 @@ class basic_fields /// Returns `true` if lhs is less than rhs using a strict ordering bool operator()( - core::string_view lhs, + boost::core::string_view lhs, value_type const& rhs) const noexcept { if(lhs.size() < rhs.name_string().size()) @@ -140,7 +140,7 @@ class basic_fields bool operator()( value_type const& lhs, - core::string_view rhs) const noexcept + boost::core::string_view rhs) const noexcept { if(lhs.name_string().size() < rhs.size()) return true; @@ -181,7 +181,7 @@ class basic_fields , public value_type { element(field name, - core::string_view sname, core::string_view value); + boost::core::string_view sname, boost::core::string_view value); }; using list_t = typename boost::intrusive::make_list< @@ -327,7 +327,7 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - core::string_view const + boost::core::string_view const at(field name) const; /** Returns the value for a field, or throws an exception. @@ -341,8 +341,8 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - core::string_view const - at(core::string_view name) const; + boost::core::string_view const + at(boost::core::string_view name) const; /** Returns the value for a field, or `""` if it does not exist. @@ -351,7 +351,7 @@ class basic_fields @param name The name of the field. */ - core::string_view const + boost::core::string_view const operator[](field name) const; /** Returns the value for a case-insensitive matching header, or `""` if it does not exist. @@ -361,8 +361,8 @@ class basic_fields @param name The name of the field. It is interpreted as a case-insensitive string. */ - core::string_view const - operator[](core::string_view name) const; + boost::core::string_view const + operator[](boost::core::string_view name) const; //-------------------------------------------------------------------------- // @@ -450,7 +450,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, core::string_view value); + insert(field name, boost::core::string_view value); void insert(field, std::nullptr_t) = delete; @@ -473,10 +473,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(core::string_view name, core::string_view value); + insert(boost::core::string_view name, boost::core::string_view value); void - insert(core::string_view, std::nullptr_t) = delete; + insert(boost::core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -501,11 +501,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, core::string_view name_string, - core::string_view value); + insert(field name, boost::core::string_view name_string, + boost::core::string_view value); void - insert(field, core::string_view, std::nullptr_t) = delete; + insert(field, boost::core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -530,11 +530,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, core::string_view name_string, - core::string_view value, error_code& ec); + insert(field name, boost::core::string_view name_string, + boost::core::string_view value, error_code& ec); void - insert(field, core::string_view, std::nullptr_t, error_code& ec) = delete; + insert(field, boost::core::string_view, std::nullptr_t, error_code& ec) = delete; /** Set a field value, removing any other instances of that field. @@ -550,7 +550,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(field name, core::string_view value); + set(field name, boost::core::string_view value); void set(field, std::nullptr_t) = delete; @@ -571,10 +571,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(core::string_view name, core::string_view value); + set(boost::core::string_view name, boost::core::string_view value); void - set(core::string_view, std::nullptr_t) = delete; + set(boost::core::string_view, std::nullptr_t) = delete; /** Remove a field. @@ -619,7 +619,7 @@ class basic_fields @return The number of fields removed. */ std::size_t - erase(core::string_view name); + erase(boost::core::string_view name); /** Return a buffer sequence representing the trailers. @@ -659,7 +659,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ bool - contains(core::string_view name) const; + contains(boost::core::string_view name) const; /** Return the number of fields with the specified name. @@ -673,7 +673,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ std::size_t - count(core::string_view name) const; + count(boost::core::string_view name) const; /** Returns an iterator to the case-insensitive matching field. @@ -699,7 +699,7 @@ class basic_fields no match was found. */ const_iterator - find(core::string_view name) const; + find(boost::core::string_view name) const; /** Returns a range of iterators to the fields with the specified name. @@ -721,7 +721,7 @@ class basic_fields /// @copydoc boost::beast::http::basic_fields::equal_range(boost::beast::http::field) const std::pair - equal_range(core::string_view name) const; + equal_range(boost::core::string_view name) const; //-------------------------------------------------------------------------- // @@ -741,21 +741,21 @@ class basic_fields @note Only called for requests. */ - core::string_view + boost::core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - core::string_view + boost::core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - core::string_view + boost::core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -778,21 +778,21 @@ class basic_fields @note Only called for requests. */ void - set_method_impl(core::string_view s); + set_method_impl(boost::core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(core::string_view s); + set_target_impl(boost::core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(core::string_view s); + set_reason_impl(boost::core::string_view s); /** Adjusts the chunked Transfer-Encoding value */ @@ -818,15 +818,15 @@ class basic_fields element* try_create_new_element( field name, - core::string_view sname, - core::string_view value, + boost::core::string_view sname, + boost::core::string_view value, error_code& ec); element& new_element( field name, - core::string_view sname, - core::string_view value); + boost::core::string_view sname, + boost::core::string_view value); void insert_element(element& e); @@ -838,11 +838,11 @@ class basic_fields set_element(element& e); void - realloc_string(core::string_view& dest, core::string_view s); + realloc_string(boost::core::string_view& dest, boost::core::string_view s); void realloc_target( - core::string_view& dest, core::string_view s); + boost::core::string_view& dest, boost::core::string_view s); template void @@ -874,8 +874,8 @@ class basic_fields set_t set_; list_t list_; - core::string_view method_; - core::string_view target_or_reason_; + boost::core::string_view method_; + boost::core::string_view target_or_reason_; }; #if BOOST_BEAST_DOXYGEN diff --git a/include/boost/beast/http/impl/basic_parser.ipp b/include/boost/beast/http/impl/basic_parser.ipp index 6d918aba82..cadfa59b26 100644 --- a/include/boost/beast/http/impl/basic_parser.ipp +++ b/include/boost/beast/http/impl/basic_parser.ipp @@ -236,12 +236,12 @@ inner_parse_start_line( */ auto p = in; - core::string_view method; + boost::core::string_view method; parse_method(p, last, method, ec); if(ec) return; - core::string_view target; + boost::core::string_view target; parse_target(p, last, target, ec); if(ec) return; @@ -321,7 +321,7 @@ inner_parse_start_line( return; // parse reason CRLF - core::string_view reason; + boost::core::string_view reason; parse_reason(p, last, reason, ec); if(ec) return; @@ -361,8 +361,8 @@ basic_parser:: inner_parse_fields(char const*& in, char const* last, error_code& ec) { - core::string_view name; - core::string_view value; + boost::core::string_view name; + boost::core::string_view value; // https://stackoverflow.com/questions/686217/maximum-on-http-header-values beast::detail::char_buffer buf; auto p = in; @@ -533,7 +533,7 @@ parse_body(char const*& p, std::size_t n, error_code& ec) { ec = {}; - n = this->on_body_impl(core::string_view{p, + n = this->on_body_impl(boost::core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -561,7 +561,7 @@ parse_body_to_eof(char const*& p, *body_limit_ -= n; } ec = {}; - n = this->on_body_impl(core::string_view{p, n}, ec); + n = this->on_body_impl(boost::core::string_view{p, n}, ec); p += n; if(ec) return; @@ -666,7 +666,7 @@ parse_chunk_body(char const*& p, { ec = {}; n = this->on_chunk_body_impl( - len_, core::string_view{p, + len_, boost::core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -678,7 +678,7 @@ template void basic_parser:: do_field(field f, - core::string_view value, error_code& ec) + boost::core::string_view value, error_code& ec) { using namespace beast::detail::string_literals; // Connection @@ -790,7 +790,7 @@ do_field(field f, ec = {}; auto const v = token_list{value}; auto const p = std::find_if(v.begin(), v.end(), - [&](core::string_view const& s) + [&](boost::core::string_view const& s) { return beast::iequals("chunked"_sv, s); }); diff --git a/include/boost/beast/http/impl/chunk_encode.hpp b/include/boost/beast/http/impl/chunk_encode.hpp index 704a2d4754..5bc8eb1e71 100644 --- a/include/boost/beast/http/impl/chunk_encode.hpp +++ b/include/boost/beast/http/impl/chunk_encode.hpp @@ -35,7 +35,7 @@ inline chunk_header:: chunk_header( std::size_t size, - core::string_view extensions) + boost::core::string_view extensions) : view_( size, net::const_buffer{ @@ -102,7 +102,7 @@ template chunk_body:: chunk_body( ConstBufferSequence const& buffers, - core::string_view extensions) + boost::core::string_view extensions) : view_( buffer_bytes(buffers), net::const_buffer{ @@ -311,10 +311,10 @@ operator*() -> using beast::detail::varint_read; auto it = it_; auto n = varint_read(it); - value_.first = core::string_view{it, n}; + value_.first = boost::core::string_view{it, n}; it += n; n = varint_read(it); - value_.second = core::string_view{it, n}; + value_.second = boost::core::string_view{it, n}; return value_; } @@ -560,7 +560,7 @@ do_parse(FwdIt it, FwdIt last, error_code& ec) template void basic_chunk_extensions:: -do_insert(core::string_view name, core::string_view value) +do_insert(boost::core::string_view name, boost::core::string_view value) { /* chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) @@ -623,7 +623,7 @@ do_insert(core::string_view name, core::string_view value) template void basic_chunk_extensions:: -parse(core::string_view s, error_code& ec) +parse(boost::core::string_view s, error_code& ec) { do_parse(s.data(), s.data() + s.size(), ec); if(! ec) @@ -637,7 +637,7 @@ parse(core::string_view s, error_code& ec) template void basic_chunk_extensions:: -insert(core::string_view name) +insert(boost::core::string_view name) { do_insert(name, {}); @@ -659,7 +659,7 @@ insert(core::string_view name) template void basic_chunk_extensions:: -insert(core::string_view name, core::string_view value) +insert(boost::core::string_view name, boost::core::string_view value) { do_insert(name, value); diff --git a/include/boost/beast/http/impl/field.ipp b/include/boost/beast/http/impl/field.ipp index fc1089c6a3..bedd355534 100644 --- a/include/boost/beast/http/impl/field.ipp +++ b/include/boost/beast/http/impl/field.ipp @@ -42,12 +42,12 @@ struct field_table } using array_type = - std::array; + std::array; // Strings are converted to lowercase static std::uint32_t - digest(core::string_view s) + digest(boost::core::string_view s) { std::uint32_t r = 0; std::size_t n = s.size(); @@ -77,7 +77,7 @@ struct field_table // strings must contain only valid http field characters. static bool - equals(core::string_view lhs, core::string_view rhs) + equals(boost::core::string_view lhs, boost::core::string_view rhs) { using Int = std::uint32_t; // VFALCO std::size_t? auto n = lhs.size(); @@ -257,7 +257,7 @@ struct field_table } field - string_to_field(core::string_view s) const + string_to_field(boost::core::string_view s) const { auto h = digest(s); auto j = h % N; @@ -302,7 +302,7 @@ get_field_table() } BOOST_BEAST_DECL -core::string_view +boost::core::string_view to_string(field f) { auto const& v = get_field_table(); @@ -312,14 +312,14 @@ to_string(field f) } // detail -core::string_view +boost::core::string_view to_string(field f) { return detail::to_string(f); } field -string_to_field(core::string_view s) +string_to_field(boost::core::string_view s) { return detail::get_field_table().string_to_field(s); } diff --git a/include/boost/beast/http/impl/fields.hpp b/include/boost/beast/http/impl/fields.hpp index c387ab966c..d7f4287ac1 100644 --- a/include/boost/beast/http/impl/fields.hpp +++ b/include/boost/beast/http/impl/fields.hpp @@ -192,7 +192,7 @@ writer(basic_fields const& f, " " " HTTP/X.Y\r\n" (11 chars) */ - core::string_view sv; + boost::core::string_view sv; if(v == verb::unknown) sv = f_.get_method_impl(); else @@ -248,7 +248,7 @@ writer(basic_fields const& f, buf_[11]= '0' + static_cast(code % 10); buf_[12]= ' '; - core::string_view sv; + boost::core::string_view sv; if(! f_.target_or_reason_.empty()) sv = f_.target_or_reason_; else @@ -289,7 +289,7 @@ template basic_fields:: value_type:: value_type(field name, - core::string_view sname, core::string_view value) + boost::core::string_view sname, boost::core::string_view value) : off_(static_cast(sname.size() + 2)) , len_(static_cast(value.size())) , f_(name) @@ -315,7 +315,7 @@ name() const } template -core::string_view const +boost::core::string_view const basic_fields:: value_type:: name_string() const @@ -325,7 +325,7 @@ name_string() const } template -core::string_view const +boost::core::string_view const basic_fields:: value_type:: value() const @@ -338,7 +338,7 @@ template basic_fields:: element:: element(field name, - core::string_view sname, core::string_view value) + boost::core::string_view sname, boost::core::string_view value) : value_type(name, sname, value) { } @@ -470,7 +470,7 @@ operator=(basic_fields const& other) -> //------------------------------------------------------------------------------ template -core::string_view const +boost::core::string_view const basic_fields:: at(field name) const { @@ -483,9 +483,9 @@ at(field name) const } template -core::string_view const +boost::core::string_view const basic_fields:: -at(core::string_view name) const +at(boost::core::string_view name) const { auto const it = find(name); if(it == end()) @@ -495,7 +495,7 @@ at(core::string_view name) const } template -core::string_view const +boost::core::string_view const basic_fields:: operator[](field name) const { @@ -507,9 +507,9 @@ operator[](field name) const } template -core::string_view const +boost::core::string_view const basic_fields:: -operator[](core::string_view name) const +operator[](boost::core::string_view name) const { auto const it = find(name); if(it == end()) @@ -537,7 +537,7 @@ template inline void basic_fields:: -insert(field name, core::string_view value) +insert(field name, boost::core::string_view value) { BOOST_ASSERT(name != field::unknown); insert(name, to_string(name), value); @@ -546,7 +546,7 @@ insert(field name, core::string_view value) template void basic_fields:: -insert(core::string_view sname, core::string_view value) +insert(boost::core::string_view sname, boost::core::string_view value) { insert( string_to_field(sname), sname, value); @@ -557,8 +557,8 @@ void basic_fields:: insert( field name, - core::string_view sname, - core::string_view value, + boost::core::string_view sname, + boost::core::string_view value, error_code& ec) { ec = {}; @@ -572,7 +572,7 @@ template void basic_fields:: insert(field name, - core::string_view sname, core::string_view value) + boost::core::string_view sname, boost::core::string_view value) { insert_element( new_element(name, sname, value)); @@ -581,7 +581,7 @@ insert(field name, template void basic_fields:: -set(field name, core::string_view value) +set(field name, boost::core::string_view value) { BOOST_ASSERT(name != field::unknown); set_element( @@ -591,7 +591,7 @@ set(field name, core::string_view value) template void basic_fields:: -set(core::string_view sname, core::string_view value) +set(boost::core::string_view sname, boost::core::string_view value) { set_element(new_element( string_to_field(sname), sname, value)); @@ -623,7 +623,7 @@ erase(field name) template std::size_t basic_fields:: -erase(core::string_view name) +erase(boost::core::string_view name) { std::size_t n =0; set_.erase_and_dispose(name, key_compare{}, @@ -672,7 +672,7 @@ contains(field name) const template bool basic_fields:: -contains(core::string_view name) const +contains(boost::core::string_view name) const { return find(name) != end(); } @@ -690,7 +690,7 @@ count(field name) const template std::size_t basic_fields:: -count(core::string_view name) const +count(boost::core::string_view name) const { return set_.count(name, key_compare{}); } @@ -709,7 +709,7 @@ find(field name) const -> template auto basic_fields:: -find(core::string_view name) const -> +find(boost::core::string_view name) const -> const_iterator { auto const it = set_.find( @@ -733,7 +733,7 @@ equal_range(field name) const -> template auto basic_fields:: -equal_range(core::string_view name) const -> +equal_range(boost::core::string_view name) const -> std::pair { auto result = @@ -752,13 +752,13 @@ namespace detail { struct iequals_predicate { bool - operator()(core::string_view s) const + operator()(boost::core::string_view s) const { return beast::iequals(s, sv1) || beast::iequals(s, sv2); } - core::string_view sv1; - core::string_view sv2; + boost::core::string_view sv1; + boost::core::string_view sv2; }; // Filter the last item in a token list @@ -766,13 +766,13 @@ BOOST_BEAST_DECL void filter_token_list_last( beast::detail::temporary_buffer& s, - core::string_view value, + boost::core::string_view value, iequals_predicate const& pred); BOOST_BEAST_DECL void keep_alive_impl( - beast::detail::temporary_buffer& s, core::string_view value, + beast::detail::temporary_buffer& s, boost::core::string_view value, unsigned version, bool keep_alive); } // detail @@ -783,7 +783,7 @@ keep_alive_impl( template inline -core::string_view +boost::core::string_view basic_fields:: get_method_impl() const { @@ -792,7 +792,7 @@ get_method_impl() const template inline -core::string_view +boost::core::string_view basic_fields:: get_target_impl() const { @@ -805,7 +805,7 @@ get_target_impl() const template inline -core::string_view +boost::core::string_view basic_fields:: get_reason_impl() const { @@ -860,7 +860,7 @@ template inline void basic_fields:: -set_method_impl(core::string_view s) +set_method_impl(boost::core::string_view s) { realloc_string(method_, s); } @@ -869,7 +869,7 @@ template inline void basic_fields:: -set_target_impl(core::string_view s) +set_target_impl(boost::core::string_view s) { realloc_target( target_or_reason_, s); @@ -879,7 +879,7 @@ template inline void basic_fields:: -set_reason_impl(core::string_view s) +set_reason_impl(boost::core::string_view s) { realloc_string( target_or_reason_, s); @@ -967,8 +967,8 @@ auto basic_fields:: try_create_new_element( field name, - core::string_view sname, - core::string_view value, + boost::core::string_view sname, + boost::core::string_view value, error_code& ec) -> element* { if(sname.size() > max_name_size) @@ -998,8 +998,8 @@ auto basic_fields:: new_element( field name, - core::string_view sname, - core::string_view value) -> element& + boost::core::string_view sname, + boost::core::string_view value) -> element& { error_code ec; auto* e = try_create_new_element(name, sname, value, ec); @@ -1083,7 +1083,7 @@ set_element(element& e) template void basic_fields:: -realloc_string(core::string_view& dest, core::string_view s) +realloc_string(boost::core::string_view& dest, boost::core::string_view s) { if(dest.empty() && s.empty()) return; @@ -1109,7 +1109,7 @@ template void basic_fields:: realloc_target( - core::string_view& dest, core::string_view s) + boost::core::string_view& dest, boost::core::string_view s) { // The target string are stored with an // extra space at the beginning to help diff --git a/include/boost/beast/http/impl/fields.ipp b/include/boost/beast/http/impl/fields.ipp index 8450b90576..d8c651b8da 100644 --- a/include/boost/beast/http/impl/fields.ipp +++ b/include/boost/beast/http/impl/fields.ipp @@ -29,7 +29,7 @@ inline void filter_token_list( beast::detail::temporary_buffer& s, - core::string_view value, + boost::core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -53,7 +53,7 @@ filter_token_list( void filter_token_list_last( beast::detail::temporary_buffer& s, - core::string_view value, + boost::core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -87,7 +87,7 @@ filter_token_list_last( void keep_alive_impl( - beast::detail::temporary_buffer& s, core::string_view value, + beast::detail::temporary_buffer& s, boost::core::string_view value, unsigned version, bool keep_alive) { if(version < 11) diff --git a/include/boost/beast/http/impl/message.hpp b/include/boost/beast/http/impl/message.hpp index 27cc3b6e6f..eb5ad45133 100644 --- a/include/boost/beast/http/impl/message.hpp +++ b/include/boost/beast/http/impl/message.hpp @@ -49,7 +49,7 @@ method(verb v) } template -core::string_view +boost::core::string_view header:: method_string() const { @@ -61,7 +61,7 @@ method_string() const template void header:: -method_string(core::string_view s) +method_string(boost::core::string_view s) { method_ = string_to_verb(s); if(method_ != verb::unknown) @@ -71,7 +71,7 @@ method_string(core::string_view s) } template -core::string_view +boost::core::string_view header:: target() const { @@ -81,7 +81,7 @@ target() const template void header:: -target(core::string_view s) +target(boost::core::string_view s) { this->set_target_impl(s); } @@ -149,7 +149,7 @@ result_int() const } template -core::string_view +boost::core::string_view header:: reason() const { @@ -162,7 +162,7 @@ reason() const template void header:: -reason(core::string_view s) +reason(boost::core::string_view s) { this->set_reason_impl(s); } @@ -208,7 +208,7 @@ message(header_type const& h, BodyArgs&&... body_args) template template message:: -message(verb method, core::string_view target, Version version) +message(verb method, boost::core::string_view target, Version version) : header_type(method, target, version) { } @@ -216,7 +216,7 @@ message(verb method, core::string_view target, Version version) template template message:: -message(verb method, core::string_view target, +message(verb method, boost::core::string_view target, Version version, BodyArg&& body_arg) : header_type(method, target, version) , boost::empty_value< @@ -229,7 +229,7 @@ template template message:: message( - verb method, core::string_view target, Version version, + verb method, boost::core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg) : header_type(method, target, version, diff --git a/include/boost/beast/http/impl/rfc7230.hpp b/include/boost/beast/http/impl/rfc7230.hpp index d8bd25fa2b..bc0a478982 100644 --- a/include/boost/beast/http/impl/rfc7230.hpp +++ b/include/boost/beast/http/impl/rfc7230.hpp @@ -89,7 +89,7 @@ class param_list::const_iterator BOOST_BEAST_DECL static void - unquote(core::string_view sr, std::string & s); + unquote(boost::core::string_view sr, std::string & s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/http/impl/rfc7230.ipp b/include/boost/beast/http/impl/rfc7230.ipp index a060ece23d..937ee00ac8 100644 --- a/include/boost/beast/http/impl/rfc7230.ipp +++ b/include/boost/beast/http/impl/rfc7230.ipp @@ -19,7 +19,7 @@ namespace http { void param_list::const_iterator:: -unquote(core::string_view sr, std::string &s) +unquote(boost::core::string_view sr, std::string &s) { s.clear(); s.reserve(sr.size()); @@ -49,7 +49,7 @@ increment() pi_.v.second.front() == '"') { unquote(pi_.v.second, s_); - pi_.v.second = core::string_view{ + pi_.v.second = boost::core::string_view{ s_.data(), s_.size()}; } } @@ -96,7 +96,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_.first = core::string_view{&*p0, + v_.first = boost::core::string_view{&*p0, static_cast(it_ - p0)}; if (it_ == last_) return; @@ -110,7 +110,7 @@ increment() if(pi.empty()) break; } - v_.second = param_list{core::string_view{&*it_, + v_.second = param_list{boost::core::string_view{&*it_, static_cast(pi.it - it_)}}; it_ = pi.it; return; @@ -124,7 +124,7 @@ increment() auto ext_list:: -find(core::string_view const& s) -> const_iterator +find(boost::core::string_view const& s) -> const_iterator { return std::find_if(begin(), end(), [&s](value_type const& v) @@ -135,7 +135,7 @@ find(core::string_view const& s) -> const_iterator bool ext_list:: -exists(core::string_view const& s) +exists(boost::core::string_view const& s) { return find(s) != end(); } @@ -175,7 +175,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_ = core::string_view{&*p0, + v_ = boost::core::string_view{&*p0, static_cast(it_ - p0)}; return; } @@ -188,7 +188,7 @@ increment() bool token_list:: -exists(core::string_view const& s) +exists(boost::core::string_view const& s) { return std::find_if(begin(), end(), [&s](value_type const& v) diff --git a/include/boost/beast/http/impl/status.ipp b/include/boost/beast/http/impl/status.ipp index 7071f198f2..351368fa0d 100644 --- a/include/boost/beast/http/impl/status.ipp +++ b/include/boost/beast/http/impl/status.ipp @@ -127,7 +127,7 @@ to_status_class(status v) return to_status_class(static_cast(v)); } -core::string_view +boost::core::string_view obsolete_reason(status v) { switch(static_cast(v)) diff --git a/include/boost/beast/http/impl/verb.ipp b/include/boost/beast/http/impl/verb.ipp index 24017da411..1815a322b8 100644 --- a/include/boost/beast/http/impl/verb.ipp +++ b/include/boost/beast/http/impl/verb.ipp @@ -18,7 +18,7 @@ namespace boost { namespace beast { namespace http { -core::string_view +boost::core::string_view to_string(verb v) { using namespace beast::detail::string_literals; @@ -72,7 +72,7 @@ to_string(verb v) } verb -string_to_verb(core::string_view v) +string_to_verb(boost::core::string_view v) { /* ACL diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index ead1291e1e..82ff6bf069 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -149,7 +149,7 @@ class header : public Fields @see method */ - core::string_view + boost::core::string_view method_string() const; /** Set the request-method. @@ -163,7 +163,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - method_string(core::string_view s); + method_string(boost::core::string_view s); /** Returns the request-target string. @@ -174,7 +174,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ - core::string_view + boost::core::string_view target() const; /** Set the request-target string. @@ -190,7 +190,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - target(core::string_view s); + target(boost::core::string_view s); // VFALCO Don't rearrange these declarations or // ifdefs, or else the documentation will break. @@ -235,7 +235,7 @@ class header : public Fields template header( verb method, - core::string_view target_, + boost::core::string_view target_, unsigned version_value, FieldsArgs&&... fields_args) : Fields(std::forward(fields_args)...) @@ -390,7 +390,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ - core::string_view + boost::core::string_view reason() const; /** Set the response reason-phrase (deprecated) @@ -412,7 +412,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ void - reason(core::string_view s); + reason(boost::core::string_view s); private: #if ! BOOST_BEAST_DOXYGEN @@ -557,12 +557,12 @@ class message @note This function is only available when `isRequest == true`. */ #if BOOST_BEAST_DOXYGEN - message(verb method, core::string_view target, unsigned version); + message(verb method, boost::core::string_view target, unsigned version); #else template::value>::type> - message(verb method, core::string_view target, Version version); + message(verb method, boost::core::string_view target, Version version); #endif /** Constructor @@ -579,13 +579,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, core::string_view target, + message(verb method, boost::core::string_view target, unsigned version, BodyArg&& body_arg); #else template::value>::type> - message(verb method, core::string_view target, + message(verb method, boost::core::string_view target, Version version, BodyArg&& body_arg); #endif @@ -605,13 +605,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, core::string_view target, unsigned version, + message(verb method, boost::core::string_view target, unsigned version, BodyArg&& body_arg, FieldsArg&& fields_arg); #else template::value>::type> - message(verb method, core::string_view target, Version version, + message(verb method, boost::core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg); #endif diff --git a/include/boost/beast/http/message_generator.hpp b/include/boost/beast/http/message_generator.hpp index f77c1a1c8a..a550c866f8 100644 --- a/include/boost/beast/http/message_generator.hpp +++ b/include/boost/beast/http/message_generator.hpp @@ -34,7 +34,7 @@ namespace http { @code template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request&& request); @endcode diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index ed4239f1f1..fe7c848688 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -76,12 +76,12 @@ class parser std::function cb_h_; std::function cb_b_; public: @@ -225,7 +225,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t size, core::string_view extensions, error_code& ec) + [](std::uint64_t size, boost::core::string_view extensions, error_code& ec) { //... }; @@ -238,7 +238,7 @@ class parser void on_chunk_header( std::uint64_t size, // Size of the chunk, zero for the last chunk - core::string_view extensions, // The chunk-extensions in raw form + boost::core::string_view extensions, // The chunk-extensions in raw form error_code& ec); // May be set by the callback to indicate an error @endcode */ @@ -273,7 +273,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t remain, core::string_view body, error_code& ec) + [](std::uint64_t remain, boost::core::string_view body, error_code& ec) { //... }; @@ -286,7 +286,7 @@ class parser std::size_t on_chunk_header( std::uint64_t remain, // Octets remaining in this chunk, includes `body` - core::string_view body, // A buffer holding some or all of the remainder of the chunk body + boost::core::string_view body, // A buffer holding some or all of the remainder of the chunk body error_code& ec); // May be set by the callback to indicate an error @endcode */ @@ -387,8 +387,8 @@ class parser void on_request_impl( verb method, - core::string_view method_str, - core::string_view target, + boost::core::string_view method_str, + boost::core::string_view target, int version, error_code& ec, std::true_type) @@ -417,7 +417,7 @@ class parser void on_request_impl( - verb, core::string_view, core::string_view, + verb, boost::core::string_view, boost::core::string_view, int, error_code&, std::false_type) { } @@ -425,8 +425,8 @@ class parser void on_request_impl( verb method, - core::string_view method_str, - core::string_view target, + boost::core::string_view method_str, + boost::core::string_view target, int version, error_code& ec) override { @@ -438,7 +438,7 @@ class parser void on_response_impl( int code, - core::string_view reason, + boost::core::string_view reason, int version, error_code& ec, std::true_type) @@ -464,7 +464,7 @@ class parser void on_response_impl( - int, core::string_view, int, + int, boost::core::string_view, int, error_code&, std::false_type) { } @@ -472,7 +472,7 @@ class parser void on_response_impl( int code, - core::string_view reason, + boost::core::string_view reason, int version, error_code& ec) override { @@ -484,8 +484,8 @@ class parser void on_field_impl( field name, - core::string_view name_string, - core::string_view value, + boost::core::string_view name_string, + boost::core::string_view value, error_code& ec) override { m_.insert(name, name_string, value, ec); @@ -494,8 +494,8 @@ class parser void on_trailer_field_impl( field name, - core::string_view name_string, - core::string_view value, + boost::core::string_view name_string, + boost::core::string_view value, error_code& ec) override { if(! token_list{m_[field::trailer]}.exists(name_string)) @@ -538,7 +538,7 @@ class parser std::size_t on_body_impl( - core::string_view body, + boost::core::string_view body, error_code& ec) override { return rd_.put(net::buffer( @@ -548,7 +548,7 @@ class parser void on_chunk_header_impl( std::uint64_t size, - core::string_view extensions, + boost::core::string_view extensions, error_code& ec) override { if(cb_h_) @@ -558,7 +558,7 @@ class parser std::size_t on_chunk_body_impl( std::uint64_t remain, - core::string_view body, + boost::core::string_view body, error_code& ec) override { if(cb_b_) diff --git a/include/boost/beast/http/rfc7230.hpp b/include/boost/beast/http/rfc7230.hpp index 1f5ab7a51d..b68972c84d 100644 --- a/include/boost/beast/http/rfc7230.hpp +++ b/include/boost/beast/http/rfc7230.hpp @@ -52,7 +52,7 @@ namespace http { */ class param_list { - core::string_view s_; + boost::core::string_view s_; public: /** The type of each element in the list. @@ -62,7 +62,7 @@ class param_list be empty). */ using value_type = - std::pair; + std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -80,7 +80,7 @@ class param_list must remain valid for the lifetime of the container. */ explicit - param_list(core::string_view s) + param_list(boost::core::string_view s) : s_(s) { } @@ -142,7 +142,7 @@ class ext_list { using iter_type = string_view::const_iterator; - core::string_view s_; + boost::core::string_view s_; public: /** The type of each element in the list. @@ -151,7 +151,7 @@ class ext_list second element of the pair is an iterable container holding the extension's name/value parameters. */ - using value_type = std::pair; + using value_type = std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -166,7 +166,7 @@ class ext_list must remain valid for the lifetime of the container. */ explicit - ext_list(core::string_view s) + ext_list(boost::core::string_view s) : s_(s) { } @@ -192,7 +192,7 @@ class ext_list */ BOOST_BEAST_DECL const_iterator - find(core::string_view const& s); + find(boost::core::string_view const& s); /** Return `true` if a token is present in the list. @@ -200,7 +200,7 @@ class ext_list */ BOOST_BEAST_DECL bool - exists(core::string_view const& s); + exists(boost::core::string_view const& s); }; //------------------------------------------------------------------------------ @@ -235,11 +235,11 @@ class token_list { using iter_type = string_view::const_iterator; - core::string_view s_; + boost::core::string_view s_; public: /// The type of each element in the token list. - using value_type = core::string_view; + using value_type = boost::core::string_view; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -254,7 +254,7 @@ class token_list must remain valid for the lifetime of the container. */ explicit - token_list(core::string_view s) + token_list(boost::core::string_view s) : s_(s) { } @@ -277,7 +277,7 @@ class token_list */ BOOST_BEAST_DECL bool - exists(core::string_view const& s); + exists(boost::core::string_view const& s); }; /** A list of tokens in a comma separated HTTP field value. diff --git a/include/boost/beast/http/status.hpp b/include/boost/beast/http/status.hpp index 084d442a72..ea01f51769 100644 --- a/include/boost/beast/http/status.hpp +++ b/include/boost/beast/http/status.hpp @@ -163,7 +163,7 @@ to_status_class(status v); @param v The status code to use. */ BOOST_BEAST_DECL -core::string_view +boost::core::string_view obsolete_reason(status v); /// Outputs the standard reason phrase of a status code to a stream. diff --git a/include/boost/beast/http/verb.hpp b/include/boost/beast/http/verb.hpp index bd4217b9bf..565f4556f7 100644 --- a/include/boost/beast/http/verb.hpp +++ b/include/boost/beast/http/verb.hpp @@ -135,11 +135,11 @@ enum class verb */ BOOST_BEAST_DECL verb -string_to_verb(core::string_view s); +string_to_verb(boost::core::string_view s); /// Returns the text representation of a request method verb. BOOST_BEAST_DECL -core::string_view +boost::core::string_view to_string(verb v); /// Write the text for a request method verb to an output stream. diff --git a/include/boost/beast/websocket/detail/hybi13.hpp b/include/boost/beast/websocket/detail/hybi13.hpp index 7783762e39..a84431f880 100644 --- a/include/boost/beast/websocket/detail/hybi13.hpp +++ b/include/boost/beast/websocket/detail/hybi13.hpp @@ -34,7 +34,7 @@ BOOST_BEAST_DECL void make_sec_ws_accept( sec_ws_accept_type& accept, - core::string_view key); + boost::core::string_view key); } // detail } // websocket diff --git a/include/boost/beast/websocket/detail/hybi13.ipp b/include/boost/beast/websocket/detail/hybi13.ipp index dcf7ded705..8c6c6b3e0d 100644 --- a/include/boost/beast/websocket/detail/hybi13.ipp +++ b/include/boost/beast/websocket/detail/hybi13.ipp @@ -38,7 +38,7 @@ make_sec_ws_key(sec_ws_key_type& key) void make_sec_ws_accept( sec_ws_accept_type& accept, - core::string_view key) + boost::core::string_view key) { BOOST_ASSERT(key.size() <= sec_ws_key_type::static_capacity); using namespace beast::detail::string_literals; diff --git a/include/boost/beast/websocket/detail/pmd_extension.hpp b/include/boost/beast/websocket/detail/pmd_extension.hpp index 6e3acedc54..18c047b0e2 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.hpp +++ b/include/boost/beast/websocket/detail/pmd_extension.hpp @@ -45,7 +45,7 @@ struct pmd_offer BOOST_BEAST_DECL int -parse_bits(core::string_view s); +parse_bits(boost::core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/websocket/detail/pmd_extension.ipp b/include/boost/beast/websocket/detail/pmd_extension.ipp index b86455209e..3162e8b76f 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.ipp +++ b/include/boost/beast/websocket/detail/pmd_extension.ipp @@ -18,7 +18,7 @@ namespace websocket { namespace detail { int -parse_bits(core::string_view s) +parse_bits(boost::core::string_view s) { if(s.size() == 0) return -1; diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index 3385b3ebf1..a87ee0ae0f 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -79,7 +79,7 @@ build_response( decorator(res); if(! res.contains(http::field::server)) res.set(http::field::server, - core::string_view(BOOST_BEAST_VERSION_STRING)); + boost::core::string_view(BOOST_BEAST_VERSION_STRING)); }; auto err = [&](error e) @@ -113,7 +113,7 @@ build_response( if(! http::token_list{it->value()}.exists("websocket")) return err(error::no_upgrade_websocket); } - core::string_view key; + boost::core::string_view key; { auto const it = req.find(http::field::sec_websocket_key); if(it == req.end()) diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index d21da0d305..fcbc778bb7 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -231,8 +231,8 @@ void stream:: do_handshake( response_type* res_p, - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, RequestDecorator const& decorator, error_code& ec) { @@ -310,8 +310,8 @@ template BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -335,8 +335,8 @@ BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( response_type& res, - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -357,8 +357,8 @@ async_handshake( template void stream:: -handshake(core::string_view host, - core::string_view target) +handshake(boost::core::string_view host, + boost::core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -373,8 +373,8 @@ template void stream:: handshake(response_type& res, - core::string_view host, - core::string_view target) + boost::core::string_view host, + boost::core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -387,8 +387,8 @@ handshake(response_type& res, template void stream:: -handshake(core::string_view host, - core::string_view target, error_code& ec) +handshake(boost::core::string_view host, + boost::core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -400,8 +400,8 @@ template void stream:: handshake(response_type& res, - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, diff --git a/include/boost/beast/websocket/impl/stream.hpp b/include/boost/beast/websocket/impl/stream.hpp index 0ee5e51102..07f7e53bf6 100644 --- a/include/boost/beast/websocket/impl/stream.hpp +++ b/include/boost/beast/websocket/impl/stream.hpp @@ -251,7 +251,7 @@ template void stream:: control_callback(std::function< - void(frame_type, core::string_view)> cb) + void(frame_type, boost::core::string_view)> cb) { impl_->ctrl_cb = std::move(cb); } diff --git a/include/boost/beast/websocket/impl/stream_impl.hpp b/include/boost/beast/websocket/impl/stream_impl.hpp index edf960f91c..38d424f24e 100644 --- a/include/boost/beast/websocket/impl/stream_impl.hpp +++ b/include/boost/beast/websocket/impl/stream_impl.hpp @@ -257,7 +257,7 @@ struct stream::impl_type request_type build_request( detail::sec_ws_key_type& key, - core::string_view host, core::string_view target, + boost::core::string_view host, boost::core::string_view target, Decorator const& decorator); void @@ -623,7 +623,7 @@ request_type stream::impl_type:: build_request( detail::sec_ws_key_type& key, - core::string_view host, core::string_view target, + boost::core::string_view host, boost::core::string_view target, Decorator const& decorator) { request_type req; diff --git a/include/boost/beast/websocket/rfc6455.hpp b/include/boost/beast/websocket/rfc6455.hpp index 19582657cc..77a4a91b20 100644 --- a/include/boost/beast/websocket/rfc6455.hpp +++ b/include/boost/beast/websocket/rfc6455.hpp @@ -187,7 +187,7 @@ struct close_reason } /// Construct from a reason string. code is @ref close_code::normal. - close_reason(core::string_view s) + close_reason(boost::core::string_view s) : code(close_code::normal) , reason(s.data(), s.size()) { @@ -201,7 +201,7 @@ struct close_reason } /// Construct from a close code and reason string. - close_reason(close_code code_, core::string_view s) + close_reason(close_code code_, boost::core::string_view s) : code(code_) , reason(s.data(), s.size()) { diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index f9e3db5275..3df5dfa697 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -156,7 +156,7 @@ class stream std::chrono::steady_clock::time_point; using control_cb_type = - std::function; + std::function; #ifndef BOOST_BEAST_DOXYGEN friend class close_test; @@ -525,7 +525,7 @@ class stream void callback( frame_type kind, // The type of frame - core::string_view payload // The payload in the frame + boost::core::string_view payload // The payload in the frame ); @endcode The implementation type-erases the callback which may require @@ -545,7 +545,7 @@ class stream in undefined behavior. */ void - control_callback(std::function cb); + control_callback(std::function cb); /** Reset the control frame callback. @@ -762,8 +762,8 @@ class stream */ void handshake( - core::string_view host, - core::string_view target); + boost::core::string_view host, + boost::core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -820,8 +820,8 @@ class stream void handshake( response_type& res, - core::string_view host, - core::string_view target); + boost::core::string_view host, + boost::core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -868,8 +868,8 @@ class stream */ void handshake( - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, error_code& ec); /** Perform the WebSocket handshake in the client role. @@ -925,8 +925,8 @@ class stream void handshake( response_type& res, - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, error_code& ec); /** Perform the WebSocket handshake asynchronously in the client role. @@ -1002,8 +1002,8 @@ class stream > BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -1091,8 +1091,8 @@ class stream BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( response_type& res, - core::string_view host, - core::string_view target, + boost::core::string_view host, + boost::core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -2909,7 +2909,7 @@ class stream template void do_handshake(response_type* res_p, - core::string_view host, core::string_view target, + boost::core::string_view host, boost::core::string_view target, RequestDecorator const& decorator, error_code& ec); diff --git a/test/beast/_experimental/icy_stream.cpp b/test/beast/_experimental/icy_stream.cpp index fcafd4153f..095a6ff499 100644 --- a/test/beast/_experimental/icy_stream.cpp +++ b/test/beast/_experimental/icy_stream.cpp @@ -28,7 +28,7 @@ class icy_stream_test { public: void - doMatrix(core::string_view in, core::string_view out) + doMatrix(boost::core::string_view in, boost::core::string_view out) { using net::mutable_buffer; net::io_context ioc; diff --git a/test/beast/core/_detail_base64.cpp b/test/beast/core/_detail_base64.cpp index f1d02c9347..7787170647 100644 --- a/test/beast/core/_detail_base64.cpp +++ b/test/beast/core/_detail_base64.cpp @@ -32,14 +32,14 @@ class base64_test : public beast::unit_test::suite } std::string - base64_encode(core::string_view s) + base64_encode(boost::core::string_view s) { return base64_encode (reinterpret_cast < std::uint8_t const*> (s.data()), s.size()); } std::string - base64_decode(core::string_view data) + base64_decode(boost::core::string_view data) { std::string dest; dest.resize(base64::decoded_size(data.size())); diff --git a/test/beast/core/basic_stream.cpp b/test/beast/core/basic_stream.cpp index 5d8912b4d4..2c8814f421 100644 --- a/test/beast/core/basic_stream.cpp +++ b/test/beast/core/basic_stream.cpp @@ -167,7 +167,7 @@ struct test_acceptor class test_server { - core::string_view s_; + boost::core::string_view s_; std::ostream& log_; net::io_context ioc_; net::ip::tcp::acceptor acceptor_; @@ -175,7 +175,7 @@ class test_server std::thread t_; void - fail(error_code const& ec, core::string_view what) + fail(error_code const& ec, boost::core::string_view what) { if(ec != net::error::operation_aborted) log_ << what << ": " << ec.message() << "\n"; @@ -183,7 +183,7 @@ class test_server public: test_server( - core::string_view s, + boost::core::string_view s, net::ip::tcp::endpoint ep, std::ostream& log) : s_(s) @@ -253,12 +253,12 @@ class test_server class session : public std::enable_shared_from_this { - core::string_view s_; + boost::core::string_view s_; net::ip::tcp::socket socket_; public: session( - core::string_view s, + boost::core::string_view s, net::ip::tcp::socket sock, std::ostream&) : s_(s) diff --git a/test/beast/core/bind_handler.cpp b/test/beast/core/bind_handler.cpp index 2298adf7ab..82aca20542 100644 --- a/test/beast/core/bind_handler.cpp +++ b/test/beast/core/bind_handler.cpp @@ -287,7 +287,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, core::string_view s) + operator()(int v, boost::core::string_view s) { fail_ = false; BEAST_EXPECT(v == 42); @@ -295,7 +295,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, core::string_view s, move_arg<1>) + operator()(int v, boost::core::string_view s, move_arg<1>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -303,7 +303,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, core::string_view s, move_arg<1>, move_arg<2>) + operator()(int v, boost::core::string_view s, move_arg<1>, move_arg<2>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -319,7 +319,7 @@ class bind_handler_test : public unit_test::suite void operator()( - error_code, std::size_t n, core::string_view s) + error_code, std::size_t n, boost::core::string_view s) { boost::ignore_unused(s); fail_ = false; @@ -527,7 +527,7 @@ class bind_handler_test : public unit_test::suite // void(error_code, size_t) bind_front_handler(test_cb{}, ec, n)(); - // void(error_code, size_t)(core::string_view) + // void(error_code, size_t)(boost::core::string_view) bind_front_handler(test_cb{}, ec, n)("s"); // perfect forwarding diff --git a/test/beast/core/buffers_cat.cpp b/test/beast/core/buffers_cat.cpp index 588b98ddde..a7d4781ff9 100644 --- a/test/beast/core/buffers_cat.cpp +++ b/test/beast/core/buffers_cat.cpp @@ -72,7 +72,7 @@ class buffers_cat_test : public unit_test::suite void testBufferSequence() { - core::string_view s = "Hello, world!"; + boost::core::string_view s = "Hello, world!"; net::const_buffer b1(s.data(), 6); net::const_buffer b2( s.data() + b1.size(), s.size() - b1.size()); diff --git a/test/beast/core/buffers_range.cpp b/test/beast/core/buffers_range.cpp index 579326f7b9..790e8916f8 100644 --- a/test/beast/core/buffers_range.cpp +++ b/test/beast/core/buffers_range.cpp @@ -69,7 +69,7 @@ class buffers_range_test : public beast::unit_test::suite testBufferSequence() { { - core::string_view s = "Hello, world!"; + boost::core::string_view s = "Hello, world!"; test_buffer_sequence(buffers_range( net::const_buffer{s.data(), s.size()})); } diff --git a/test/beast/core/buffers_suffix.cpp b/test/beast/core/buffers_suffix.cpp index 284bc2e93f..6d2dcca666 100644 --- a/test/beast/core/buffers_suffix.cpp +++ b/test/beast/core/buffers_suffix.cpp @@ -37,7 +37,7 @@ class buffers_suffix_test : public beast::unit_test::suite // const { - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; std::array b{{ net::const_buffer(src.data(), 3), net::const_buffer(src.data() + 3, 4), diff --git a/test/beast/core/detect_ssl.cpp b/test/beast/core/detect_ssl.cpp index 1339826fee..f2028aac7a 100644 --- a/test/beast/core/detect_ssl.cpp +++ b/test/beast/core/detect_ssl.cpp @@ -31,21 +31,21 @@ class detect_ssl_test : public unit_test::suite testDetect() { auto const yes = - [](int n, core::string_view s) + [](int n, boost::core::string_view s) { BEAST_EXPECT(detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const no = - [](int n, core::string_view s) + [](int n, boost::core::string_view s) { BEAST_EXPECT(! detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const maybe = - [](int n, core::string_view s) + [](int n, boost::core::string_view s) { BEAST_EXPECT(boost::indeterminate( detail::is_tls_client_hello( diff --git a/test/beast/core/file_test.hpp b/test/beast/core/file_test.hpp index 2a8e6c1558..30941d6f06 100644 --- a/test/beast/core/file_test.hpp +++ b/test/beast/core/file_test.hpp @@ -393,7 +393,7 @@ test_file() // read and write { - core::string_view const s = "Hello, world!"; + boost::core::string_view const s = "Hello, world!"; // write { diff --git a/test/beast/core/flat_buffer.cpp b/test/beast/core/flat_buffer.cpp index 0035a26ec9..a08d9c289c 100644 --- a/test/beast/core/flat_buffer.cpp +++ b/test/beast/core/flat_buffer.cpp @@ -255,7 +255,7 @@ class flat_buffer_test : public beast::unit_test::suite // operations { - core::string_view const s = "Hello, world!"; + boost::core::string_view const s = "Hello, world!"; flat_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); diff --git a/test/beast/core/flat_static_buffer.cpp b/test/beast/core/flat_static_buffer.cpp index 064ad03c1f..68929d45fd 100644 --- a/test/beast/core/flat_static_buffer.cpp +++ b/test/beast/core/flat_static_buffer.cpp @@ -41,7 +41,7 @@ class flat_static_buffer_test : public beast::unit_test::suite void testMembers() { - core::string_view const s = "Hello, world!"; + boost::core::string_view const s = "Hello, world!"; // flat_static_buffer_base { diff --git a/test/beast/core/make_printable.cpp b/test/beast/core/make_printable.cpp index 423bb66284..27e0640517 100644 --- a/test/beast/core/make_printable.cpp +++ b/test/beast/core/make_printable.cpp @@ -43,7 +43,7 @@ class make_printable_test : public beast::unit_test::suite { char buf[13]; buffers_triple b(buf, sizeof(buf)); - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; BEAST_EXPECT(src.size() == sizeof(buf)); net::buffer_copy(b, net::const_buffer(src.data(), src.size())); diff --git a/test/beast/core/multi_buffer.cpp b/test/beast/core/multi_buffer.cpp index 40cf12dad4..a8a07be67e 100644 --- a/test/beast/core/multi_buffer.cpp +++ b/test/beast/core/multi_buffer.cpp @@ -418,7 +418,7 @@ class multi_buffer_test : public beast::unit_test::suite } } { - core::string_view const s = "Hello, world!"; + boost::core::string_view const s = "Hello, world!"; multi_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); @@ -683,7 +683,7 @@ class multi_buffer_test : public beast::unit_test::suite void testMatrix1() { - core::string_view s = "Hello, world"; + boost::core::string_view s = "Hello, world"; BEAST_EXPECT(s.size() == 12); for(std::size_t i = 1; i < 12; ++i) { for(std::size_t x = 1; x < 4; ++x) { diff --git a/test/beast/core/ostream.cpp b/test/beast/core/ostream.cpp index b0fcd4c920..32f2a568d8 100644 --- a/test/beast/core/ostream.cpp +++ b/test/beast/core/ostream.cpp @@ -27,7 +27,7 @@ class ostream_test : public beast::unit_test::suite void testOstream() { - core::string_view const s = "0123456789abcdef"; + boost::core::string_view const s = "0123456789abcdef"; BEAST_EXPECT(s.size() == 16); // overflow @@ -75,7 +75,7 @@ class ostream_test : public beast::unit_test::suite { // Issue #1853 flat_static_buffer<16> b; - auto half_view = core::string_view(s.data(), 8); + auto half_view = boost::core::string_view(s.data(), 8); { auto os = ostream(b); os << half_view; @@ -88,9 +88,9 @@ class ostream_test : public beast::unit_test::suite flat_static_buffer<16> b; { auto os = ostream(b); - os << core::string_view(s.data(), 8); + os << boost::core::string_view(s.data(), 8); os.flush(); - os << core::string_view(s.data() + 8, 8); + os << boost::core::string_view(s.data() + 8, 8); os.flush(); } BEAST_EXPECT(buffers_to_string(b.data()) == s); diff --git a/test/beast/core/static_buffer.cpp b/test/beast/core/static_buffer.cpp index e2310e5844..efc895c6ad 100644 --- a/test/beast/core/static_buffer.cpp +++ b/test/beast/core/static_buffer.cpp @@ -45,7 +45,7 @@ class static_buffer_test : public beast::unit_test::suite void testMembers() { - core::string_view const s = "Hello, world!"; + boost::core::string_view const s = "Hello, world!"; // static_buffer_base { diff --git a/test/beast/core/static_string.cpp b/test/beast/core/static_string.cpp index f68b3d2502..b2c1652b68 100644 --- a/test/beast/core/static_string.cpp +++ b/test/beast/core/static_string.cpp @@ -126,13 +126,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1( - core::string_view("123")); + boost::core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<2> s2( - core::string_view("123")); + boost::core::string_view("123")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -235,13 +235,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1; - s1 = core::string_view("123"); + s1 = boost::core::string_view("123"); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<1> s2; - s2 = core::string_view("123"); + s2 = boost::core::string_view("123"); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -373,15 +373,15 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1; - s1.assign(core::string_view("123")); + s1.assign(boost::core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); - s1.assign(core::string_view("12345")); + s1.assign(boost::core::string_view("12345")); BEAST_EXPECT(s1 == "12345"); BEAST_EXPECT(*s1.end() == 0); try { - s1.assign(core::string_view("1234567")); + s1.assign(boost::core::string_view("1234567")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -486,7 +486,7 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s("123"); - core::string_view sv = s; + boost::core::string_view sv = s; BEAST_EXPECT(static_string<5>(sv) == "123"); } } @@ -754,13 +754,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1("123"); - s1.insert(1, core::string_view("UV")); + s1.insert(1, boost::core::string_view("UV")); BEAST_EXPECT(s1 == "1UV23"); BEAST_EXPECT(*s1.end() == 0); try { static_string<4> s2("123"); - s2.insert(1, core::string_view("UV")); + s2.insert(1, boost::core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -770,7 +770,7 @@ class static_string_test : public beast::unit_test::suite try { static_string<5> s2("123"); - s2.insert(5, core::string_view("UV")); + s2.insert(5, boost::core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::out_of_range const&) @@ -1033,7 +1033,7 @@ class static_string_test : public beast::unit_test::suite } } { - core::string_view s1("XYZ"); + boost::core::string_view s1("XYZ"); static_string<5> s2("12"); s2.append(s1); BEAST_EXPECT(s2 == "12XYZ"); @@ -1133,7 +1133,7 @@ class static_string_test : public beast::unit_test::suite } } { - core::string_view s1("34"); + boost::core::string_view s1("34"); static_string<4> s2("12"); s2 += s1; BEAST_EXPECT(s2 == "1234"); diff --git a/test/beast/core/test_buffer.hpp b/test/beast/core/test_buffer.hpp index f92c1fb9bd..d2740e5aff 100644 --- a/test/beast/core/test_buffer.hpp +++ b/test/beast/core/test_buffer.hpp @@ -119,7 +119,7 @@ void test_mutable_buffers( MutableBufferSequence const& b, net::mutable_buffer) { - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; BOOST_ASSERT(buffer_bytes(b) <= src.size()); if(src.size() > buffer_bytes(b)) src = {src.data(), buffer_bytes(b)}; @@ -298,7 +298,7 @@ test_mutable_dynamic_buffer( typename MutableDynamicBuffer_v0::mutable_buffers_type, typename MutableDynamicBuffer_v0::const_buffers_type>::value); - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; @@ -385,7 +385,7 @@ test_dynamic_buffer( // members { - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -524,7 +524,7 @@ test_dynamic_buffer( // setup source buffer char buf[13]; unsigned char k0 = 0; - core::string_view src(buf, sizeof(buf)); + boost::core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -559,7 +559,7 @@ test_dynamic_buffer( // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - core::string_view in(src.data(), h); + boost::core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { @@ -620,7 +620,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // members { - core::string_view src = "Hello, world!"; + boost::core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -702,7 +702,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // setup source buffer char buf[13]; unsigned char k0 = 0; - core::string_view src(buf, sizeof(buf)); + boost::core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -737,7 +737,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - core::string_view in(src.data(), h); + boost::core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { diff --git a/test/beast/http/basic_parser.cpp b/test/beast/http/basic_parser.cpp index 009a76eca0..2a0270f618 100644 --- a/test/beast/http/basic_parser.cpp +++ b/test/beast/http/basic_parser.cpp @@ -213,7 +213,7 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(core::string_view msg, Test const& test, bool skip = false) + parsegrind(boost::core::string_view msg, Test const& test, bool skip = false) { parsegrind(net::const_buffer{ msg.data(), msg.size()}, test, skip); @@ -229,14 +229,14 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(core::string_view msg) + parsegrind(boost::core::string_view msg) { parsegrind(msg, [](Parser const&){}); } template void - failgrind(core::string_view msg, error_code const& result) + failgrind(boost::core::string_view msg, error_code const& result) { for(std::size_t i = 1; i < msg.size() - 1; ++i) { @@ -321,7 +321,7 @@ class basic_parser_test : public beast::unit_test::suite testObsFold() { auto const check = - [&](std::string const& s, core::string_view value) + [&](std::string const& s, boost::core::string_view value) { std::string m = "GET / HTTP/1.1\r\n" @@ -952,7 +952,7 @@ class basic_parser_test : public beast::unit_test::suite static net::const_buffer - buf(core::string_view s) + buf(boost::core::string_view s) { return {s.data(), s.size()}; } @@ -1140,7 +1140,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - core::string_view s = + boost::core::string_view s = "GET / HTTP/1.1\r\n" "\r\n" "die!"; @@ -1177,7 +1177,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - core::string_view s = + boost::core::string_view s = "HTTP/1.1 101 Switching Protocols\r\n" "Content-Length: 2147483648\r\n" "\r\n"; @@ -1194,12 +1194,12 @@ class basic_parser_test : public beast::unit_test::suite testFuzz() { auto const grind = - [&](core::string_view s) + [&](boost::core::string_view s) { static_string<100> ss(s.data(), s.size()); test::fuzz_rand r; test::fuzz(ss, 4, 5, r, - [&](core::string_view s) + [&](boost::core::string_view s) { error_code ec; test_parser p; @@ -1209,7 +1209,7 @@ class basic_parser_test : public beast::unit_test::suite }); }; auto const good = - [&](core::string_view s) + [&](boost::core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1226,7 +1226,7 @@ class basic_parser_test : public beast::unit_test::suite grind(msg); }; auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1282,7 +1282,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](core::string_view s, std::uint32_t v0) + [&](boost::core::string_view s, std::uint32_t v0) { std::uint64_t v; auto const result = @@ -1291,7 +1291,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { std::uint64_t v; auto const result = @@ -1318,7 +1318,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](core::string_view s, std::uint64_t v0) + [&](boost::core::string_view s, std::uint64_t v0) { std::uint64_t v; auto it = s.data(); @@ -1328,7 +1328,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { std::uint64_t v; auto it = s.data(); @@ -1513,7 +1513,7 @@ class basic_parser_test : public beast::unit_test::suite void testChunkedBodySize() { - core::string_view resp = + boost::core::string_view resp = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Transfer-Encoding: chunked\r\n" diff --git a/test/beast/http/chunk_encode.cpp b/test/beast/http/chunk_encode.cpp index 9e04fe97ab..d7e1ec9e91 100644 --- a/test/beast/http/chunk_encode.cpp +++ b/test/beast/http/chunk_encode.cpp @@ -38,7 +38,7 @@ class chunk_encode_test template void - check(core::string_view match, Args&&... args) + check(boost::core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -50,7 +50,7 @@ class chunk_encode_test template void - check_fwd(core::string_view match, Args&&... args) + check_fwd(boost::core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -64,7 +64,7 @@ class chunk_encode_test static cb_t - cb(core::string_view s) + cb(boost::core::string_view s) { return {s.data(), s.size()}; } @@ -227,7 +227,7 @@ class chunk_encode_test testParseChunkExtensions() { auto const grind = - [&](core::string_view s) + [&](boost::core::string_view s) { error_code ec; static_string<200> ss(s.data(), s.size()); @@ -235,7 +235,7 @@ class chunk_encode_test for(auto i = 3; i--;) { test::fuzz(ss, 5, 5, r, - [&](core::string_view s) + [&](boost::core::string_view s) { chunk_extensions c1; c1.parse(s, ec); @@ -259,7 +259,7 @@ class chunk_encode_test } }; auto const good = - [&](core::string_view s) + [&](boost::core::string_view s) { error_code ec; chunk_extensions ce; @@ -268,7 +268,7 @@ class chunk_encode_test grind(s); }; auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { error_code ec; chunk_extensions ce; diff --git a/test/beast/http/field.cpp b/test/beast/http/field.cpp index c6f5c98e69..3cf19883c9 100644 --- a/test/beast/http/field.cpp +++ b/test/beast/http/field.cpp @@ -23,7 +23,7 @@ class field_test : public beast::unit_test::suite testField() { auto const match = - [&](field f, core::string_view s) + [&](field f, boost::core::string_view s) { BEAST_EXPECT(iequals(to_string(f), s)); BEAST_EXPECT(string_to_field(s) == f); @@ -163,7 +163,7 @@ class field_test : public beast::unit_test::suite match(field::x_xss_protection, "X-XSS-Protection"); auto const unknown = - [&](core::string_view s) + [&](boost::core::string_view s) { BEAST_EXPECT(string_to_field(s) == field::unknown); }; diff --git a/test/beast/http/fields.cpp b/test/beast/http/fields.cpp index 0eb3036342..620cac9253 100644 --- a/test/beast/http/fields.cpp +++ b/test/beast/http/fields.cpp @@ -1042,30 +1042,30 @@ class fields_test : public beast::unit_test::suite BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); } template diff --git a/test/beast/http/file_body.cpp b/test/beast/http/file_body.cpp index 00bf40fdff..1ba2c80e9f 100644 --- a/test/beast/http/file_body.cpp +++ b/test/beast/http/file_body.cpp @@ -103,7 +103,7 @@ class file_body_test : public beast::unit_test::suite doTestFileBody() { error_code ec; - core::string_view const s = + boost::core::string_view const s = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Content-Length: 3\r\n" @@ -147,7 +147,7 @@ class file_body_test : public beast::unit_test::suite sr.next(ec, visit); BEAST_EXPECTS(! ec, ec.message()); auto const b = buffers_front(visit.buffer.data()); - core::string_view const s1{ + boost::core::string_view const s1{ reinterpret_cast(b.data()), b.size()}; BEAST_EXPECTS(s1 == s, s1); @@ -164,7 +164,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - core::string_view const ten = + boost::core::string_view const ten = "0123456789"; // 40 // create the temporary file { @@ -219,7 +219,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - core::string_view const ten = + boost::core::string_view const ten = "0123456789"; // 40 // create the temporary file { diff --git a/test/beast/http/message.cpp b/test/beast/http/message.cpp index 0392a47754..e897eb66f8 100644 --- a/test/beast/http/message.cpp +++ b/test/beast/http/message.cpp @@ -87,23 +87,23 @@ class message_test : public beast::unit_test::suite >::value); //BOOST_CORE_STATIC_ASSERT(! std::is_constructible, - // verb, core::string_view, unsigned>::value); + // verb, boost::core::string_view, unsigned>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, core::string_view, unsigned, Arg1>::value); + verb, boost::core::string_view, unsigned, Arg1>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, core::string_view, unsigned, Arg1&&>::value); + verb, boost::core::string_view, unsigned, Arg1&&>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, core::string_view, unsigned, Arg1 const>::value); + verb, boost::core::string_view, unsigned, Arg1 const>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, core::string_view, unsigned, Arg1 const&>::value); + verb, boost::core::string_view, unsigned, Arg1 const&>::value); // 1-arg + fields BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, core::string_view, unsigned, Arg1, fields::allocator_type>::value); + verb, boost::core::string_view, unsigned, Arg1, fields::allocator_type>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, std::piecewise_construct_t, std::tuple>::value); @@ -198,15 +198,15 @@ class message_test : public beast::unit_test::suite test_fields() = delete; test_fields(token) {} - core::string_view get_method_impl() const { return {}; } - core::string_view get_target_impl() const { return target; } - core::string_view get_reason_impl() const { return {}; } + boost::core::string_view get_method_impl() const { return {}; } + boost::core::string_view get_target_impl() const { return target; } + boost::core::string_view get_reason_impl() const { return {}; } bool get_chunked_impl() const { return false; } bool get_keep_alive_impl(unsigned) const { return true; } bool has_content_length_impl() const { return false; } - void set_method_impl(core::string_view) {} - void set_target_impl(core::string_view s) { target = std::string(s); } - void set_reason_impl(core::string_view) {} + void set_method_impl(boost::core::string_view) {} + void set_target_impl(boost::core::string_view s) { target = std::string(s); } + void set_reason_impl(boost::core::string_view) {} void set_chunked_impl(bool) {} void set_content_length_impl(boost::optional) {} void set_keep_alive_impl(unsigned, bool) {} @@ -352,7 +352,7 @@ class message_test : public beast::unit_test::suite BEAST_EXPECT(h.method_string() == to_string(v)); }; auto const scheck = - [&](core::string_view s) + [&](boost::core::string_view s) { h.method_string(s); BEAST_EXPECT(h.method() == string_to_verb(s)); diff --git a/test/beast/http/message_fuzz.hpp b/test/beast/http/message_fuzz.hpp index f719c2f055..8033a0147b 100644 --- a/test/beast/http/message_fuzz.hpp +++ b/test/beast/http/message_fuzz.hpp @@ -22,7 +22,7 @@ namespace http { template std::string -escaped_string(core::string_view s) +escaped_string(boost::core::string_view s) { std::string out; out.reserve(s.size()); diff --git a/test/beast/http/parser.cpp b/test/beast/http/parser.cpp index 09eef495db..f839b0c449 100644 --- a/test/beast/http/parser.cpp +++ b/test/beast/http/parser.cpp @@ -36,7 +36,7 @@ class parser_test static net::const_buffer - buf(core::string_view s) + buf(boost::core::string_view s) { return {s.data(), s.size()}; } @@ -70,7 +70,7 @@ class parser_test template void - doMatrix(core::string_view s0, F const& f) + doMatrix(boost::core::string_view s0, F const& f) { // parse a single buffer { diff --git a/test/beast/http/read.cpp b/test/beast/http/read.cpp index b5888fb951..0b2ace4d89 100644 --- a/test/beast/http/read.cpp +++ b/test/beast/http/read.cpp @@ -440,7 +440,7 @@ class read_test template void - readgrind(core::string_view s, Pred&& pred) + readgrind(boost::core::string_view s, Pred&& pred) { for(std::size_t n = 1; n < s.size() - 1; ++n) { @@ -600,8 +600,8 @@ class read_test request_parser p; test::stream s(ioc_); - s.append(core::string_view(hdr)); - s.append(core::string_view(body)); + s.append(boost::core::string_view(hdr)); + s.append(boost::core::string_view(body)); flat_buffer fb; error_code ec; auto bt = async_read_header(s, fb, p, yield[ec]); @@ -685,8 +685,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(core::string_view(hdr)); - s.append(core::string_view(body)); + s.append(boost::core::string_view(hdr)); + s.append(boost::core::string_view(body)); flat_buffer fb; error_code ec; auto bt = read_header(s, fb, p, ec); @@ -703,8 +703,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(core::string_view(hdr)); - s.append(core::string_view(body)); + s.append(boost::core::string_view(hdr)); + s.append(boost::core::string_view(body)); std::string res ; auto fb = asio::dynamic_buffer(res); error_code ec; diff --git a/test/beast/http/rfc7230.cpp b/test/beast/http/rfc7230.cpp index 52584295de..31d5e1f72e 100644 --- a/test/beast/http/rfc7230.cpp +++ b/test/beast/http/rfc7230.cpp @@ -31,7 +31,7 @@ class rfc7230_test : public beast::unit_test::suite static std::string - str(core::string_view s) + str(boost::core::string_view s) { return std::string(s.data(), s.size()); } @@ -246,7 +246,7 @@ class rfc7230_test : public beast::unit_test::suite template static std::vector - to_vector(core::string_view in) + to_vector(boost::core::string_view in) { std::vector v; detail::basic_parsed_list list{in}; @@ -258,7 +258,7 @@ class rfc7230_test : public beast::unit_test::suite template void - validate(core::string_view in, + validate(boost::core::string_view in, std::vector const& v) { BEAST_EXPECT(to_vector(in) == v); @@ -266,7 +266,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(core::string_view in) + good(boost::core::string_view in) { BEAST_EXPECT(validate_list( detail::basic_parsed_list{in})); @@ -274,7 +274,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(core::string_view in, + good(boost::core::string_view in, std::vector const& v) { BEAST_EXPECT(validate_list( @@ -284,7 +284,7 @@ class rfc7230_test : public beast::unit_test::suite template void - bad(core::string_view in) + bad(boost::core::string_view in) { BEAST_EXPECT(! validate_list( detail::basic_parsed_list{in})); diff --git a/test/beast/http/test_parser.hpp b/test/beast/http/test_parser.hpp index 681a28028e..260a583657 100644 --- a/test/beast/http/test_parser.hpp +++ b/test/beast/http/test_parser.hpp @@ -55,8 +55,8 @@ class test_parser } void - on_request_impl(verb, core::string_view method_str_, - core::string_view path_, int version_, error_code& ec) + on_request_impl(verb, boost::core::string_view method_str_, + boost::core::string_view path_, int version_, error_code& ec) { method = std::string( method_str_.data(), method_str_.size()); @@ -70,7 +70,7 @@ class test_parser void on_response_impl(int code, - core::string_view reason_, + boost::core::string_view reason_, int version_, error_code& ec) { status = code; @@ -83,8 +83,8 @@ class test_parser } void - on_field_impl(field, core::string_view name, - core::string_view value, error_code& ec) + on_field_impl(field, boost::core::string_view name, + boost::core::string_view value, error_code& ec) { ++got_on_field; if(fc_) @@ -93,8 +93,8 @@ class test_parser } void - on_trailer_field_impl(field, core::string_view name, - core::string_view value, error_code& ec) + on_trailer_field_impl(field, boost::core::string_view name, + boost::core::string_view value, error_code& ec) { ++got_on_trailer_field; if(fc_) @@ -125,7 +125,7 @@ class test_parser } std::size_t - on_body_impl(core::string_view s, + on_body_impl(boost::core::string_view s, error_code& ec) { body.append(s.data(), s.size()); @@ -137,7 +137,7 @@ class test_parser void on_chunk_header_impl( std::uint64_t, - core::string_view, + boost::core::string_view, error_code& ec) { ++got_on_chunk; @@ -148,7 +148,7 @@ class test_parser std::size_t on_chunk_body_impl( std::uint64_t, - core::string_view s, + boost::core::string_view s, error_code& ec) { body.append(s.data(), s.size()); diff --git a/test/beast/http/verb.cpp b/test/beast/http/verb.cpp index e9b956b4a7..6ad7b4125b 100644 --- a/test/beast/http/verb.cpp +++ b/test/beast/http/verb.cpp @@ -66,7 +66,7 @@ class verb_test good(verb::unlink); auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { auto const v = string_to_verb(s); BEAST_EXPECTS(v == verb::unknown, to_string(v)); diff --git a/test/beast/http/write.cpp b/test/beast/http/write.cpp index 4bc7629dd3..c629db1da0 100644 --- a/test/beast/http/write.cpp +++ b/test/beast/http/write.cpp @@ -274,7 +274,7 @@ class write_test template bool - equal_body(core::string_view sv, core::string_view body) + equal_body(boost::core::string_view sv, boost::core::string_view body) { test::stream ts{ioc_, sv}, tr{ioc_}; ts.connect(tr); diff --git a/test/beast/websocket/accept.cpp b/test/beast/websocket/accept.cpp index 18a53b5c68..72584291cb 100644 --- a/test/beast/websocket/accept.cpp +++ b/test/beast/websocket/accept.cpp @@ -482,7 +482,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite net::io_context ioc; auto const check = - [&](error_code ev, core::string_view s) + [&](error_code ev, boost::core::string_view s) { for(int i = 0; i < 3; ++i) { @@ -798,7 +798,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite { { stream ws1(ioc); - core::string_view s = + boost::core::string_view s = "GET / HTTP/1.1\r\n" "Host: localhost\r\n" "Upgrade: websocket\r\n" diff --git a/test/beast/websocket/close.cpp b/test/beast/websocket/close.cpp index f80d3a1c2b..8d65341865 100644 --- a/test/beast/websocket/close.cpp +++ b/test/beast/websocket/close.cpp @@ -361,7 +361,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; ws.async_read(b, @@ -402,7 +402,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x09\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -443,7 +443,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -485,7 +485,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), @@ -529,7 +529,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x89\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), diff --git a/test/beast/websocket/handshake.cpp b/test/beast/websocket/handshake.cpp index 33ac381282..0ce6e84298 100644 --- a/test/beast/websocket/handshake.cpp +++ b/test/beast/websocket/handshake.cpp @@ -309,7 +309,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const accept = - [&](core::string_view s) + [&](boost::core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -319,7 +319,7 @@ class handshake_test : public websocket_test_suite }; auto const reject = - [&](core::string_view s) + [&](boost::core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -401,7 +401,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const check = - [&](core::string_view match) + [&](boost::core::string_view match) { http::fields f; detail::pmd_write(f, po); @@ -447,7 +447,7 @@ class handshake_test : public websocket_test_suite auto const reject = [&]( - core::string_view offer) + boost::core::string_view offer) { detail::pmd_offer po; { @@ -463,8 +463,8 @@ class handshake_test : public websocket_test_suite auto const accept = [&]( - core::string_view offer, - core::string_view result) + boost::core::string_view offer, + boost::core::string_view result) { detail::pmd_offer po; { diff --git a/test/beast/websocket/ping.cpp b/test/beast/websocket/ping.cpp index c2933e3fb7..007dbd43a0 100644 --- a/test/beast/websocket/ping.cpp +++ b/test/beast/websocket/ping.cpp @@ -148,7 +148,7 @@ class ping_test : public websocket_test_suite true }); unsigned n_pongs = 0; - ws1.control_callback({[&](frame_type kind, core::string_view) + ws1.control_callback({[&](frame_type kind, boost::core::string_view) { if (kind == frame_type::pong) ++n_pongs; @@ -247,7 +247,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; @@ -288,7 +288,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x09\x00", 2}); std::size_t count = 0; @@ -330,7 +330,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x88\x00", 2}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/websocket/read1.cpp b/test/beast/websocket/read1.cpp index e99e2c3558..524ec573fe 100644 --- a/test/beast/websocket/read1.cpp +++ b/test/beast/websocket/read1.cpp @@ -185,7 +185,7 @@ class read1_test : public unit_test::suite stream_base::none(), false}); // add a close frame to the input - ws1.next_layer().append(core::string_view{ + ws1.next_layer().append(boost::core::string_view{ "\x88\x00", 2}); ws1.async_read(b, test::fail_handler( beast::error::timeout)); diff --git a/test/beast/websocket/read2.cpp b/test/beast/websocket/read2.cpp index d3150228b9..ca52d0ec34 100644 --- a/test/beast/websocket/read2.cpp +++ b/test/beast/websocket/read2.cpp @@ -102,7 +102,7 @@ class read2_test [&](ws_type_t& ws) { ws.next_layer().append( - core::string_view( + boost::core::string_view( "\x01\x00" "\x80\x00", 4)); multi_buffer b; w.read(ws, b); @@ -133,7 +133,7 @@ class read2_test {0x89, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, core::string_view) + [&](frame_type kind, boost::core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::ping); @@ -155,7 +155,7 @@ class read2_test {0x88, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, core::string_view) + [&](frame_type kind, boost::core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::close); @@ -171,7 +171,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, core::string_view s) + [&](frame_type kind, boost::core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -194,7 +194,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, core::string_view s) + [&](frame_type kind, boost::core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -389,7 +389,7 @@ class read2_test // close frames { auto const check = - [&](error_code ev, core::string_view s) + [&](error_code ev, boost::core::string_view s) { echo_server es{log}; stream ws{ioc_}; @@ -560,7 +560,7 @@ class read2_test w.read_some(ws, net::buffer(buf, sizeof(buf))); BEAST_EXPECT(bytes_written > 0); BEAST_EXPECT( - core::string_view(buf, 3).substr(0, bytes_written) == + boost::core::string_view(buf, 3).substr(0, bytes_written) == s.substr(0, bytes_written)); }); @@ -637,7 +637,7 @@ class read2_test // Read close frames { auto const check = - [&](error_code ev, core::string_view s) + [&](error_code ev, boost::core::string_view s) { echo_server es{log}; stream ws{ioc_}; diff --git a/test/beast/websocket/read3.cpp b/test/beast/websocket/read3.cpp index 92ebc67e79..8e2042f6c3 100644 --- a/test/beast/websocket/read3.cpp +++ b/test/beast/websocket/read3.cpp @@ -99,7 +99,7 @@ class read3_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // insert a ping - ws.next_layer().append(core::string_view( + ws.next_layer().append(boost::core::string_view( "\x89\x00", 2)); std::size_t count = 0; std::string const s = "Hello, world"; @@ -139,7 +139,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a ping in between the frames. - ws.next_layer().append(core::string_view( + ws.next_layer().append(boost::core::string_view( "\x01\x01*" "\x89\x00" "\x80\x01*", 8)); @@ -187,7 +187,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a close in between the frames. - ws.next_layer().append(core::string_view( + ws.next_layer().append(boost::core::string_view( "\x01\x01*" "\x88\x00" "\x80\x01*", 8)); @@ -219,7 +219,7 @@ class read3_test : public websocket_test_suite testParseFrame() { auto const bad = - [&](core::string_view s) + [&](boost::core::string_view s) { echo_server es{log}; net::io_context ioc; @@ -335,8 +335,8 @@ class read3_test : public websocket_test_suite } // length not canonical - bad(core::string_view("\x81\x7e\x00\x7d", 4)); - bad(core::string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); + bad(boost::core::string_view("\x81\x7e\x00\x7d", 4)); + bad(boost::core::string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); } void @@ -398,7 +398,7 @@ class read3_test : public websocket_test_suite bool called_cb = false; bool called_handler = false; ws.control_callback( - [&called_cb](frame_type, core::string_view) + [&called_cb](frame_type, boost::core::string_view) { called_cb = true; }); diff --git a/test/beast/websocket/test.hpp b/test/beast/websocket/test.hpp index ee4b98af5b..f385c03e09 100644 --- a/test/beast/websocket/test.hpp +++ b/test/beast/websocket/test.hpp @@ -526,8 +526,8 @@ class websocket_test_suite void handshake( stream& ws, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { ws.handshake(uri, path); } @@ -537,8 +537,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { ws.handshake(res, uri, path); } @@ -549,8 +549,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -563,8 +563,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -780,8 +780,8 @@ class websocket_test_suite void handshake( stream& ws, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { error_code ec; ws.async_handshake( @@ -795,8 +795,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { error_code ec; ws.async_handshake( @@ -811,8 +811,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const &d) const { error_code ec; @@ -829,8 +829,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const &d) const { error_code ec; @@ -1061,8 +1061,8 @@ struct test_sync_api handshake( stream& ws, response_type& res, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { ws.handshake(res, uri, path); } @@ -1073,8 +1073,8 @@ struct test_sync_api void handshake_ex( stream& ws, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -1087,8 +1087,8 @@ struct test_sync_api handshake_ex( stream& ws, response_type& res, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -1361,8 +1361,8 @@ class test_async_api void handshake( stream& ws, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { error_code ec; ws.async_handshake( @@ -1378,8 +1378,8 @@ class test_async_api handshake( stream& ws, response_type& res, - core::string_view uri, - core::string_view path) const + boost::core::string_view uri, + boost::core::string_view path) const { error_code ec; ws.async_handshake( @@ -1396,8 +1396,8 @@ class test_async_api void handshake_ex( stream& ws, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const &d) const { error_code ec; @@ -1416,8 +1416,8 @@ class test_async_api handshake_ex( stream& ws, response_type& res, - core::string_view uri, - core::string_view path, + boost::core::string_view uri, + boost::core::string_view path, Decorator const &d) const { error_code ec; diff --git a/test/beast/websocket/timer.cpp b/test/beast/websocket/timer.cpp index 311b971a03..39ce3dcdc7 100644 --- a/test/beast/websocket/timer.cpp +++ b/test/beast/websocket/timer.cpp @@ -48,7 +48,7 @@ struct timer_test : unit_test::suite flat_buffer b2; bool received = false; ws1.control_callback( - [&received](frame_type ft, core::string_view) + [&received](frame_type ft, boost::core::string_view) { received = true; BEAST_EXPECT(ft == frame_type::ping); diff --git a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp index a679fafaaa..368c38d2fc 100644 --- a/test/beast/websocket/write.cpp +++ b/test/beast/websocket/write.cpp @@ -375,7 +375,7 @@ class write_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(core::string_view{ + ws.next_layer().append(boost::core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/zlib/deflate_stream.cpp b/test/beast/zlib/deflate_stream.cpp index 9557db1fec..a585ea4174 100644 --- a/test/beast/zlib/deflate_stream.cpp +++ b/test/beast/zlib/deflate_stream.cpp @@ -203,7 +203,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string compress( - core::string_view const& in, + boost::core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel) // 1..9 (8=default) @@ -240,7 +240,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string - decompress(core::string_view const& in) + decompress(boost::core::string_view const& in) { int result; std::string out; @@ -474,7 +474,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - core::string_view s = "Hello"; + boost::core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); @@ -501,7 +501,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - core::string_view s = "Hello"; + boost::core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); diff --git a/test/beast/zlib/inflate_stream.cpp b/test/beast/zlib/inflate_stream.cpp index 03631d96e5..4909ce253a 100644 --- a/test/beast/zlib/inflate_stream.cpp +++ b/test/beast/zlib/inflate_stream.cpp @@ -187,7 +187,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string compress( - core::string_view const& in, + boost::core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel, // 1..9 (8=default) diff --git a/test/bench/buffers/bench_buffers.cpp b/test/bench/buffers/bench_buffers.cpp index 8af640908b..dc36b5de1f 100644 --- a/test/bench/buffers/bench_buffers.cpp +++ b/test/bench/buffers/bench_buffers.cpp @@ -174,7 +174,7 @@ class buffers_test : public beast::unit_test::suite template void - do_trials(core::string_view name, + do_trials(boost::core::string_view name, std::size_t trials, F0&& f0, FN... fn) { using namespace std::chrono; diff --git a/test/bench/parser/bench_parser.cpp b/test/bench/parser/bench_parser.cpp index e79ffe74e8..4f97455658 100644 --- a/test/bench/parser/bench_parser.cpp +++ b/test/bench/parser/bench_parser.cpp @@ -153,21 +153,21 @@ class parser_test : public beast::unit_test::suite { void on_request_impl( - verb, core::string_view, core::string_view, + verb, boost::core::string_view, boost::core::string_view, int, error_code&) override { } void on_response_impl( - int, core::string_view, int, + int, boost::core::string_view, int, error_code&) override { } void on_field_impl( - field, core::string_view, core::string_view, + field, boost::core::string_view, boost::core::string_view, error_code&) override { } @@ -186,7 +186,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - core::string_view, + boost::core::string_view, error_code&) override { return 0; @@ -195,7 +195,7 @@ class parser_test : public beast::unit_test::suite void on_chunk_header_impl( std::uint64_t, - core::string_view, + boost::core::string_view, error_code&) override { } @@ -203,7 +203,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_chunk_body_impl( std::uint64_t, - core::string_view, + boost::core::string_view, error_code&) override { return 0; @@ -222,26 +222,26 @@ class parser_test : public beast::unit_test::suite net::mutable_buffer; void - on_request_impl(verb, core::string_view, - core::string_view, int, error_code&) override + on_request_impl(verb, boost::core::string_view, + boost::core::string_view, int, error_code&) override { } void on_response_impl(int, - core::string_view, int, error_code&) override + boost::core::string_view, int, error_code&) override { } void on_field_impl(field, - core::string_view, core::string_view, error_code&) override + boost::core::string_view, boost::core::string_view, error_code&) override { } void on_trailer_field_impl(field, - core::string_view, core::string_view, error_code&) override + boost::core::string_view, boost::core::string_view, error_code&) override { } @@ -259,20 +259,20 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - core::string_view s, error_code&) override + boost::core::string_view s, error_code&) override { return s.size(); } void on_chunk_header_impl(std::uint64_t, - core::string_view, error_code&) override + boost::core::string_view, error_code&) override { } std::size_t on_chunk_body_impl(std::uint64_t, - core::string_view s, error_code&) override + boost::core::string_view s, error_code&) override { return s.size(); } diff --git a/test/bench/zlib/deflate_stream.cpp b/test/bench/zlib/deflate_stream.cpp index 912ddf0f1f..bb3afa947c 100644 --- a/test/bench/zlib/deflate_stream.cpp +++ b/test/bench/zlib/deflate_stream.cpp @@ -65,7 +65,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateBeast(core::string_view const& in) + doDeflateBeast(boost::core::string_view const& in) { z_params zs; deflate_stream ds; @@ -88,7 +88,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateZLib(core::string_view const& in) + doDeflateZLib(boost::core::string_view const& in) { int result; z_stream zs; diff --git a/test/bench/zlib/inflate_stream.cpp b/test/bench/zlib/inflate_stream.cpp index 0c2e7fefe2..d28bab9e55 100644 --- a/test/bench/zlib/inflate_stream.cpp +++ b/test/bench/zlib/inflate_stream.cpp @@ -66,7 +66,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string - compress(core::string_view const& in) + compress(boost::core::string_view const& in) { int result; z_stream zs; @@ -98,7 +98,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateBeast(core::string_view const& in) + doInflateBeast(boost::core::string_view const& in) { z_params zs; std::string out; @@ -125,7 +125,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateZLib(core::string_view const& in) + doInflateZLib(boost::core::string_view const& in) { int result; z_stream zs; diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 69fc960922..338b6409e4 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -33,13 +33,13 @@ snippets() { //[code_core_1_refresher_1s net::const_buffer cb("Hello, world!", 13); - assert(core::string_view(reinterpret_cast( + assert(boost::core::string_view(reinterpret_cast( cb.data()), cb.size()) == "Hello, world!"); char storage[13]; net::mutable_buffer mb(storage, sizeof(storage)); std::memcpy(mb.data(), cb.data(), mb.size()); - assert(core::string_view(reinterpret_cast( + assert(boost::core::string_view(reinterpret_cast( mb.data()), mb.size()) == "Hello, world!"); //] } diff --git a/test/doc/core_snippets.cpp b/test/doc/core_snippets.cpp index d46f5473e0..7214a959a0 100644 --- a/test/doc/core_snippets.cpp +++ b/test/doc/core_snippets.cpp @@ -68,7 +68,7 @@ net::connect(stream, r.resolve("www.example.com", "http")); //[snippet_core_3 template -void write_string(SyncWriteStream& stream, core::string_view s) +void write_string(SyncWriteStream& stream, boost::core::string_view s) { static_assert(is_sync_write_stream::value, "SyncWriteStream type requirements not met"); diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index 5f502cd0e6..b290229ae9 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -199,21 +199,21 @@ class Fields @note Only called for requests. */ - core::string_view + boost::core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - core::string_view + boost::core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - core::string_view + boost::core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -236,21 +236,21 @@ class Fields @note Only called for requests. */ void - set_method_impl(core::string_view s); + set_method_impl(boost::core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(core::string_view s); + set_target_impl(boost::core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(core::string_view s); + set_reason_impl(boost::core::string_view s); /** Sets or clears the chunked Transfer-Encoding value */ diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index 4d01d91c37..d77bdb6a19 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -41,8 +41,8 @@ class custom_parser : public basic_parser void on_request_impl( verb method, // The method verb, verb::unknown if no match - core::string_view method_str, // The method as a string - core::string_view target, // The request-target + boost::core::string_view method_str, // The method as a string + boost::core::string_view target, // The request-target int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -67,7 +67,7 @@ class custom_parser : public basic_parser void on_response_impl( int code, // The status-code - core::string_view reason, // The obsolete reason-phrase + boost::core::string_view reason, // The obsolete reason-phrase int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -90,8 +90,8 @@ class custom_parser : public basic_parser void on_field_impl( field f, // The known-field enumeration constant - core::string_view name, // The field name string. - core::string_view value, // The field value + boost::core::string_view name, // The field name string. + boost::core::string_view value, // The field value error_code& ec) override; // The error returned to the caller, if any /** Called once after the complete HTTP header is received. @@ -141,7 +141,7 @@ class custom_parser : public basic_parser */ std::size_t on_body_impl( - core::string_view s, // A portion of the body + boost::core::string_view s, // A portion of the body error_code& ec) override; // The error returned to the caller, if any /** Called each time a new chunk header of a chunk encoded body is received. @@ -161,7 +161,7 @@ class custom_parser : public basic_parser on_chunk_header_impl( std::uint64_t size, // The size of the upcoming chunk, // or zero for the last chunk - core::string_view extension, // The chunk extensions (may be empty) + boost::core::string_view extension, // The chunk extensions (may be empty) error_code& ec) override; // The error returned to the caller, if any /** Called each time additional data is received representing part of a body chunk. @@ -191,7 +191,7 @@ class custom_parser : public basic_parser std::uint64_t remain, // The number of bytes remaining in the chunk, // including what is being passed here. // or zero for the last chunk - core::string_view body, // The next piece of the chunk body + boost::core::string_view body, // The next piece of the chunk body error_code& ec) override; // The error returned to the caller, if any /** Called once when the complete message is received. @@ -216,8 +216,8 @@ class custom_parser : public basic_parser template void custom_parser:: -on_request_impl(verb method, core::string_view method_str, - core::string_view path, int version, error_code& ec) +on_request_impl(verb method, boost::core::string_view method_str, + boost::core::string_view path, int version, error_code& ec) { boost::ignore_unused(method, method_str, path, version); ec = {}; @@ -227,7 +227,7 @@ template void custom_parser:: on_response_impl( int status, - core::string_view reason, + boost::core::string_view reason, int version, error_code& ec) { @@ -239,8 +239,8 @@ template void custom_parser:: on_field_impl( field f, - core::string_view name, - core::string_view value, + boost::core::string_view name, + boost::core::string_view value, error_code& ec) { boost::ignore_unused(f, name, value); @@ -266,7 +266,7 @@ on_body_init_impl( template std::size_t custom_parser:: -on_body_impl(core::string_view body, error_code& ec) +on_body_impl(boost::core::string_view body, error_code& ec) { boost::ignore_unused(body); ec = {}; @@ -277,7 +277,7 @@ template void custom_parser:: on_chunk_header_impl( std::uint64_t size, - core::string_view extension, + boost::core::string_view extension, error_code& ec) { boost::ignore_unused(size, extension); @@ -288,7 +288,7 @@ template std::size_t custom_parser:: on_chunk_body_impl( std::uint64_t remain, - core::string_view body, + boost::core::string_view body, error_code& ec) { boost::ignore_unused(remain); diff --git a/test/doc/http_examples.cpp b/test/doc/http_examples.cpp index a8ffb565bf..c6dc0b8865 100644 --- a/test/doc/http_examples.cpp +++ b/test/doc/http_examples.cpp @@ -55,7 +55,7 @@ class examples_test template bool - equal_body(core::string_view sv, core::string_view body) + equal_body(boost::core::string_view sv, boost::core::string_view body) { test::stream ts{ioc_, sv}; message m; @@ -271,7 +271,7 @@ class examples_test doExplicitChunkSerialize() { auto const buf = - [](core::string_view s) + [](boost::core::string_view s) { return net::const_buffer{ s.data(), s.size()}; diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 867f115573..3d53831792 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -251,7 +251,7 @@ void fxx() { //[http_snippet_23 // Manually emit a trailer. // We are responsible for ensuring that the trailer format adheres to the specification. - core::string_view ext = + boost::core::string_view ext = "Content-Digest: f4a5c16584f03d90\r\n" "\r\n"; net::write(sock, make_chunk_last(net::const_buffer{ext.data(), ext.size()})); diff --git a/test/doc/websocket_2_handshaking.cpp b/test/doc/websocket_2_handshaking.cpp index 0f2532507b..76670c5ae4 100644 --- a/test/doc/websocket_2_handshaking.cpp +++ b/test/doc/websocket_2_handshaking.cpp @@ -136,14 +136,14 @@ snippets() //[code_websocket_2_6 // a function to select the most preferred protocol from a comma-separated list - auto select_protocol = [](core::string_view offered_tokens) -> std::string + auto select_protocol = [](boost::core::string_view offered_tokens) -> std::string { // tokenize the Sec-Websocket-Protocol header offered by the client http::token_list offered( offered_tokens ); // an array of protocols supported by this server // in descending order of preference - static const std::array + static const std::array supported = {{ "v3.my.chat", "v2.my.chat", diff --git a/test/doc/websocket_5_control_frames.cpp b/test/doc/websocket_5_control_frames.cpp index 54c587b660..930795093c 100644 --- a/test/doc/websocket_5_control_frames.cpp +++ b/test/doc/websocket_5_control_frames.cpp @@ -33,7 +33,7 @@ snippets() //[code_websocket_5_1 ws.control_callback( - [](frame_type kind, core::string_view payload) + [](frame_type kind, boost::core::string_view payload) { // Do something with the payload boost::ignore_unused(kind, payload); diff --git a/test/extras/include/boost/beast/test/fuzz.hpp b/test/extras/include/boost/beast/test/fuzz.hpp index f127d8234b..8a034270a3 100644 --- a/test/extras/include/boost/beast/test/fuzz.hpp +++ b/test/extras/include/boost/beast/test/fuzz.hpp @@ -92,7 +92,7 @@ fuzz( break; } } - f(core::string_view{mod.data(), mod.size()}); + f(boost::core::string_view{mod.data(), mod.size()}); if(depth > 0) fuzz(mod, repeat, depth - 1, r, f); } diff --git a/test/fuzz/http_response.cpp b/test/fuzz/http_response.cpp index bdc029af07..07de5b0e9a 100644 --- a/test/fuzz/http_response.cpp +++ b/test/fuzz/http_response.cpp @@ -21,7 +21,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) http::chunk_extensions ce; http::response_parser parser; - auto chunk_header_cb = [&ce](std::uint64_t, core::string_view extensions, error_code& ev) + auto chunk_header_cb = [&ce](std::uint64_t, boost::core::string_view extensions, error_code& ev) { ce.parse(extensions, ev); }; diff --git a/test/fuzz/websocket_server.cpp b/test/fuzz/websocket_server.cpp index ab83da5e0e..1e0cf5be11 100644 --- a/test/fuzz/websocket_server.cpp +++ b/test/fuzz/websocket_server.cpp @@ -18,7 +18,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) test::stream remote{ioc}; websocket::stream ws{ - ioc, core::string_view{reinterpret_cast(data), size}}; + ioc, boost::core::string_view{reinterpret_cast(data), size}}; ws.set_option(websocket::stream_base::decorator( [](websocket::response_type& res) From f1d1624228d39cbb6f749e9597831b4879cbb53d Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 11:52:14 -0600 Subject: [PATCH 04/10] Fix remaining string_view references in RFC7230 files This fixes macOS compilation errors where the compiler couldn't resolve the unqualified string_view type in iterator declarations. --- include/boost/beast/http/detail/rfc7230.hpp | 2 +- include/boost/beast/http/impl/rfc7230.hpp | 2 +- include/boost/beast/http/rfc7230.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/beast/http/detail/rfc7230.hpp b/include/boost/beast/http/detail/rfc7230.hpp index 4b45fb3aa5..ab89d1641b 100644 --- a/include/boost/beast/http/detail/rfc7230.hpp +++ b/include/boost/beast/http/detail/rfc7230.hpp @@ -63,7 +63,7 @@ trim(boost::core::string_view s); struct param_iter { - using iter_type = string_view::const_iterator; + using iter_type = boost::core::string_view::const_iterator; iter_type it; iter_type first; diff --git a/include/boost/beast/http/impl/rfc7230.hpp b/include/boost/beast/http/impl/rfc7230.hpp index bc0a478982..7ca8560f46 100644 --- a/include/boost/beast/http/impl/rfc7230.hpp +++ b/include/boost/beast/http/impl/rfc7230.hpp @@ -19,7 +19,7 @@ namespace http { class param_list::const_iterator { - using iter_type = string_view::const_iterator; + using iter_type = boost::core::string_view::const_iterator; std::string s_; detail::param_iter pi_; diff --git a/include/boost/beast/http/rfc7230.hpp b/include/boost/beast/http/rfc7230.hpp index b68972c84d..ddad8f4345 100644 --- a/include/boost/beast/http/rfc7230.hpp +++ b/include/boost/beast/http/rfc7230.hpp @@ -140,7 +140,7 @@ class param_list */ class ext_list { - using iter_type = string_view::const_iterator; + using iter_type = boost::core::string_view::const_iterator; boost::core::string_view s_; @@ -233,7 +233,7 @@ class ext_list */ class token_list { - using iter_type = string_view::const_iterator; + using iter_type = boost::core::string_view::const_iterator; boost::core::string_view s_; From 80172ef1a92d89b3482bd03a59b980ddca355940 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 12:25:22 -0600 Subject: [PATCH 05/10] Update examples to use boost::core::string_view instead of beast::string_view --- .../advanced_server_flex_awaitable.cpp | 30 +++++++++---------- .../server-flex/advanced_server_flex.cpp | 22 +++++++------- example/advanced/server/advanced_server.cpp | 22 +++++++------- .../client/methods/http_client_methods.cpp | 2 +- .../async-local/http_server_async_local.cpp | 22 +++++++------- .../async-ssl/http_server_async_ssl.cpp | 22 +++++++------- .../http/server/async/http_server_async.cpp | 22 +++++++------- .../awaitable/http_server_awaitable.cpp | 22 +++++++------- .../server/coro-ssl/http_server_coro_ssl.cpp | 22 +++++++------- example/http/server/coro/http_server_coro.cpp | 22 +++++++------- example/http/server/fast/http_server_fast.cpp | 10 +++---- example/http/server/flex/http_server_flex.cpp | 22 +++++++------- .../http_server_stackless_ssl.cpp | 22 +++++++------- .../stackless/http_server_stackless.cpp | 22 +++++++------- .../server/sync-ssl/http_server_sync_ssl.cpp | 22 +++++++------- example/http/server/sync/http_server_sync.cpp | 22 +++++++------- .../server/chat-multi/http_session.cpp | 22 +++++++------- 17 files changed, 175 insertions(+), 175 deletions(-) diff --git a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp index d33eba9832..e5e5b31863 100644 --- a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp +++ b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp @@ -42,15 +42,15 @@ using stream_type = typename beast::tcp_stream::rebind_executor using acceptor_type = typename net::ip::tcp::acceptor::rebind_executor::other; // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -81,8 +81,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -111,12 +111,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -129,7 +129,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -142,7 +142,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -161,7 +161,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file @@ -416,7 +416,7 @@ net::awaitable run_session( Stream& stream, beast::flat_buffer& buffer, - beast::string_view doc_root) + boost::core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; @@ -457,7 +457,7 @@ net::awaitable detect_session( stream_type stream, ssl::context& ctx, - beast::string_view doc_root) + boost::core::string_view doc_root) { beast::flat_buffer buffer; @@ -509,7 +509,7 @@ listen( task_group& task_group, ssl::context& ctx, net::ip::tcp::endpoint endpoint, - beast::string_view doc_root) + boost::core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; auto executor = co_await net::this_coro::executor; @@ -600,7 +600,7 @@ main(int argc, char* argv[]) auto const address = net::ip::make_address(argv[1]); auto const port = static_cast(std::atoi(argv[2])); auto const endpoint = net::ip::tcp::endpoint{ address, port }; - auto const doc_root = beast::string_view{ argv[3] }; + auto const doc_root = boost::core::string_view{ argv[3] }; auto const threads = std::max(1, std::atoi(argv[4])); // The io_context is required for all I/O diff --git a/example/advanced/server-flex/advanced_server_flex.cpp b/example/advanced/server-flex/advanced_server_flex.cpp index c04c91d18e..6d078c610e 100644 --- a/example/advanced/server-flex/advanced_server_flex.cpp +++ b/example/advanced/server-flex/advanced_server_flex.cpp @@ -44,15 +44,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -83,8 +83,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -113,12 +113,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -131,7 +131,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -144,7 +144,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -163,7 +163,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/advanced/server/advanced_server.cpp b/example/advanced/server/advanced_server.cpp index e854b2a6e2..6c3e6d8e5a 100644 --- a/example/advanced/server/advanced_server.cpp +++ b/example/advanced/server/advanced_server.cpp @@ -40,15 +40,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -79,8 +79,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -109,12 +109,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -127,7 +127,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -140,7 +140,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -159,7 +159,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/client/methods/http_client_methods.cpp b/example/http/client/methods/http_client_methods.cpp index f48cf99b74..7c11e9dfa3 100644 --- a/example/http/client/methods/http_client_methods.cpp +++ b/example/http/client/methods/http_client_methods.cpp @@ -147,7 +147,7 @@ int main(int argc, char** argv) for (char * c = argv[1]; *c != '\0'; c++) *c = static_cast(std::tolower(*c)); - beast::string_view method{argv[1]}; + boost::core::string_view method{argv[1]}; // The io_context is required for all I/O net::io_context ioc; diff --git a/example/http/server/async-local/http_server_async_local.cpp b/example/http/server/async-local/http_server_async_local.cpp index b958b89fe9..ffa2561c19 100644 --- a/example/http/server/async-local/http_server_async_local.cpp +++ b/example/http/server/async-local/http_server_async_local.cpp @@ -38,15 +38,15 @@ namespace net = boost::asio; // from using stream_protocol = net::local::stream_protocol; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -77,8 +77,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -107,12 +107,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -125,7 +125,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -138,7 +138,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -157,7 +157,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async-ssl/http_server_async_ssl.cpp b/example/http/server/async-ssl/http_server_async_ssl.cpp index b6498d3a2d..5409d0d202 100644 --- a/example/http/server/async-ssl/http_server_async_ssl.cpp +++ b/example/http/server/async-ssl/http_server_async_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async/http_server_async.cpp b/example/http/server/async/http_server_async.cpp index 617701d2a3..df99661ae2 100644 --- a/example/http/server/async/http_server_async.cpp +++ b/example/http/server/async/http_server_async.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/awaitable/http_server_awaitable.cpp b/example/http/server/awaitable/http_server_awaitable.cpp index 0933bd5436..fb531ef7e9 100644 --- a/example/http/server/awaitable/http_server_awaitable.cpp +++ b/example/http/server/awaitable/http_server_awaitable.cpp @@ -37,15 +37,15 @@ namespace http = beast::http; namespace net = boost::asio; // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro-ssl/http_server_coro_ssl.cpp b/example/http/server/coro-ssl/http_server_coro_ssl.cpp index 93e3b2f315..28a3646e35 100644 --- a/example/http/server/coro-ssl/http_server_coro_ssl.cpp +++ b/example/http/server/coro-ssl/http_server_coro_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro/http_server_coro.cpp b/example/http/server/coro/http_server_coro.cpp index 213bb4161e..a774fe9d58 100644 --- a/example/http/server/coro/http_server_coro.cpp +++ b/example/http/server/coro/http_server_coro.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/fast/http_server_fast.cpp b/example/http/server/fast/http_server_fast.cpp index 3ddd8bb111..9f73734320 100644 --- a/example/http/server/fast/http_server_fast.cpp +++ b/example/http/server/fast/http_server_fast.cpp @@ -33,15 +33,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -230,7 +230,7 @@ class http_worker }); } - void send_file(beast::string_view target) + void send_file(boost::core::string_view target) { // Request path must be absolute and not contain "..". if (target.empty() || target[0] != '/' || target.find("..") != std::string::npos) diff --git a/example/http/server/flex/http_server_flex.cpp b/example/http/server/flex/http_server_flex.cpp index b586fb7f54..120bd31127 100644 --- a/example/http/server/flex/http_server_flex.cpp +++ b/example/http/server/flex/http_server_flex.cpp @@ -36,15 +36,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -75,8 +75,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -105,12 +105,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -123,7 +123,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -136,7 +136,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -155,7 +155,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp index 8573022589..018055933f 100644 --- a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp +++ b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp @@ -39,15 +39,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -78,8 +78,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -108,12 +108,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -126,7 +126,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -139,7 +139,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -158,7 +158,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless/http_server_stackless.cpp b/example/http/server/stackless/http_server_stackless.cpp index 87d0fccc6e..89a6a0f943 100644 --- a/example/http/server/stackless/http_server_stackless.cpp +++ b/example/http/server/stackless/http_server_stackless.cpp @@ -35,15 +35,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync-ssl/http_server_sync_ssl.cpp b/example/http/server/sync-ssl/http_server_sync_ssl.cpp index 3571638ee4..362bdc5c78 100644 --- a/example/http/server/sync-ssl/http_server_sync_ssl.cpp +++ b/example/http/server/sync-ssl/http_server_sync_ssl.cpp @@ -35,15 +35,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync/http_server_sync.cpp b/example/http/server/sync/http_server_sync.cpp index 09a3af31e1..539d75ab3f 100644 --- a/example/http/server/sync/http_server_sync.cpp +++ b/example/http/server/sync/http_server_sync.cpp @@ -32,15 +32,15 @@ using tcp = boost::asio::ip::tcp; // from //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -71,8 +71,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if (base.empty()) return std::string(path); @@ -101,12 +101,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -119,7 +119,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -132,7 +132,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -151,7 +151,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/websocket/server/chat-multi/http_session.cpp b/example/websocket/server/chat-multi/http_session.cpp index ee6cb0c3bc..b649724774 100644 --- a/example/websocket/server/chat-multi/http_session.cpp +++ b/example/websocket/server/chat-multi/http_session.cpp @@ -15,15 +15,15 @@ //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -beast::string_view -mime_type(beast::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == beast::string_view::npos) - return beast::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -54,8 +54,8 @@ mime_type(beast::string_view path) // The returned path is normalized for the platform. std::string path_cat( - beast::string_view base, - beast::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -84,12 +84,12 @@ path_cat( template http::message_generator handle_request( - beast::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](beast::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -102,7 +102,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](beast::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -115,7 +115,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](beast::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != beast::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file From 3c42b839e617859303460e872f6e90873016c99c Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 13:33:37 -0600 Subject: [PATCH 06/10] Remove boost:: prefix from core::string_view when inside boost namespace and fix comment alignment --- .../advanced_server_flex_awaitable.cpp | 30 +++---- .../server-flex/advanced_server_flex.cpp | 22 ++--- example/advanced/server/advanced_server.cpp | 22 ++--- example/doc/http_examples.hpp | 10 +-- .../client/methods/http_client_methods.cpp | 2 +- .../async-local/http_server_async_local.cpp | 22 ++--- .../async-ssl/http_server_async_ssl.cpp | 22 ++--- .../http/server/async/http_server_async.cpp | 22 ++--- .../awaitable/http_server_awaitable.cpp | 22 ++--- .../server/coro-ssl/http_server_coro_ssl.cpp | 22 ++--- example/http/server/coro/http_server_coro.cpp | 22 ++--- example/http/server/fast/http_server_fast.cpp | 10 +-- example/http/server/flex/http_server_flex.cpp | 22 ++--- .../http_server_stackless_ssl.cpp | 22 ++--- .../stackless/http_server_stackless.cpp | 22 ++--- .../server/sync-ssl/http_server_sync_ssl.cpp | 22 ++--- example/http/server/sync/http_server_sync.cpp | 22 ++--- .../server/chat-multi/http_session.cpp | 22 ++--- .../boost/beast/_experimental/test/stream.hpp | 8 +- .../beast/core/detail/static_ostream.hpp | 4 +- include/boost/beast/core/detail/string.hpp | 4 +- .../beast/core/detail/temporary_buffer.hpp | 8 +- .../boost/beast/core/impl/string_param.hpp | 6 +- include/boost/beast/core/string.hpp | 16 ++-- include/boost/beast/core/string_param.hpp | 14 +-- include/boost/beast/core/string_type.hpp | 4 +- include/boost/beast/http/basic_parser.hpp | 22 ++--- include/boost/beast/http/chunk_encode.hpp | 28 +++--- .../beast/http/detail/basic_parsed_list.hpp | 4 +- .../boost/beast/http/detail/basic_parser.hpp | 14 +-- .../boost/beast/http/detail/chunk_encode.hpp | 2 +- include/boost/beast/http/detail/rfc7230.hpp | 12 +-- .../boost/beast/http/detail/type_traits.hpp | 30 +++---- include/boost/beast/http/field.hpp | 4 +- include/boost/beast/http/fields.hpp | 86 +++++++++---------- .../boost/beast/http/impl/chunk_encode.hpp | 16 ++-- include/boost/beast/http/impl/fields.hpp | 82 +++++++++--------- include/boost/beast/http/impl/message.hpp | 18 ++-- include/boost/beast/http/impl/rfc7230.hpp | 4 +- include/boost/beast/http/message.hpp | 26 +++--- .../boost/beast/http/message_generator.hpp | 2 +- include/boost/beast/http/parser.hpp | 48 +++++------ include/boost/beast/http/rfc7230.hpp | 28 +++--- include/boost/beast/http/status.hpp | 2 +- include/boost/beast/http/verb.hpp | 4 +- .../boost/beast/websocket/detail/hybi13.hpp | 2 +- .../beast/websocket/detail/pmd_extension.hpp | 2 +- include/boost/beast/websocket/impl/accept.hpp | 4 +- .../boost/beast/websocket/impl/handshake.hpp | 28 +++--- include/boost/beast/websocket/impl/stream.hpp | 2 +- .../beast/websocket/impl/stream_impl.hpp | 4 +- include/boost/beast/websocket/rfc6455.hpp | 4 +- include/boost/beast/websocket/stream.hpp | 32 +++---- test/beast/_experimental/icy_stream.cpp | 2 +- test/beast/core/_detail_base64.cpp | 4 +- test/beast/core/basic_stream.cpp | 10 +-- test/beast/core/bind_handler.cpp | 10 +-- test/beast/core/buffers_cat.cpp | 2 +- test/beast/core/buffers_range.cpp | 2 +- test/beast/core/buffers_suffix.cpp | 2 +- test/beast/core/detect_ssl.cpp | 6 +- test/beast/core/file_test.hpp | 2 +- test/beast/core/flat_buffer.cpp | 2 +- test/beast/core/flat_static_buffer.cpp | 2 +- test/beast/core/make_printable.cpp | 2 +- test/beast/core/multi_buffer.cpp | 4 +- test/beast/core/ostream.cpp | 8 +- test/beast/core/static_buffer.cpp | 2 +- test/beast/core/static_string.cpp | 26 +++--- test/beast/core/test_buffer.hpp | 16 ++-- test/beast/http/basic_parser.cpp | 32 +++---- test/beast/http/chunk_encode.cpp | 14 +-- test/beast/http/field.cpp | 4 +- test/beast/http/fields.cpp | 28 +++--- test/beast/http/file_body.cpp | 8 +- test/beast/http/message.cpp | 26 +++--- test/beast/http/message_fuzz.hpp | 2 +- test/beast/http/parser.cpp | 4 +- test/beast/http/read.cpp | 14 +-- test/beast/http/rfc7230.cpp | 12 +-- test/beast/http/test_parser.hpp | 20 ++--- test/beast/http/verb.cpp | 2 +- test/beast/http/write.cpp | 2 +- test/beast/websocket/accept.cpp | 4 +- test/beast/websocket/close.cpp | 10 +-- test/beast/websocket/handshake.cpp | 12 +-- test/beast/websocket/ping.cpp | 8 +- test/beast/websocket/read1.cpp | 2 +- test/beast/websocket/read2.cpp | 16 ++-- test/beast/websocket/read3.cpp | 14 +-- test/beast/websocket/test.hpp | 60 ++++++------- test/beast/websocket/timer.cpp | 2 +- test/beast/websocket/write.cpp | 2 +- test/beast/zlib/deflate_stream.cpp | 8 +- test/beast/zlib/inflate_stream.cpp | 2 +- test/bench/buffers/bench_buffers.cpp | 2 +- test/bench/parser/bench_parser.cpp | 28 +++--- test/bench/zlib/deflate_stream.cpp | 4 +- test/bench/zlib/inflate_stream.cpp | 6 +- test/doc/core_1_refresher.cpp | 4 +- test/doc/core_snippets.cpp | 2 +- test/doc/exemplars.cpp | 12 +-- test/doc/http_10_custom_parser.cpp | 64 +++++++------- test/doc/http_examples.cpp | 4 +- test/doc/http_snippets.cpp | 2 +- test/doc/websocket_2_handshaking.cpp | 4 +- test/doc/websocket_5_control_frames.cpp | 2 +- test/extras/include/boost/beast/test/fuzz.hpp | 2 +- test/fuzz/http_response.cpp | 2 +- test/fuzz/websocket_server.cpp | 2 +- 110 files changed, 742 insertions(+), 742 deletions(-) diff --git a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp index e5e5b31863..d4631da354 100644 --- a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp +++ b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp @@ -42,15 +42,15 @@ using stream_type = typename beast::tcp_stream::rebind_executor using acceptor_type = typename net::ip::tcp::acceptor::rebind_executor::other; // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -81,8 +81,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -111,12 +111,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -129,7 +129,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -142,7 +142,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -161,7 +161,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file @@ -416,7 +416,7 @@ net::awaitable run_session( Stream& stream, beast::flat_buffer& buffer, - boost::core::string_view doc_root) + core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; @@ -457,7 +457,7 @@ net::awaitable detect_session( stream_type stream, ssl::context& ctx, - boost::core::string_view doc_root) + core::string_view doc_root) { beast::flat_buffer buffer; @@ -509,7 +509,7 @@ listen( task_group& task_group, ssl::context& ctx, net::ip::tcp::endpoint endpoint, - boost::core::string_view doc_root) + core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; auto executor = co_await net::this_coro::executor; @@ -600,7 +600,7 @@ main(int argc, char* argv[]) auto const address = net::ip::make_address(argv[1]); auto const port = static_cast(std::atoi(argv[2])); auto const endpoint = net::ip::tcp::endpoint{ address, port }; - auto const doc_root = boost::core::string_view{ argv[3] }; + auto const doc_root = core::string_view{ argv[3] }; auto const threads = std::max(1, std::atoi(argv[4])); // The io_context is required for all I/O diff --git a/example/advanced/server-flex/advanced_server_flex.cpp b/example/advanced/server-flex/advanced_server_flex.cpp index 6d078c610e..9ab2f53bcf 100644 --- a/example/advanced/server-flex/advanced_server_flex.cpp +++ b/example/advanced/server-flex/advanced_server_flex.cpp @@ -44,15 +44,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -83,8 +83,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -113,12 +113,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -131,7 +131,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -144,7 +144,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -163,7 +163,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/advanced/server/advanced_server.cpp b/example/advanced/server/advanced_server.cpp index 6c3e6d8e5a..f9c65f5590 100644 --- a/example/advanced/server/advanced_server.cpp +++ b/example/advanced/server/advanced_server.cpp @@ -40,15 +40,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -79,8 +79,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -109,12 +109,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -127,7 +127,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -140,7 +140,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -159,7 +159,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/doc/http_examples.hpp b/example/doc/http_examples.hpp index 4165b27c0a..3bca1ef3d9 100644 --- a/example/doc/http_examples.hpp +++ b/example/doc/http_examples.hpp @@ -376,7 +376,7 @@ response do_head_request( SyncStream& stream, DynamicBuffer& buffer, - boost::core::string_view target, + core::string_view target, error_code& ec) { // Do some type checking to be a good citizen @@ -979,8 +979,8 @@ print_chunked_body( // after each chunk header and also after the last chunk. auto header_cb = [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk - boost::core::string_view extensions, // The raw chunk-extensions string. Already validated. - error_code& ev) // We can set this to indicate an error + core::string_view extensions, // The raw chunk-extensions string. Already validated. + error_code& ev) // We can set this to indicate an error { // Parse the chunk extensions so we can access them easily ce.parse(extensions, ev); @@ -1008,8 +1008,8 @@ print_chunked_body( // more times for each piece of a chunk body. auto body_cb = [&](std::uint64_t remain, // The number of bytes left in this chunk - boost::core::string_view body, // A buffer holding chunk body data - error_code& ec) // We can set this to indicate an error + core::string_view body, // A buffer holding chunk body data + error_code& ec) // We can set this to indicate an error { // If this is the last piece of the chunk body, // set the error so that the call to `read` returns diff --git a/example/http/client/methods/http_client_methods.cpp b/example/http/client/methods/http_client_methods.cpp index 7c11e9dfa3..0d1b9ce0dc 100644 --- a/example/http/client/methods/http_client_methods.cpp +++ b/example/http/client/methods/http_client_methods.cpp @@ -147,7 +147,7 @@ int main(int argc, char** argv) for (char * c = argv[1]; *c != '\0'; c++) *c = static_cast(std::tolower(*c)); - boost::core::string_view method{argv[1]}; + core::string_view method{argv[1]}; // The io_context is required for all I/O net::io_context ioc; diff --git a/example/http/server/async-local/http_server_async_local.cpp b/example/http/server/async-local/http_server_async_local.cpp index ffa2561c19..2fdc63b463 100644 --- a/example/http/server/async-local/http_server_async_local.cpp +++ b/example/http/server/async-local/http_server_async_local.cpp @@ -38,15 +38,15 @@ namespace net = boost::asio; // from using stream_protocol = net::local::stream_protocol; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -77,8 +77,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -107,12 +107,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -125,7 +125,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -138,7 +138,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -157,7 +157,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async-ssl/http_server_async_ssl.cpp b/example/http/server/async-ssl/http_server_async_ssl.cpp index 5409d0d202..e21f419f96 100644 --- a/example/http/server/async-ssl/http_server_async_ssl.cpp +++ b/example/http/server/async-ssl/http_server_async_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async/http_server_async.cpp b/example/http/server/async/http_server_async.cpp index df99661ae2..63e2c122c0 100644 --- a/example/http/server/async/http_server_async.cpp +++ b/example/http/server/async/http_server_async.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/awaitable/http_server_awaitable.cpp b/example/http/server/awaitable/http_server_awaitable.cpp index fb531ef7e9..fc9cb9c19c 100644 --- a/example/http/server/awaitable/http_server_awaitable.cpp +++ b/example/http/server/awaitable/http_server_awaitable.cpp @@ -37,15 +37,15 @@ namespace http = beast::http; namespace net = boost::asio; // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro-ssl/http_server_coro_ssl.cpp b/example/http/server/coro-ssl/http_server_coro_ssl.cpp index 28a3646e35..8b418f123d 100644 --- a/example/http/server/coro-ssl/http_server_coro_ssl.cpp +++ b/example/http/server/coro-ssl/http_server_coro_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro/http_server_coro.cpp b/example/http/server/coro/http_server_coro.cpp index a774fe9d58..9ea834d7fb 100644 --- a/example/http/server/coro/http_server_coro.cpp +++ b/example/http/server/coro/http_server_coro.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/fast/http_server_fast.cpp b/example/http/server/fast/http_server_fast.cpp index 9f73734320..2b78e17a98 100644 --- a/example/http/server/fast/http_server_fast.cpp +++ b/example/http/server/fast/http_server_fast.cpp @@ -33,15 +33,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -230,7 +230,7 @@ class http_worker }); } - void send_file(boost::core::string_view target) + void send_file(core::string_view target) { // Request path must be absolute and not contain "..". if (target.empty() || target[0] != '/' || target.find("..") != std::string::npos) diff --git a/example/http/server/flex/http_server_flex.cpp b/example/http/server/flex/http_server_flex.cpp index 120bd31127..ac57a19747 100644 --- a/example/http/server/flex/http_server_flex.cpp +++ b/example/http/server/flex/http_server_flex.cpp @@ -36,15 +36,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -75,8 +75,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -105,12 +105,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -123,7 +123,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -136,7 +136,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -155,7 +155,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp index 018055933f..62595cf05f 100644 --- a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp +++ b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp @@ -39,15 +39,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -78,8 +78,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -108,12 +108,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -126,7 +126,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -139,7 +139,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -158,7 +158,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless/http_server_stackless.cpp b/example/http/server/stackless/http_server_stackless.cpp index 89a6a0f943..c5d7d0bc76 100644 --- a/example/http/server/stackless/http_server_stackless.cpp +++ b/example/http/server/stackless/http_server_stackless.cpp @@ -35,15 +35,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync-ssl/http_server_sync_ssl.cpp b/example/http/server/sync-ssl/http_server_sync_ssl.cpp index 362bdc5c78..a53ab39983 100644 --- a/example/http/server/sync-ssl/http_server_sync_ssl.cpp +++ b/example/http/server/sync-ssl/http_server_sync_ssl.cpp @@ -35,15 +35,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync/http_server_sync.cpp b/example/http/server/sync/http_server_sync.cpp index 539d75ab3f..d800fbd36f 100644 --- a/example/http/server/sync/http_server_sync.cpp +++ b/example/http/server/sync/http_server_sync.cpp @@ -32,15 +32,15 @@ using tcp = boost::asio::ip::tcp; // from //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -71,8 +71,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if (base.empty()) return std::string(path); @@ -101,12 +101,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -119,7 +119,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -132,7 +132,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -151,7 +151,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/websocket/server/chat-multi/http_session.cpp b/example/websocket/server/chat-multi/http_session.cpp index b649724774..550b479193 100644 --- a/example/websocket/server/chat-multi/http_session.cpp +++ b/example/websocket/server/chat-multi/http_session.cpp @@ -15,15 +15,15 @@ //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -boost::core::string_view -mime_type(boost::core::string_view path) +core::string_view +mime_type(core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == boost::core::string_view::npos) - return boost::core::string_view{}; + if(pos == core::string_view::npos) + return core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -54,8 +54,8 @@ mime_type(boost::core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - boost::core::string_view base, - boost::core::string_view path) + core::string_view base, + core::string_view path) { if(base.empty()) return std::string(path); @@ -84,12 +84,12 @@ path_cat( template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](boost::core::string_view why) + [&req](core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -102,7 +102,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](boost::core::string_view target) + [&req](core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -115,7 +115,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](boost::core::string_view what) + [&req](core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != boost::core::string_view::npos) + req.target().find("..") != core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/include/boost/beast/_experimental/test/stream.hpp b/include/boost/beast/_experimental/test/stream.hpp index 9d997dd6ed..a7689b3e7b 100644 --- a/include/boost/beast/_experimental/test/stream.hpp +++ b/include/boost/beast/_experimental/test/stream.hpp @@ -281,7 +281,7 @@ class basic_stream */ basic_stream( net::io_context& ioc, - boost::core::string_view s); + core::string_view s); /** Construct a stream @@ -301,7 +301,7 @@ class basic_stream basic_stream( net::io_context& ioc, fail_count& fc, - boost::core::string_view s); + core::string_view s); /// Establish a connection void @@ -333,12 +333,12 @@ class basic_stream } /// Returns a string view representing the pending input data - boost::core::string_view + core::string_view str() const; /// Appends a string to the pending input data void - append(boost::core::string_view s); + append(core::string_view s); /// Clear the pending input area void diff --git a/include/boost/beast/core/detail/static_ostream.hpp b/include/boost/beast/core/detail/static_ostream.hpp index d4bc800d07..22014b6175 100644 --- a/include/boost/beast/core/detail/static_ostream.hpp +++ b/include/boost/beast/core/detail/static_ostream.hpp @@ -50,7 +50,7 @@ class static_ostream_buffer { } - boost::core::string_view + core::string_view str() const { if(! s_.empty()) @@ -128,7 +128,7 @@ class static_ostream : public std::basic_ostream imbue(std::locale::classic()); } - boost::core::string_view + core::string_view str() const { return osb_.str(); diff --git a/include/boost/beast/core/detail/string.hpp b/include/boost/beast/core/detail/string.hpp index e734767fb1..bf7b059549 100644 --- a/include/boost/beast/core/detail/string.hpp +++ b/include/boost/beast/core/detail/string.hpp @@ -22,10 +22,10 @@ namespace detail { namespace string_literals { inline -boost::core::string_view +core::string_view operator""_sv(char const* p, std::size_t n) { - return boost::core::string_view{p, n}; + return core::string_view{p, n}; } } // string_literals diff --git a/include/boost/beast/core/detail/temporary_buffer.hpp b/include/boost/beast/core/detail/temporary_buffer.hpp index dff07bd625..14526b1333 100644 --- a/include/boost/beast/core/detail/temporary_buffer.hpp +++ b/include/boost/beast/core/detail/temporary_buffer.hpp @@ -32,13 +32,13 @@ struct temporary_buffer BOOST_BEAST_DECL void - append(boost::core::string_view s); + append(core::string_view s); BOOST_BEAST_DECL void - append(boost::core::string_view s1, boost::core::string_view s2); + append(core::string_view s1, core::string_view s2); - boost::core::string_view + core::string_view view() const noexcept { return {data_, size_}; @@ -53,7 +53,7 @@ struct temporary_buffer private: BOOST_BEAST_DECL void - unchecked_append(boost::core::string_view s); + unchecked_append(core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/core/impl/string_param.hpp b/include/boost/beast/core/impl/string_param.hpp index 9653cf1a36..4ec1028e33 100644 --- a/include/boost/beast/core/impl/string_param.hpp +++ b/include/boost/beast/core/impl/string_param.hpp @@ -30,7 +30,7 @@ print(T const& t) template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type string_param:: print(T const& t) @@ -44,7 +44,7 @@ print(T const& t) inline void string_param:: -print(boost::core::string_view sv) +print(core::string_view sv) { sv_ = sv; } @@ -60,7 +60,7 @@ print_1(T const& t) auto const it = detail::raw_to_string< char, T, std::char_traits>( last, sizeof(buf), t); - *os_ << boost::core::string_view{it, + *os_ << core::string_view{it, static_cast(last - it)}; } diff --git a/include/boost/beast/core/string.hpp b/include/boost/beast/core/string.hpp index 9c61a4f534..64386a907c 100644 --- a/include/boost/beast/core/string.hpp +++ b/include/boost/beast/core/string.hpp @@ -27,8 +27,8 @@ namespace beast { BOOST_BEAST_DECL bool iequals( - boost::core::string_view lhs, - boost::core::string_view rhs); + core::string_view lhs, + core::string_view rhs); /** A case-insensitive less predicate for strings. @@ -36,15 +36,15 @@ iequals( As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref boost::core::string_view. + @ref core::string_view. */ struct iless { BOOST_BEAST_DECL bool operator()( - boost::core::string_view lhs, - boost::core::string_view rhs) const; + core::string_view lhs, + core::string_view rhs) const; using is_transparent = void; }; @@ -55,14 +55,14 @@ struct iless As of C++14, containers using this class as the `Compare` type will take part in heterogeneous lookup if the search term is implicitly convertible to - @ref boost::core::string_view. + @ref core::string_view. */ struct iequal { bool operator()( - boost::core::string_view lhs, - boost::core::string_view rhs) const + core::string_view lhs, + core::string_view rhs) const { return iequals(lhs, rhs); } diff --git a/include/boost/beast/core/string_param.hpp b/include/boost/beast/core/string_param.hpp index 8decb6713f..16f0edbc7a 100644 --- a/include/boost/beast/core/string_param.hpp +++ b/include/boost/beast/core/string_param.hpp @@ -43,7 +43,7 @@ namespace beast { */ class string_param { - boost::core::string_view sv_; + core::string_view sv_; char buf_[128]; boost::optional os_; @@ -55,12 +55,12 @@ class string_param template typename std::enable_if< ! std::is_integral::value && - ! std::is_convertible::value + ! std::is_convertible::value >::type print(T const&); void - print(boost::core::string_view); + print(core::string_view); template typename std::enable_if< @@ -98,7 +98,7 @@ class string_param the result of streaming each argument in order into an output stream. It is used as a notational convenience at call sites which expect a parameter with the semantics - of a @ref boost::core::string_view. + of a @ref core::string_view. The implementation uses a small, internal static buffer to avoid memory allocations especially for the case where @@ -111,14 +111,14 @@ class string_param string_param(Args const&... args); /// Returns the contained string - boost::core::string_view + core::string_view str() const { return sv_; } - /// Implicit conversion to @ref boost::core::string_view - operator boost::core::string_view const() const + /// Implicit conversion to @ref core::string_view + operator core::string_view const() const { return sv_; } diff --git a/include/boost/beast/core/string_type.hpp b/include/boost/beast/core/string_type.hpp index 1c08a501ad..5c09c7172d 100644 --- a/include/boost/beast/core/string_type.hpp +++ b/include/boost/beast/core/string_type.hpp @@ -17,10 +17,10 @@ namespace boost { namespace beast { template -inline boost::core::string_view +inline core::string_view to_string_view(const S& s) { - return boost::core::string_view(s.data(), s.size()); + return core::string_view(s.data(), s.size()); } } // beast diff --git a/include/boost/beast/http/basic_parser.hpp b/include/boost/beast/http/basic_parser.hpp index 44c87eb9e7..392d25bbcb 100644 --- a/include/boost/beast/http/basic_parser.hpp +++ b/include/boost/beast/http/basic_parser.hpp @@ -461,8 +461,8 @@ class basic_parser void on_request_impl( verb method, - boost::core::string_view method_str, - boost::core::string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec) = 0; @@ -488,7 +488,7 @@ class basic_parser void on_response_impl( int code, - boost::core::string_view reason, + core::string_view reason, int version, error_code& ec) = 0; @@ -512,8 +512,8 @@ class basic_parser void on_field_impl( field name, - boost::core::string_view name_string, - boost::core::string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) = 0; /** Called once for each complete field in the HTTP trailer header. @@ -536,8 +536,8 @@ class basic_parser void on_trailer_field_impl( field name, - boost::core::string_view name_string, - boost::core::string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) = 0; /** Called once after the complete HTTP header is received. @@ -587,7 +587,7 @@ class basic_parser virtual std::size_t on_body_impl( - boost::core::string_view body, + core::string_view body, error_code& ec) = 0; /** Called each time a new chunk header of a chunk encoded body is received. @@ -607,7 +607,7 @@ class basic_parser void on_chunk_header_impl( std::uint64_t size, - boost::core::string_view extensions, + core::string_view extensions, error_code& ec) = 0; /** Called each time additional data is received representing part of a body chunk. @@ -636,7 +636,7 @@ class basic_parser std::size_t on_chunk_body_impl( std::uint64_t remain, - boost::core::string_view body, + core::string_view body, error_code& ec) = 0; /** Called once when the complete message is received. @@ -714,7 +714,7 @@ class basic_parser void do_field(field f, - boost::core::string_view value, error_code& ec); + core::string_view value, error_code& ec); }; } // http diff --git a/include/boost/beast/http/chunk_encode.hpp b/include/boost/beast/http/chunk_encode.hpp index 7674560709..d46a392eae 100644 --- a/include/boost/beast/http/chunk_encode.hpp +++ b/include/boost/beast/http/chunk_encode.hpp @@ -154,7 +154,7 @@ class chunk_header */ chunk_header( std::size_t size, - boost::core::string_view extensions); + core::string_view extensions); /** Constructor @@ -169,7 +169,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref boost::core::string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -202,7 +202,7 @@ class chunk_header @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref boost::core::string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -342,7 +342,7 @@ class chunk_body */ chunk_body( ConstBufferSequence const& buffers, - boost::core::string_view extensions); + core::string_view extensions); /** Constructor @@ -360,7 +360,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref boost::core::string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -373,7 +373,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, boost::core::string_view>::value>::type + ChunkExtensions>::type, core::string_view>::value>::type #endif > chunk_body( @@ -396,7 +396,7 @@ class chunk_body @param extensions The chunk extensions object. The expression `extensions.str()` must be valid, and the return type must - be convertible to @ref boost::core::string_view. This object will be copied + be convertible to @ref core::string_view. This object will be copied or moved as needed to ensure that the chunk header object retains ownership of the buffers provided by the chunk extensions object. @@ -412,7 +412,7 @@ class chunk_body #if ! BOOST_BEAST_DOXYGEN , class = typename std::enable_if< ! std::is_convertible::type, boost::core::string_view>::value>::type + ChunkExtensions>::type, core::string_view>::value>::type #endif > chunk_body( @@ -582,7 +582,7 @@ class basic_chunk_extensions do_parse(FwdIt it, FwdIt last, error_code& ec); void - do_insert(boost::core::string_view name, boost::core::string_view value); + do_insert(core::string_view name, core::string_view value); public: /** The type of value when iterating. @@ -591,7 +591,7 @@ class basic_chunk_extensions element is the value which may be empty. The value is stored in its raw representation, without quotes or escapes. */ - using value_type = std::pair; + using value_type = std::pair; class const_iterator; @@ -630,14 +630,14 @@ class basic_chunk_extensions Any previous extensions will be cleared */ void - parse(boost::core::string_view s, error_code& ec); + parse(core::string_view s, error_code& ec); /** Insert an extension name with an empty value @param name The name of the extension */ void - insert(boost::core::string_view name); + insert(core::string_view name); /** Insert an extension value @@ -647,10 +647,10 @@ class basic_chunk_extensions contents, the serialized extension may use a quoted string. */ void - insert(boost::core::string_view name, boost::core::string_view value); + insert(core::string_view name, core::string_view value); /// Return the serialized representation of the chunk extension - boost::core::string_view + core::string_view str() const { return s_; diff --git a/include/boost/beast/http/detail/basic_parsed_list.hpp b/include/boost/beast/http/detail/basic_parsed_list.hpp index 3ffd65a4ac..764271e3d3 100644 --- a/include/boost/beast/http/detail/basic_parsed_list.hpp +++ b/include/boost/beast/http/detail/basic_parsed_list.hpp @@ -25,7 +25,7 @@ namespace detail { template class basic_parsed_list { - boost::core::string_view s_; + core::string_view s_; public: /// The type of policy this list uses for parsing. @@ -130,7 +130,7 @@ class basic_parsed_list /// Construct a list from a string explicit - basic_parsed_list(boost::core::string_view s) + basic_parsed_list(core::string_view s) : s_(s) { } diff --git a/include/boost/beast/http/detail/basic_parser.hpp b/include/boost/beast/http/detail/basic_parser.hpp index e5cbc57bd0..c998bb2a5b 100644 --- a/include/boost/beast/http/detail/basic_parser.hpp +++ b/include/boost/beast/http/detail/basic_parser.hpp @@ -74,7 +74,7 @@ struct basic_parser_base char const* it, char const* first); static - boost::core::string_view + core::string_view make_string(char const* first, char const* last) { return {first, static_cast< @@ -123,7 +123,7 @@ struct basic_parser_base BOOST_BEAST_DECL static bool - parse_dec(boost::core::string_view s, std::uint64_t& v); + parse_dec(core::string_view s, std::uint64_t& v); BOOST_BEAST_DECL static @@ -140,14 +140,14 @@ struct basic_parser_base void parse_method( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static void parse_target( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -168,7 +168,7 @@ struct basic_parser_base void parse_reason( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec); + core::string_view& result, error_code& ec); BOOST_BEAST_DECL static @@ -176,8 +176,8 @@ struct basic_parser_base parse_field( char const*& p, char const* last, - boost::core::string_view& name, - boost::core::string_view& value, + core::string_view& name, + core::string_view& value, beast::detail::char_buffer& buf, error_code& ec); diff --git a/include/boost/beast/http/detail/chunk_encode.hpp b/include/boost/beast/http/detail/chunk_encode.hpp index 75643c69f8..dba405d2ec 100644 --- a/include/boost/beast/http/detail/chunk_encode.hpp +++ b/include/boost/beast/http/detail/chunk_encode.hpp @@ -56,7 +56,7 @@ struct is_chunk_extensions : std::false_type {}; template struct is_chunk_extensions() = std::declval().str() + std::declval() = std::declval().str() )>> : std::true_type { }; diff --git a/include/boost/beast/http/detail/rfc7230.hpp b/include/boost/beast/http/detail/rfc7230.hpp index ab89d1641b..63cc9f8980 100644 --- a/include/boost/beast/http/detail/rfc7230.hpp +++ b/include/boost/beast/http/detail/rfc7230.hpp @@ -58,17 +58,17 @@ std::int8_t unhex(char c); BOOST_BEAST_DECL -boost::core::string_view -trim(boost::core::string_view s); +core::string_view +trim(core::string_view s); struct param_iter { - using iter_type = boost::core::string_view::const_iterator; + using iter_type = core::string_view::const_iterator; iter_type it; iter_type first; iter_type last; - std::pair v; + std::pair v; bool empty() const @@ -86,12 +86,12 @@ struct param_iter */ struct opt_token_list_policy { - using value_type = boost::core::string_view; + using value_type = core::string_view; BOOST_BEAST_DECL bool operator()(value_type& v, - char const*& it, boost::core::string_view s) const; + char const*& it, core::string_view s) const; }; } // detail diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index 3d96dfac1f..ee2a483164 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -45,20 +45,20 @@ struct fields_model { struct writer; - boost::core::string_view method() const; - boost::core::string_view reason() const; - boost::core::string_view target() const; + core::string_view method() const; + core::string_view reason() const; + core::string_view target() const; protected: - boost::core::string_view get_method_impl() const; - boost::core::string_view get_target_impl() const; - boost::core::string_view get_reason_impl() const; + core::string_view get_method_impl() const; + core::string_view get_target_impl() const; + core::string_view get_reason_impl() const; bool get_chunked_impl() const; bool get_keep_alive_impl(unsigned) const; bool has_content_length_impl() const; - void set_method_impl(boost::core::string_view); - void set_target_impl(boost::core::string_view); - void set_reason_impl(boost::core::string_view); + void set_method_impl(core::string_view); + void set_target_impl(core::string_view); + void set_reason_impl(core::string_view); void set_chunked_impl(bool); void set_content_length_impl(boost::optional); void set_keep_alive_impl(unsigned, bool); @@ -93,21 +93,21 @@ struct is_fields_helper : T { template static auto f1(int) -> decltype( - std::declval() = std::declval().get_method_impl(), + std::declval() = std::declval().get_method_impl(), std::true_type()); static auto f1(...) -> std::false_type; using t1 = decltype(f1(0)); template static auto f2(int) -> decltype( - std::declval() = std::declval().get_target_impl(), + std::declval() = std::declval().get_target_impl(), std::true_type()); static auto f2(...) -> std::false_type; using t2 = decltype(f2(0)); template static auto f3(int) -> decltype( - std::declval() = std::declval().get_reason_impl(), + std::declval() = std::declval().get_reason_impl(), std::true_type()); static auto f3(...) -> std::false_type; using t3 = decltype(f3(0)); @@ -136,21 +136,21 @@ struct is_fields_helper : T template static auto f7(int) -> decltype( - void(std::declval().set_method_impl(std::declval())), + void(std::declval().set_method_impl(std::declval())), std::true_type()); static auto f7(...) -> std::false_type; using t7 = decltype(f7(0)); template static auto f8(int) -> decltype( - void(std::declval().set_target_impl(std::declval())), + void(std::declval().set_target_impl(std::declval())), std::true_type()); static auto f8(...) -> std::false_type; using t8 = decltype(f8(0)); template static auto f9(int) -> decltype( - void(std::declval().set_reason_impl(std::declval())), + void(std::declval().set_reason_impl(std::declval())), std::true_type()); static auto f9(...) -> std::false_type; using t9 = decltype(f9(0)); diff --git a/include/boost/beast/http/field.hpp b/include/boost/beast/http/field.hpp index 15bc4cd5dd..6fad94ab4f 100644 --- a/include/boost/beast/http/field.hpp +++ b/include/boost/beast/http/field.hpp @@ -157,7 +157,7 @@ namespace http { @param f The field to convert */ BOOST_BEAST_DECL -boost::core::string_view +core::string_view to_string(field f); /** Attempt to convert a string to a field enum. @@ -169,7 +169,7 @@ to_string(field f); */ BOOST_BEAST_DECL field -string_to_field(boost::core::string_view s); +string_to_field(core::string_view s); /// Write the text for a field name to an output stream. BOOST_BEAST_DECL diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 67aa93406a..0412cb8c72 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -91,7 +91,7 @@ class basic_fields protected: value_type(field name, - boost::core::string_view sname, boost::core::string_view value); + core::string_view sname, core::string_view value); public: /// Constructor (deleted) @@ -105,11 +105,11 @@ class basic_fields name() const; /// Returns the field name as a string - boost::core::string_view const + core::string_view const name_string() const; /// Returns the value of the field - boost::core::string_view const + core::string_view const value() const; }; @@ -126,7 +126,7 @@ class basic_fields /// Returns `true` if lhs is less than rhs using a strict ordering bool operator()( - boost::core::string_view lhs, + core::string_view lhs, value_type const& rhs) const noexcept { if(lhs.size() < rhs.name_string().size()) @@ -140,7 +140,7 @@ class basic_fields bool operator()( value_type const& lhs, - boost::core::string_view rhs) const noexcept + core::string_view rhs) const noexcept { if(lhs.name_string().size() < rhs.size()) return true; @@ -181,7 +181,7 @@ class basic_fields , public value_type { element(field name, - boost::core::string_view sname, boost::core::string_view value); + core::string_view sname, core::string_view value); }; using list_t = typename boost::intrusive::make_list< @@ -327,7 +327,7 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - boost::core::string_view const + core::string_view const at(field name) const; /** Returns the value for a field, or throws an exception. @@ -341,8 +341,8 @@ class basic_fields @throws std::out_of_range if the field is not found. */ - boost::core::string_view const - at(boost::core::string_view name) const; + core::string_view const + at(core::string_view name) const; /** Returns the value for a field, or `""` if it does not exist. @@ -351,7 +351,7 @@ class basic_fields @param name The name of the field. */ - boost::core::string_view const + core::string_view const operator[](field name) const; /** Returns the value for a case-insensitive matching header, or `""` if it does not exist. @@ -361,8 +361,8 @@ class basic_fields @param name The name of the field. It is interpreted as a case-insensitive string. */ - boost::core::string_view const - operator[](boost::core::string_view name) const; + core::string_view const + operator[](core::string_view name) const; //-------------------------------------------------------------------------- // @@ -450,7 +450,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, boost::core::string_view value); + insert(field name, core::string_view value); void insert(field, std::nullptr_t) = delete; @@ -473,10 +473,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(boost::core::string_view name, boost::core::string_view value); + insert(core::string_view name, core::string_view value); void - insert(boost::core::string_view, std::nullptr_t) = delete; + insert(core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -501,11 +501,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, boost::core::string_view name_string, - boost::core::string_view value); + insert(field name, core::string_view name_string, + core::string_view value); void - insert(field, boost::core::string_view, std::nullptr_t) = delete; + insert(field, core::string_view, std::nullptr_t) = delete; /** Insert a field. @@ -530,11 +530,11 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - insert(field name, boost::core::string_view name_string, - boost::core::string_view value, error_code& ec); + insert(field name, core::string_view name_string, + core::string_view value, error_code& ec); void - insert(field, boost::core::string_view, std::nullptr_t, error_code& ec) = delete; + insert(field, core::string_view, std::nullptr_t, error_code& ec) = delete; /** Set a field value, removing any other instances of that field. @@ -550,7 +550,7 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(field name, boost::core::string_view value); + set(field name, core::string_view value); void set(field, std::nullptr_t) = delete; @@ -571,10 +571,10 @@ class basic_fields error code will be @ref error::header_field_value_too_large. */ void - set(boost::core::string_view name, boost::core::string_view value); + set(core::string_view name, core::string_view value); void - set(boost::core::string_view, std::nullptr_t) = delete; + set(core::string_view, std::nullptr_t) = delete; /** Remove a field. @@ -619,7 +619,7 @@ class basic_fields @return The number of fields removed. */ std::size_t - erase(boost::core::string_view name); + erase(core::string_view name); /** Return a buffer sequence representing the trailers. @@ -659,7 +659,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ bool - contains(boost::core::string_view name) const; + contains(core::string_view name) const; /** Return the number of fields with the specified name. @@ -673,7 +673,7 @@ class basic_fields @param name The field name. It is interpreted as a case-insensitive string. */ std::size_t - count(boost::core::string_view name) const; + count(core::string_view name) const; /** Returns an iterator to the case-insensitive matching field. @@ -699,7 +699,7 @@ class basic_fields no match was found. */ const_iterator - find(boost::core::string_view name) const; + find(core::string_view name) const; /** Returns a range of iterators to the fields with the specified name. @@ -721,7 +721,7 @@ class basic_fields /// @copydoc boost::beast::http::basic_fields::equal_range(boost::beast::http::field) const std::pair - equal_range(boost::core::string_view name) const; + equal_range(core::string_view name) const; //-------------------------------------------------------------------------- // @@ -741,21 +741,21 @@ class basic_fields @note Only called for requests. */ - boost::core::string_view + core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - boost::core::string_view + core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - boost::core::string_view + core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -778,21 +778,21 @@ class basic_fields @note Only called for requests. */ void - set_method_impl(boost::core::string_view s); + set_method_impl(core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(boost::core::string_view s); + set_target_impl(core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(boost::core::string_view s); + set_reason_impl(core::string_view s); /** Adjusts the chunked Transfer-Encoding value */ @@ -818,15 +818,15 @@ class basic_fields element* try_create_new_element( field name, - boost::core::string_view sname, - boost::core::string_view value, + core::string_view sname, + core::string_view value, error_code& ec); element& new_element( field name, - boost::core::string_view sname, - boost::core::string_view value); + core::string_view sname, + core::string_view value); void insert_element(element& e); @@ -838,11 +838,11 @@ class basic_fields set_element(element& e); void - realloc_string(boost::core::string_view& dest, boost::core::string_view s); + realloc_string(core::string_view& dest, core::string_view s); void realloc_target( - boost::core::string_view& dest, boost::core::string_view s); + core::string_view& dest, core::string_view s); template void @@ -874,8 +874,8 @@ class basic_fields set_t set_; list_t list_; - boost::core::string_view method_; - boost::core::string_view target_or_reason_; + core::string_view method_; + core::string_view target_or_reason_; }; #if BOOST_BEAST_DOXYGEN diff --git a/include/boost/beast/http/impl/chunk_encode.hpp b/include/boost/beast/http/impl/chunk_encode.hpp index 5bc8eb1e71..704a2d4754 100644 --- a/include/boost/beast/http/impl/chunk_encode.hpp +++ b/include/boost/beast/http/impl/chunk_encode.hpp @@ -35,7 +35,7 @@ inline chunk_header:: chunk_header( std::size_t size, - boost::core::string_view extensions) + core::string_view extensions) : view_( size, net::const_buffer{ @@ -102,7 +102,7 @@ template chunk_body:: chunk_body( ConstBufferSequence const& buffers, - boost::core::string_view extensions) + core::string_view extensions) : view_( buffer_bytes(buffers), net::const_buffer{ @@ -311,10 +311,10 @@ operator*() -> using beast::detail::varint_read; auto it = it_; auto n = varint_read(it); - value_.first = boost::core::string_view{it, n}; + value_.first = core::string_view{it, n}; it += n; n = varint_read(it); - value_.second = boost::core::string_view{it, n}; + value_.second = core::string_view{it, n}; return value_; } @@ -560,7 +560,7 @@ do_parse(FwdIt it, FwdIt last, error_code& ec) template void basic_chunk_extensions:: -do_insert(boost::core::string_view name, boost::core::string_view value) +do_insert(core::string_view name, core::string_view value) { /* chunk-ext = *( ";" chunk-ext-name [ "=" chunk-ext-val ] ) @@ -623,7 +623,7 @@ do_insert(boost::core::string_view name, boost::core::string_view value) template void basic_chunk_extensions:: -parse(boost::core::string_view s, error_code& ec) +parse(core::string_view s, error_code& ec) { do_parse(s.data(), s.data() + s.size(), ec); if(! ec) @@ -637,7 +637,7 @@ parse(boost::core::string_view s, error_code& ec) template void basic_chunk_extensions:: -insert(boost::core::string_view name) +insert(core::string_view name) { do_insert(name, {}); @@ -659,7 +659,7 @@ insert(boost::core::string_view name) template void basic_chunk_extensions:: -insert(boost::core::string_view name, boost::core::string_view value) +insert(core::string_view name, core::string_view value) { do_insert(name, value); diff --git a/include/boost/beast/http/impl/fields.hpp b/include/boost/beast/http/impl/fields.hpp index d7f4287ac1..c387ab966c 100644 --- a/include/boost/beast/http/impl/fields.hpp +++ b/include/boost/beast/http/impl/fields.hpp @@ -192,7 +192,7 @@ writer(basic_fields const& f, " " " HTTP/X.Y\r\n" (11 chars) */ - boost::core::string_view sv; + core::string_view sv; if(v == verb::unknown) sv = f_.get_method_impl(); else @@ -248,7 +248,7 @@ writer(basic_fields const& f, buf_[11]= '0' + static_cast(code % 10); buf_[12]= ' '; - boost::core::string_view sv; + core::string_view sv; if(! f_.target_or_reason_.empty()) sv = f_.target_or_reason_; else @@ -289,7 +289,7 @@ template basic_fields:: value_type:: value_type(field name, - boost::core::string_view sname, boost::core::string_view value) + core::string_view sname, core::string_view value) : off_(static_cast(sname.size() + 2)) , len_(static_cast(value.size())) , f_(name) @@ -315,7 +315,7 @@ name() const } template -boost::core::string_view const +core::string_view const basic_fields:: value_type:: name_string() const @@ -325,7 +325,7 @@ name_string() const } template -boost::core::string_view const +core::string_view const basic_fields:: value_type:: value() const @@ -338,7 +338,7 @@ template basic_fields:: element:: element(field name, - boost::core::string_view sname, boost::core::string_view value) + core::string_view sname, core::string_view value) : value_type(name, sname, value) { } @@ -470,7 +470,7 @@ operator=(basic_fields const& other) -> //------------------------------------------------------------------------------ template -boost::core::string_view const +core::string_view const basic_fields:: at(field name) const { @@ -483,9 +483,9 @@ at(field name) const } template -boost::core::string_view const +core::string_view const basic_fields:: -at(boost::core::string_view name) const +at(core::string_view name) const { auto const it = find(name); if(it == end()) @@ -495,7 +495,7 @@ at(boost::core::string_view name) const } template -boost::core::string_view const +core::string_view const basic_fields:: operator[](field name) const { @@ -507,9 +507,9 @@ operator[](field name) const } template -boost::core::string_view const +core::string_view const basic_fields:: -operator[](boost::core::string_view name) const +operator[](core::string_view name) const { auto const it = find(name); if(it == end()) @@ -537,7 +537,7 @@ template inline void basic_fields:: -insert(field name, boost::core::string_view value) +insert(field name, core::string_view value) { BOOST_ASSERT(name != field::unknown); insert(name, to_string(name), value); @@ -546,7 +546,7 @@ insert(field name, boost::core::string_view value) template void basic_fields:: -insert(boost::core::string_view sname, boost::core::string_view value) +insert(core::string_view sname, core::string_view value) { insert( string_to_field(sname), sname, value); @@ -557,8 +557,8 @@ void basic_fields:: insert( field name, - boost::core::string_view sname, - boost::core::string_view value, + core::string_view sname, + core::string_view value, error_code& ec) { ec = {}; @@ -572,7 +572,7 @@ template void basic_fields:: insert(field name, - boost::core::string_view sname, boost::core::string_view value) + core::string_view sname, core::string_view value) { insert_element( new_element(name, sname, value)); @@ -581,7 +581,7 @@ insert(field name, template void basic_fields:: -set(field name, boost::core::string_view value) +set(field name, core::string_view value) { BOOST_ASSERT(name != field::unknown); set_element( @@ -591,7 +591,7 @@ set(field name, boost::core::string_view value) template void basic_fields:: -set(boost::core::string_view sname, boost::core::string_view value) +set(core::string_view sname, core::string_view value) { set_element(new_element( string_to_field(sname), sname, value)); @@ -623,7 +623,7 @@ erase(field name) template std::size_t basic_fields:: -erase(boost::core::string_view name) +erase(core::string_view name) { std::size_t n =0; set_.erase_and_dispose(name, key_compare{}, @@ -672,7 +672,7 @@ contains(field name) const template bool basic_fields:: -contains(boost::core::string_view name) const +contains(core::string_view name) const { return find(name) != end(); } @@ -690,7 +690,7 @@ count(field name) const template std::size_t basic_fields:: -count(boost::core::string_view name) const +count(core::string_view name) const { return set_.count(name, key_compare{}); } @@ -709,7 +709,7 @@ find(field name) const -> template auto basic_fields:: -find(boost::core::string_view name) const -> +find(core::string_view name) const -> const_iterator { auto const it = set_.find( @@ -733,7 +733,7 @@ equal_range(field name) const -> template auto basic_fields:: -equal_range(boost::core::string_view name) const -> +equal_range(core::string_view name) const -> std::pair { auto result = @@ -752,13 +752,13 @@ namespace detail { struct iequals_predicate { bool - operator()(boost::core::string_view s) const + operator()(core::string_view s) const { return beast::iequals(s, sv1) || beast::iequals(s, sv2); } - boost::core::string_view sv1; - boost::core::string_view sv2; + core::string_view sv1; + core::string_view sv2; }; // Filter the last item in a token list @@ -766,13 +766,13 @@ BOOST_BEAST_DECL void filter_token_list_last( beast::detail::temporary_buffer& s, - boost::core::string_view value, + core::string_view value, iequals_predicate const& pred); BOOST_BEAST_DECL void keep_alive_impl( - beast::detail::temporary_buffer& s, boost::core::string_view value, + beast::detail::temporary_buffer& s, core::string_view value, unsigned version, bool keep_alive); } // detail @@ -783,7 +783,7 @@ keep_alive_impl( template inline -boost::core::string_view +core::string_view basic_fields:: get_method_impl() const { @@ -792,7 +792,7 @@ get_method_impl() const template inline -boost::core::string_view +core::string_view basic_fields:: get_target_impl() const { @@ -805,7 +805,7 @@ get_target_impl() const template inline -boost::core::string_view +core::string_view basic_fields:: get_reason_impl() const { @@ -860,7 +860,7 @@ template inline void basic_fields:: -set_method_impl(boost::core::string_view s) +set_method_impl(core::string_view s) { realloc_string(method_, s); } @@ -869,7 +869,7 @@ template inline void basic_fields:: -set_target_impl(boost::core::string_view s) +set_target_impl(core::string_view s) { realloc_target( target_or_reason_, s); @@ -879,7 +879,7 @@ template inline void basic_fields:: -set_reason_impl(boost::core::string_view s) +set_reason_impl(core::string_view s) { realloc_string( target_or_reason_, s); @@ -967,8 +967,8 @@ auto basic_fields:: try_create_new_element( field name, - boost::core::string_view sname, - boost::core::string_view value, + core::string_view sname, + core::string_view value, error_code& ec) -> element* { if(sname.size() > max_name_size) @@ -998,8 +998,8 @@ auto basic_fields:: new_element( field name, - boost::core::string_view sname, - boost::core::string_view value) -> element& + core::string_view sname, + core::string_view value) -> element& { error_code ec; auto* e = try_create_new_element(name, sname, value, ec); @@ -1083,7 +1083,7 @@ set_element(element& e) template void basic_fields:: -realloc_string(boost::core::string_view& dest, boost::core::string_view s) +realloc_string(core::string_view& dest, core::string_view s) { if(dest.empty() && s.empty()) return; @@ -1109,7 +1109,7 @@ template void basic_fields:: realloc_target( - boost::core::string_view& dest, boost::core::string_view s) + core::string_view& dest, core::string_view s) { // The target string are stored with an // extra space at the beginning to help diff --git a/include/boost/beast/http/impl/message.hpp b/include/boost/beast/http/impl/message.hpp index eb5ad45133..27cc3b6e6f 100644 --- a/include/boost/beast/http/impl/message.hpp +++ b/include/boost/beast/http/impl/message.hpp @@ -49,7 +49,7 @@ method(verb v) } template -boost::core::string_view +core::string_view header:: method_string() const { @@ -61,7 +61,7 @@ method_string() const template void header:: -method_string(boost::core::string_view s) +method_string(core::string_view s) { method_ = string_to_verb(s); if(method_ != verb::unknown) @@ -71,7 +71,7 @@ method_string(boost::core::string_view s) } template -boost::core::string_view +core::string_view header:: target() const { @@ -81,7 +81,7 @@ target() const template void header:: -target(boost::core::string_view s) +target(core::string_view s) { this->set_target_impl(s); } @@ -149,7 +149,7 @@ result_int() const } template -boost::core::string_view +core::string_view header:: reason() const { @@ -162,7 +162,7 @@ reason() const template void header:: -reason(boost::core::string_view s) +reason(core::string_view s) { this->set_reason_impl(s); } @@ -208,7 +208,7 @@ message(header_type const& h, BodyArgs&&... body_args) template template message:: -message(verb method, boost::core::string_view target, Version version) +message(verb method, core::string_view target, Version version) : header_type(method, target, version) { } @@ -216,7 +216,7 @@ message(verb method, boost::core::string_view target, Version version) template template message:: -message(verb method, boost::core::string_view target, +message(verb method, core::string_view target, Version version, BodyArg&& body_arg) : header_type(method, target, version) , boost::empty_value< @@ -229,7 +229,7 @@ template template message:: message( - verb method, boost::core::string_view target, Version version, + verb method, core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg) : header_type(method, target, version, diff --git a/include/boost/beast/http/impl/rfc7230.hpp b/include/boost/beast/http/impl/rfc7230.hpp index 7ca8560f46..6357790b8c 100644 --- a/include/boost/beast/http/impl/rfc7230.hpp +++ b/include/boost/beast/http/impl/rfc7230.hpp @@ -19,7 +19,7 @@ namespace http { class param_list::const_iterator { - using iter_type = boost::core::string_view::const_iterator; + using iter_type = core::string_view::const_iterator; std::string s_; detail::param_iter pi_; @@ -89,7 +89,7 @@ class param_list::const_iterator BOOST_BEAST_DECL static void - unquote(boost::core::string_view sr, std::string & s); + unquote(core::string_view sr, std::string & s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index 82ff6bf069..ead1291e1e 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -149,7 +149,7 @@ class header : public Fields @see method */ - boost::core::string_view + core::string_view method_string() const; /** Set the request-method. @@ -163,7 +163,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - method_string(boost::core::string_view s); + method_string(core::string_view s); /** Returns the request-target string. @@ -174,7 +174,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ - boost::core::string_view + core::string_view target() const; /** Set the request-target string. @@ -190,7 +190,7 @@ class header : public Fields @note This function is only available when `isRequest == true`. */ void - target(boost::core::string_view s); + target(core::string_view s); // VFALCO Don't rearrange these declarations or // ifdefs, or else the documentation will break. @@ -235,7 +235,7 @@ class header : public Fields template header( verb method, - boost::core::string_view target_, + core::string_view target_, unsigned version_value, FieldsArgs&&... fields_args) : Fields(std::forward(fields_args)...) @@ -390,7 +390,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ - boost::core::string_view + core::string_view reason() const; /** Set the response reason-phrase (deprecated) @@ -412,7 +412,7 @@ class header : public Fields @note This function is only available when `isRequest == false`. */ void - reason(boost::core::string_view s); + reason(core::string_view s); private: #if ! BOOST_BEAST_DOXYGEN @@ -557,12 +557,12 @@ class message @note This function is only available when `isRequest == true`. */ #if BOOST_BEAST_DOXYGEN - message(verb method, boost::core::string_view target, unsigned version); + message(verb method, core::string_view target, unsigned version); #else template::value>::type> - message(verb method, boost::core::string_view target, Version version); + message(verb method, core::string_view target, Version version); #endif /** Constructor @@ -579,13 +579,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, boost::core::string_view target, + message(verb method, core::string_view target, unsigned version, BodyArg&& body_arg); #else template::value>::type> - message(verb method, boost::core::string_view target, + message(verb method, core::string_view target, Version version, BodyArg&& body_arg); #endif @@ -605,13 +605,13 @@ class message */ #if BOOST_BEAST_DOXYGEN template - message(verb method, boost::core::string_view target, unsigned version, + message(verb method, core::string_view target, unsigned version, BodyArg&& body_arg, FieldsArg&& fields_arg); #else template::value>::type> - message(verb method, boost::core::string_view target, Version version, + message(verb method, core::string_view target, Version version, BodyArg&& body_arg, FieldsArg&& fields_arg); #endif diff --git a/include/boost/beast/http/message_generator.hpp b/include/boost/beast/http/message_generator.hpp index a550c866f8..f77c1a1c8a 100644 --- a/include/boost/beast/http/message_generator.hpp +++ b/include/boost/beast/http/message_generator.hpp @@ -34,7 +34,7 @@ namespace http { @code template http::message_generator handle_request( - boost::core::string_view doc_root, + core::string_view doc_root, http::request&& request); @endcode diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index fe7c848688..e754146ce3 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -76,12 +76,12 @@ class parser std::function cb_h_; std::function cb_b_; public: @@ -225,7 +225,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t size, boost::core::string_view extensions, error_code& ec) + [](std::uint64_t size, core::string_view extensions, error_code& ec) { //... }; @@ -237,9 +237,9 @@ class parser @code void on_chunk_header( - std::uint64_t size, // Size of the chunk, zero for the last chunk - boost::core::string_view extensions, // The chunk-extensions in raw form - error_code& ec); // May be set by the callback to indicate an error + std::uint64_t size, // Size of the chunk, zero for the last chunk + core::string_view extensions, // The chunk-extensions in raw form + error_code& ec); // May be set by the callback to indicate an error @endcode */ template @@ -273,7 +273,7 @@ class parser @par Example @code auto callback = - [](std::uint64_t remain, boost::core::string_view body, error_code& ec) + [](std::uint64_t remain, core::string_view body, error_code& ec) { //... }; @@ -286,8 +286,8 @@ class parser std::size_t on_chunk_header( std::uint64_t remain, // Octets remaining in this chunk, includes `body` - boost::core::string_view body, // A buffer holding some or all of the remainder of the chunk body - error_code& ec); // May be set by the callback to indicate an error + core::string_view body, // A buffer holding some or all of the remainder of the chunk body + error_code& ec); // May be set by the callback to indicate an error @endcode */ template @@ -387,8 +387,8 @@ class parser void on_request_impl( verb method, - boost::core::string_view method_str, - boost::core::string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec, std::true_type) @@ -417,7 +417,7 @@ class parser void on_request_impl( - verb, boost::core::string_view, boost::core::string_view, + verb, core::string_view, core::string_view, int, error_code&, std::false_type) { } @@ -425,8 +425,8 @@ class parser void on_request_impl( verb method, - boost::core::string_view method_str, - boost::core::string_view target, + core::string_view method_str, + core::string_view target, int version, error_code& ec) override { @@ -438,7 +438,7 @@ class parser void on_response_impl( int code, - boost::core::string_view reason, + core::string_view reason, int version, error_code& ec, std::true_type) @@ -464,7 +464,7 @@ class parser void on_response_impl( - int, boost::core::string_view, int, + int, core::string_view, int, error_code&, std::false_type) { } @@ -472,7 +472,7 @@ class parser void on_response_impl( int code, - boost::core::string_view reason, + core::string_view reason, int version, error_code& ec) override { @@ -484,8 +484,8 @@ class parser void on_field_impl( field name, - boost::core::string_view name_string, - boost::core::string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) override { m_.insert(name, name_string, value, ec); @@ -494,8 +494,8 @@ class parser void on_trailer_field_impl( field name, - boost::core::string_view name_string, - boost::core::string_view value, + core::string_view name_string, + core::string_view value, error_code& ec) override { if(! token_list{m_[field::trailer]}.exists(name_string)) @@ -538,7 +538,7 @@ class parser std::size_t on_body_impl( - boost::core::string_view body, + core::string_view body, error_code& ec) override { return rd_.put(net::buffer( @@ -548,7 +548,7 @@ class parser void on_chunk_header_impl( std::uint64_t size, - boost::core::string_view extensions, + core::string_view extensions, error_code& ec) override { if(cb_h_) @@ -558,7 +558,7 @@ class parser std::size_t on_chunk_body_impl( std::uint64_t remain, - boost::core::string_view body, + core::string_view body, error_code& ec) override { if(cb_b_) diff --git a/include/boost/beast/http/rfc7230.hpp b/include/boost/beast/http/rfc7230.hpp index ddad8f4345..62b8db38ce 100644 --- a/include/boost/beast/http/rfc7230.hpp +++ b/include/boost/beast/http/rfc7230.hpp @@ -52,7 +52,7 @@ namespace http { */ class param_list { - boost::core::string_view s_; + core::string_view s_; public: /** The type of each element in the list. @@ -62,7 +62,7 @@ class param_list be empty). */ using value_type = - std::pair; + std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -80,7 +80,7 @@ class param_list must remain valid for the lifetime of the container. */ explicit - param_list(boost::core::string_view s) + param_list(core::string_view s) : s_(s) { } @@ -140,9 +140,9 @@ class param_list */ class ext_list { - using iter_type = boost::core::string_view::const_iterator; + using iter_type = core::string_view::const_iterator; - boost::core::string_view s_; + core::string_view s_; public: /** The type of each element in the list. @@ -151,7 +151,7 @@ class ext_list second element of the pair is an iterable container holding the extension's name/value parameters. */ - using value_type = std::pair; + using value_type = std::pair; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -166,7 +166,7 @@ class ext_list must remain valid for the lifetime of the container. */ explicit - ext_list(boost::core::string_view s) + ext_list(core::string_view s) : s_(s) { } @@ -192,7 +192,7 @@ class ext_list */ BOOST_BEAST_DECL const_iterator - find(boost::core::string_view const& s); + find(core::string_view const& s); /** Return `true` if a token is present in the list. @@ -200,7 +200,7 @@ class ext_list */ BOOST_BEAST_DECL bool - exists(boost::core::string_view const& s); + exists(core::string_view const& s); }; //------------------------------------------------------------------------------ @@ -233,13 +233,13 @@ class ext_list */ class token_list { - using iter_type = boost::core::string_view::const_iterator; + using iter_type = core::string_view::const_iterator; - boost::core::string_view s_; + core::string_view s_; public: /// The type of each element in the token list. - using value_type = boost::core::string_view; + using value_type = core::string_view; /// A constant iterator to the list #if BOOST_BEAST_DOXYGEN @@ -254,7 +254,7 @@ class token_list must remain valid for the lifetime of the container. */ explicit - token_list(boost::core::string_view s) + token_list(core::string_view s) : s_(s) { } @@ -277,7 +277,7 @@ class token_list */ BOOST_BEAST_DECL bool - exists(boost::core::string_view const& s); + exists(core::string_view const& s); }; /** A list of tokens in a comma separated HTTP field value. diff --git a/include/boost/beast/http/status.hpp b/include/boost/beast/http/status.hpp index ea01f51769..084d442a72 100644 --- a/include/boost/beast/http/status.hpp +++ b/include/boost/beast/http/status.hpp @@ -163,7 +163,7 @@ to_status_class(status v); @param v The status code to use. */ BOOST_BEAST_DECL -boost::core::string_view +core::string_view obsolete_reason(status v); /// Outputs the standard reason phrase of a status code to a stream. diff --git a/include/boost/beast/http/verb.hpp b/include/boost/beast/http/verb.hpp index 565f4556f7..bd4217b9bf 100644 --- a/include/boost/beast/http/verb.hpp +++ b/include/boost/beast/http/verb.hpp @@ -135,11 +135,11 @@ enum class verb */ BOOST_BEAST_DECL verb -string_to_verb(boost::core::string_view s); +string_to_verb(core::string_view s); /// Returns the text representation of a request method verb. BOOST_BEAST_DECL -boost::core::string_view +core::string_view to_string(verb v); /// Write the text for a request method verb to an output stream. diff --git a/include/boost/beast/websocket/detail/hybi13.hpp b/include/boost/beast/websocket/detail/hybi13.hpp index a84431f880..7783762e39 100644 --- a/include/boost/beast/websocket/detail/hybi13.hpp +++ b/include/boost/beast/websocket/detail/hybi13.hpp @@ -34,7 +34,7 @@ BOOST_BEAST_DECL void make_sec_ws_accept( sec_ws_accept_type& accept, - boost::core::string_view key); + core::string_view key); } // detail } // websocket diff --git a/include/boost/beast/websocket/detail/pmd_extension.hpp b/include/boost/beast/websocket/detail/pmd_extension.hpp index 18c047b0e2..6e3acedc54 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.hpp +++ b/include/boost/beast/websocket/detail/pmd_extension.hpp @@ -45,7 +45,7 @@ struct pmd_offer BOOST_BEAST_DECL int -parse_bits(boost::core::string_view s); +parse_bits(core::string_view s); BOOST_BEAST_DECL void diff --git a/include/boost/beast/websocket/impl/accept.hpp b/include/boost/beast/websocket/impl/accept.hpp index a87ee0ae0f..3385b3ebf1 100644 --- a/include/boost/beast/websocket/impl/accept.hpp +++ b/include/boost/beast/websocket/impl/accept.hpp @@ -79,7 +79,7 @@ build_response( decorator(res); if(! res.contains(http::field::server)) res.set(http::field::server, - boost::core::string_view(BOOST_BEAST_VERSION_STRING)); + core::string_view(BOOST_BEAST_VERSION_STRING)); }; auto err = [&](error e) @@ -113,7 +113,7 @@ build_response( if(! http::token_list{it->value()}.exists("websocket")) return err(error::no_upgrade_websocket); } - boost::core::string_view key; + core::string_view key; { auto const it = req.find(http::field::sec_websocket_key); if(it == req.end()) diff --git a/include/boost/beast/websocket/impl/handshake.hpp b/include/boost/beast/websocket/impl/handshake.hpp index fcbc778bb7..d21da0d305 100644 --- a/include/boost/beast/websocket/impl/handshake.hpp +++ b/include/boost/beast/websocket/impl/handshake.hpp @@ -231,8 +231,8 @@ void stream:: do_handshake( response_type* res_p, - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, RequestDecorator const& decorator, error_code& ec) { @@ -310,8 +310,8 @@ template BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -335,8 +335,8 @@ BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) stream:: async_handshake( response_type& res, - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler) { static_assert(is_async_stream::value, @@ -357,8 +357,8 @@ async_handshake( template void stream:: -handshake(boost::core::string_view host, - boost::core::string_view target) +handshake(core::string_view host, + core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -373,8 +373,8 @@ template void stream:: handshake(response_type& res, - boost::core::string_view host, - boost::core::string_view target) + core::string_view host, + core::string_view target) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -387,8 +387,8 @@ handshake(response_type& res, template void stream:: -handshake(boost::core::string_view host, - boost::core::string_view target, error_code& ec) +handshake(core::string_view host, + core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, "SyncStream type requirements not met"); @@ -400,8 +400,8 @@ template void stream:: handshake(response_type& res, - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, error_code& ec) { static_assert(is_sync_stream::value, diff --git a/include/boost/beast/websocket/impl/stream.hpp b/include/boost/beast/websocket/impl/stream.hpp index 07f7e53bf6..0ee5e51102 100644 --- a/include/boost/beast/websocket/impl/stream.hpp +++ b/include/boost/beast/websocket/impl/stream.hpp @@ -251,7 +251,7 @@ template void stream:: control_callback(std::function< - void(frame_type, boost::core::string_view)> cb) + void(frame_type, core::string_view)> cb) { impl_->ctrl_cb = std::move(cb); } diff --git a/include/boost/beast/websocket/impl/stream_impl.hpp b/include/boost/beast/websocket/impl/stream_impl.hpp index 38d424f24e..edf960f91c 100644 --- a/include/boost/beast/websocket/impl/stream_impl.hpp +++ b/include/boost/beast/websocket/impl/stream_impl.hpp @@ -257,7 +257,7 @@ struct stream::impl_type request_type build_request( detail::sec_ws_key_type& key, - boost::core::string_view host, boost::core::string_view target, + core::string_view host, core::string_view target, Decorator const& decorator); void @@ -623,7 +623,7 @@ request_type stream::impl_type:: build_request( detail::sec_ws_key_type& key, - boost::core::string_view host, boost::core::string_view target, + core::string_view host, core::string_view target, Decorator const& decorator) { request_type req; diff --git a/include/boost/beast/websocket/rfc6455.hpp b/include/boost/beast/websocket/rfc6455.hpp index 77a4a91b20..19582657cc 100644 --- a/include/boost/beast/websocket/rfc6455.hpp +++ b/include/boost/beast/websocket/rfc6455.hpp @@ -187,7 +187,7 @@ struct close_reason } /// Construct from a reason string. code is @ref close_code::normal. - close_reason(boost::core::string_view s) + close_reason(core::string_view s) : code(close_code::normal) , reason(s.data(), s.size()) { @@ -201,7 +201,7 @@ struct close_reason } /// Construct from a close code and reason string. - close_reason(close_code code_, boost::core::string_view s) + close_reason(close_code code_, core::string_view s) : code(code_) , reason(s.data(), s.size()) { diff --git a/include/boost/beast/websocket/stream.hpp b/include/boost/beast/websocket/stream.hpp index 3df5dfa697..f9e3db5275 100644 --- a/include/boost/beast/websocket/stream.hpp +++ b/include/boost/beast/websocket/stream.hpp @@ -156,7 +156,7 @@ class stream std::chrono::steady_clock::time_point; using control_cb_type = - std::function; + std::function; #ifndef BOOST_BEAST_DOXYGEN friend class close_test; @@ -525,7 +525,7 @@ class stream void callback( frame_type kind, // The type of frame - boost::core::string_view payload // The payload in the frame + core::string_view payload // The payload in the frame ); @endcode The implementation type-erases the callback which may require @@ -545,7 +545,7 @@ class stream in undefined behavior. */ void - control_callback(std::function cb); + control_callback(std::function cb); /** Reset the control frame callback. @@ -762,8 +762,8 @@ class stream */ void handshake( - boost::core::string_view host, - boost::core::string_view target); + core::string_view host, + core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -820,8 +820,8 @@ class stream void handshake( response_type& res, - boost::core::string_view host, - boost::core::string_view target); + core::string_view host, + core::string_view target); /** Perform the WebSocket handshake in the client role. @@ -868,8 +868,8 @@ class stream */ void handshake( - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, error_code& ec); /** Perform the WebSocket handshake in the client role. @@ -925,8 +925,8 @@ class stream void handshake( response_type& res, - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, error_code& ec); /** Perform the WebSocket handshake asynchronously in the client role. @@ -1002,8 +1002,8 @@ class stream > BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -1091,8 +1091,8 @@ class stream BOOST_BEAST_ASYNC_RESULT1(HandshakeHandler) async_handshake( response_type& res, - boost::core::string_view host, - boost::core::string_view target, + core::string_view host, + core::string_view target, HandshakeHandler&& handler = net::default_completion_token_t< executor_type>{}); @@ -2909,7 +2909,7 @@ class stream template void do_handshake(response_type* res_p, - boost::core::string_view host, boost::core::string_view target, + core::string_view host, core::string_view target, RequestDecorator const& decorator, error_code& ec); diff --git a/test/beast/_experimental/icy_stream.cpp b/test/beast/_experimental/icy_stream.cpp index 095a6ff499..fcafd4153f 100644 --- a/test/beast/_experimental/icy_stream.cpp +++ b/test/beast/_experimental/icy_stream.cpp @@ -28,7 +28,7 @@ class icy_stream_test { public: void - doMatrix(boost::core::string_view in, boost::core::string_view out) + doMatrix(core::string_view in, core::string_view out) { using net::mutable_buffer; net::io_context ioc; diff --git a/test/beast/core/_detail_base64.cpp b/test/beast/core/_detail_base64.cpp index 7787170647..f1d02c9347 100644 --- a/test/beast/core/_detail_base64.cpp +++ b/test/beast/core/_detail_base64.cpp @@ -32,14 +32,14 @@ class base64_test : public beast::unit_test::suite } std::string - base64_encode(boost::core::string_view s) + base64_encode(core::string_view s) { return base64_encode (reinterpret_cast < std::uint8_t const*> (s.data()), s.size()); } std::string - base64_decode(boost::core::string_view data) + base64_decode(core::string_view data) { std::string dest; dest.resize(base64::decoded_size(data.size())); diff --git a/test/beast/core/basic_stream.cpp b/test/beast/core/basic_stream.cpp index 2c8814f421..5d8912b4d4 100644 --- a/test/beast/core/basic_stream.cpp +++ b/test/beast/core/basic_stream.cpp @@ -167,7 +167,7 @@ struct test_acceptor class test_server { - boost::core::string_view s_; + core::string_view s_; std::ostream& log_; net::io_context ioc_; net::ip::tcp::acceptor acceptor_; @@ -175,7 +175,7 @@ class test_server std::thread t_; void - fail(error_code const& ec, boost::core::string_view what) + fail(error_code const& ec, core::string_view what) { if(ec != net::error::operation_aborted) log_ << what << ": " << ec.message() << "\n"; @@ -183,7 +183,7 @@ class test_server public: test_server( - boost::core::string_view s, + core::string_view s, net::ip::tcp::endpoint ep, std::ostream& log) : s_(s) @@ -253,12 +253,12 @@ class test_server class session : public std::enable_shared_from_this { - boost::core::string_view s_; + core::string_view s_; net::ip::tcp::socket socket_; public: session( - boost::core::string_view s, + core::string_view s, net::ip::tcp::socket sock, std::ostream&) : s_(s) diff --git a/test/beast/core/bind_handler.cpp b/test/beast/core/bind_handler.cpp index 82aca20542..2298adf7ab 100644 --- a/test/beast/core/bind_handler.cpp +++ b/test/beast/core/bind_handler.cpp @@ -287,7 +287,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, boost::core::string_view s) + operator()(int v, core::string_view s) { fail_ = false; BEAST_EXPECT(v == 42); @@ -295,7 +295,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, boost::core::string_view s, move_arg<1>) + operator()(int v, core::string_view s, move_arg<1>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -303,7 +303,7 @@ class bind_handler_test : public unit_test::suite } void - operator()(int v, boost::core::string_view s, move_arg<1>, move_arg<2>) + operator()(int v, core::string_view s, move_arg<1>, move_arg<2>) { fail_ = false; BEAST_EXPECT(v == 42); @@ -319,7 +319,7 @@ class bind_handler_test : public unit_test::suite void operator()( - error_code, std::size_t n, boost::core::string_view s) + error_code, std::size_t n, core::string_view s) { boost::ignore_unused(s); fail_ = false; @@ -527,7 +527,7 @@ class bind_handler_test : public unit_test::suite // void(error_code, size_t) bind_front_handler(test_cb{}, ec, n)(); - // void(error_code, size_t)(boost::core::string_view) + // void(error_code, size_t)(core::string_view) bind_front_handler(test_cb{}, ec, n)("s"); // perfect forwarding diff --git a/test/beast/core/buffers_cat.cpp b/test/beast/core/buffers_cat.cpp index a7d4781ff9..588b98ddde 100644 --- a/test/beast/core/buffers_cat.cpp +++ b/test/beast/core/buffers_cat.cpp @@ -72,7 +72,7 @@ class buffers_cat_test : public unit_test::suite void testBufferSequence() { - boost::core::string_view s = "Hello, world!"; + core::string_view s = "Hello, world!"; net::const_buffer b1(s.data(), 6); net::const_buffer b2( s.data() + b1.size(), s.size() - b1.size()); diff --git a/test/beast/core/buffers_range.cpp b/test/beast/core/buffers_range.cpp index 790e8916f8..579326f7b9 100644 --- a/test/beast/core/buffers_range.cpp +++ b/test/beast/core/buffers_range.cpp @@ -69,7 +69,7 @@ class buffers_range_test : public beast::unit_test::suite testBufferSequence() { { - boost::core::string_view s = "Hello, world!"; + core::string_view s = "Hello, world!"; test_buffer_sequence(buffers_range( net::const_buffer{s.data(), s.size()})); } diff --git a/test/beast/core/buffers_suffix.cpp b/test/beast/core/buffers_suffix.cpp index 6d2dcca666..284bc2e93f 100644 --- a/test/beast/core/buffers_suffix.cpp +++ b/test/beast/core/buffers_suffix.cpp @@ -37,7 +37,7 @@ class buffers_suffix_test : public beast::unit_test::suite // const { - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; std::array b{{ net::const_buffer(src.data(), 3), net::const_buffer(src.data() + 3, 4), diff --git a/test/beast/core/detect_ssl.cpp b/test/beast/core/detect_ssl.cpp index f2028aac7a..1339826fee 100644 --- a/test/beast/core/detect_ssl.cpp +++ b/test/beast/core/detect_ssl.cpp @@ -31,21 +31,21 @@ class detect_ssl_test : public unit_test::suite testDetect() { auto const yes = - [](int n, boost::core::string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const no = - [](int n, boost::core::string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(! detail::is_tls_client_hello( net::const_buffer(s.data(), n))); }; auto const maybe = - [](int n, boost::core::string_view s) + [](int n, core::string_view s) { BEAST_EXPECT(boost::indeterminate( detail::is_tls_client_hello( diff --git a/test/beast/core/file_test.hpp b/test/beast/core/file_test.hpp index 30941d6f06..2a8e6c1558 100644 --- a/test/beast/core/file_test.hpp +++ b/test/beast/core/file_test.hpp @@ -393,7 +393,7 @@ test_file() // read and write { - boost::core::string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // write { diff --git a/test/beast/core/flat_buffer.cpp b/test/beast/core/flat_buffer.cpp index a08d9c289c..0035a26ec9 100644 --- a/test/beast/core/flat_buffer.cpp +++ b/test/beast/core/flat_buffer.cpp @@ -255,7 +255,7 @@ class flat_buffer_test : public beast::unit_test::suite // operations { - boost::core::string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; flat_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); diff --git a/test/beast/core/flat_static_buffer.cpp b/test/beast/core/flat_static_buffer.cpp index 68929d45fd..064ad03c1f 100644 --- a/test/beast/core/flat_static_buffer.cpp +++ b/test/beast/core/flat_static_buffer.cpp @@ -41,7 +41,7 @@ class flat_static_buffer_test : public beast::unit_test::suite void testMembers() { - boost::core::string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // flat_static_buffer_base { diff --git a/test/beast/core/make_printable.cpp b/test/beast/core/make_printable.cpp index 27e0640517..423bb66284 100644 --- a/test/beast/core/make_printable.cpp +++ b/test/beast/core/make_printable.cpp @@ -43,7 +43,7 @@ class make_printable_test : public beast::unit_test::suite { char buf[13]; buffers_triple b(buf, sizeof(buf)); - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; BEAST_EXPECT(src.size() == sizeof(buf)); net::buffer_copy(b, net::const_buffer(src.data(), src.size())); diff --git a/test/beast/core/multi_buffer.cpp b/test/beast/core/multi_buffer.cpp index a8a07be67e..40cf12dad4 100644 --- a/test/beast/core/multi_buffer.cpp +++ b/test/beast/core/multi_buffer.cpp @@ -418,7 +418,7 @@ class multi_buffer_test : public beast::unit_test::suite } } { - boost::core::string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; multi_buffer b1{64}; BEAST_EXPECT(b1.size() == 0); BEAST_EXPECT(b1.max_size() == 64); @@ -683,7 +683,7 @@ class multi_buffer_test : public beast::unit_test::suite void testMatrix1() { - boost::core::string_view s = "Hello, world"; + core::string_view s = "Hello, world"; BEAST_EXPECT(s.size() == 12); for(std::size_t i = 1; i < 12; ++i) { for(std::size_t x = 1; x < 4; ++x) { diff --git a/test/beast/core/ostream.cpp b/test/beast/core/ostream.cpp index 32f2a568d8..b0fcd4c920 100644 --- a/test/beast/core/ostream.cpp +++ b/test/beast/core/ostream.cpp @@ -27,7 +27,7 @@ class ostream_test : public beast::unit_test::suite void testOstream() { - boost::core::string_view const s = "0123456789abcdef"; + core::string_view const s = "0123456789abcdef"; BEAST_EXPECT(s.size() == 16); // overflow @@ -75,7 +75,7 @@ class ostream_test : public beast::unit_test::suite { // Issue #1853 flat_static_buffer<16> b; - auto half_view = boost::core::string_view(s.data(), 8); + auto half_view = core::string_view(s.data(), 8); { auto os = ostream(b); os << half_view; @@ -88,9 +88,9 @@ class ostream_test : public beast::unit_test::suite flat_static_buffer<16> b; { auto os = ostream(b); - os << boost::core::string_view(s.data(), 8); + os << core::string_view(s.data(), 8); os.flush(); - os << boost::core::string_view(s.data() + 8, 8); + os << core::string_view(s.data() + 8, 8); os.flush(); } BEAST_EXPECT(buffers_to_string(b.data()) == s); diff --git a/test/beast/core/static_buffer.cpp b/test/beast/core/static_buffer.cpp index efc895c6ad..e2310e5844 100644 --- a/test/beast/core/static_buffer.cpp +++ b/test/beast/core/static_buffer.cpp @@ -45,7 +45,7 @@ class static_buffer_test : public beast::unit_test::suite void testMembers() { - boost::core::string_view const s = "Hello, world!"; + core::string_view const s = "Hello, world!"; // static_buffer_base { diff --git a/test/beast/core/static_string.cpp b/test/beast/core/static_string.cpp index b2c1652b68..f68b3d2502 100644 --- a/test/beast/core/static_string.cpp +++ b/test/beast/core/static_string.cpp @@ -126,13 +126,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1( - boost::core::string_view("123")); + core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<2> s2( - boost::core::string_view("123")); + core::string_view("123")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -235,13 +235,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s1; - s1 = boost::core::string_view("123"); + s1 = core::string_view("123"); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); try { static_string<1> s2; - s2 = boost::core::string_view("123"); + s2 = core::string_view("123"); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -373,15 +373,15 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1; - s1.assign(boost::core::string_view("123")); + s1.assign(core::string_view("123")); BEAST_EXPECT(s1 == "123"); BEAST_EXPECT(*s1.end() == 0); - s1.assign(boost::core::string_view("12345")); + s1.assign(core::string_view("12345")); BEAST_EXPECT(s1 == "12345"); BEAST_EXPECT(*s1.end() == 0); try { - s1.assign(boost::core::string_view("1234567")); + s1.assign(core::string_view("1234567")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -486,7 +486,7 @@ class static_string_test : public beast::unit_test::suite } { static_string<3> s("123"); - boost::core::string_view sv = s; + core::string_view sv = s; BEAST_EXPECT(static_string<5>(sv) == "123"); } } @@ -754,13 +754,13 @@ class static_string_test : public beast::unit_test::suite } { static_string<5> s1("123"); - s1.insert(1, boost::core::string_view("UV")); + s1.insert(1, core::string_view("UV")); BEAST_EXPECT(s1 == "1UV23"); BEAST_EXPECT(*s1.end() == 0); try { static_string<4> s2("123"); - s2.insert(1, boost::core::string_view("UV")); + s2.insert(1, core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::length_error const&) @@ -770,7 +770,7 @@ class static_string_test : public beast::unit_test::suite try { static_string<5> s2("123"); - s2.insert(5, boost::core::string_view("UV")); + s2.insert(5, core::string_view("UV")); fail("", __FILE__, __LINE__); } catch(std::out_of_range const&) @@ -1033,7 +1033,7 @@ class static_string_test : public beast::unit_test::suite } } { - boost::core::string_view s1("XYZ"); + core::string_view s1("XYZ"); static_string<5> s2("12"); s2.append(s1); BEAST_EXPECT(s2 == "12XYZ"); @@ -1133,7 +1133,7 @@ class static_string_test : public beast::unit_test::suite } } { - boost::core::string_view s1("34"); + core::string_view s1("34"); static_string<4> s2("12"); s2 += s1; BEAST_EXPECT(s2 == "1234"); diff --git a/test/beast/core/test_buffer.hpp b/test/beast/core/test_buffer.hpp index d2740e5aff..f92c1fb9bd 100644 --- a/test/beast/core/test_buffer.hpp +++ b/test/beast/core/test_buffer.hpp @@ -119,7 +119,7 @@ void test_mutable_buffers( MutableBufferSequence const& b, net::mutable_buffer) { - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; BOOST_ASSERT(buffer_bytes(b) <= src.size()); if(src.size() > buffer_bytes(b)) src = {src.data(), buffer_bytes(b)}; @@ -298,7 +298,7 @@ test_mutable_dynamic_buffer( typename MutableDynamicBuffer_v0::mutable_buffers_type, typename MutableDynamicBuffer_v0::const_buffers_type>::value); - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; @@ -385,7 +385,7 @@ test_dynamic_buffer( // members { - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -524,7 +524,7 @@ test_dynamic_buffer( // setup source buffer char buf[13]; unsigned char k0 = 0; - boost::core::string_view src(buf, sizeof(buf)); + core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -559,7 +559,7 @@ test_dynamic_buffer( // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - boost::core::string_view in(src.data(), h); + core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { @@ -620,7 +620,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // members { - boost::core::string_view src = "Hello, world!"; + core::string_view src = "Hello, world!"; DynamicBuffer_v0 b1(b0); auto const mb = b1.prepare(src.size()); @@ -702,7 +702,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // setup source buffer char buf[13]; unsigned char k0 = 0; - boost::core::string_view src(buf, sizeof(buf)); + core::string_view src(buf, sizeof(buf)); if(src.size() > b0.max_size()) src = {src.data(), b0.max_size()}; BEAST_EXPECT(b0.max_size() >= src.size()); @@ -737,7 +737,7 @@ test_dynamic_buffer_ref(DynamicBuffer_v0 b0) // k = consume size for(std::size_t h = 1; h <= src.size(); ++h) { - boost::core::string_view in(src.data(), h); + core::string_view in(src.data(), h); for(std::size_t i = 1; i <= in.size(); ++i) { for(std::size_t j = 1; j <= i + 1; ++j) { for(std::size_t k = 1; k <= in.size(); ++k) { diff --git a/test/beast/http/basic_parser.cpp b/test/beast/http/basic_parser.cpp index 2a0270f618..009a76eca0 100644 --- a/test/beast/http/basic_parser.cpp +++ b/test/beast/http/basic_parser.cpp @@ -213,7 +213,7 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(boost::core::string_view msg, Test const& test, bool skip = false) + parsegrind(core::string_view msg, Test const& test, bool skip = false) { parsegrind(net::const_buffer{ msg.data(), msg.size()}, test, skip); @@ -229,14 +229,14 @@ class basic_parser_test : public beast::unit_test::suite template void - parsegrind(boost::core::string_view msg) + parsegrind(core::string_view msg) { parsegrind(msg, [](Parser const&){}); } template void - failgrind(boost::core::string_view msg, error_code const& result) + failgrind(core::string_view msg, error_code const& result) { for(std::size_t i = 1; i < msg.size() - 1; ++i) { @@ -321,7 +321,7 @@ class basic_parser_test : public beast::unit_test::suite testObsFold() { auto const check = - [&](std::string const& s, boost::core::string_view value) + [&](std::string const& s, core::string_view value) { std::string m = "GET / HTTP/1.1\r\n" @@ -952,7 +952,7 @@ class basic_parser_test : public beast::unit_test::suite static net::const_buffer - buf(boost::core::string_view s) + buf(core::string_view s) { return {s.data(), s.size()}; } @@ -1140,7 +1140,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - boost::core::string_view s = + core::string_view s = "GET / HTTP/1.1\r\n" "\r\n" "die!"; @@ -1177,7 +1177,7 @@ class basic_parser_test : public beast::unit_test::suite error_code ec; test_parser p; p.eager(true); - boost::core::string_view s = + core::string_view s = "HTTP/1.1 101 Switching Protocols\r\n" "Content-Length: 2147483648\r\n" "\r\n"; @@ -1194,12 +1194,12 @@ class basic_parser_test : public beast::unit_test::suite testFuzz() { auto const grind = - [&](boost::core::string_view s) + [&](core::string_view s) { static_string<100> ss(s.data(), s.size()); test::fuzz_rand r; test::fuzz(ss, 4, 5, r, - [&](boost::core::string_view s) + [&](core::string_view s) { error_code ec; test_parser p; @@ -1209,7 +1209,7 @@ class basic_parser_test : public beast::unit_test::suite }); }; auto const good = - [&](boost::core::string_view s) + [&](core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1226,7 +1226,7 @@ class basic_parser_test : public beast::unit_test::suite grind(msg); }; auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { std::string msg = "HTTP/1.1 200 OK\r\n" @@ -1282,7 +1282,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](boost::core::string_view s, std::uint32_t v0) + [&](core::string_view s, std::uint32_t v0) { std::uint64_t v; auto const result = @@ -1291,7 +1291,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { std::uint64_t v; auto const result = @@ -1318,7 +1318,7 @@ class basic_parser_test : public beast::unit_test::suite { using base = detail::basic_parser_base; auto const good = - [&](boost::core::string_view s, std::uint64_t v0) + [&](core::string_view s, std::uint64_t v0) { std::uint64_t v; auto it = s.data(); @@ -1328,7 +1328,7 @@ class basic_parser_test : public beast::unit_test::suite BEAST_EXPECTS(v == v0, s); }; auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { std::uint64_t v; auto it = s.data(); @@ -1513,7 +1513,7 @@ class basic_parser_test : public beast::unit_test::suite void testChunkedBodySize() { - boost::core::string_view resp = + core::string_view resp = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Transfer-Encoding: chunked\r\n" diff --git a/test/beast/http/chunk_encode.cpp b/test/beast/http/chunk_encode.cpp index d7e1ec9e91..9e04fe97ab 100644 --- a/test/beast/http/chunk_encode.cpp +++ b/test/beast/http/chunk_encode.cpp @@ -38,7 +38,7 @@ class chunk_encode_test template void - check(boost::core::string_view match, Args&&... args) + check(core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -50,7 +50,7 @@ class chunk_encode_test template void - check_fwd(boost::core::string_view match, Args&&... args) + check_fwd(core::string_view match, Args&&... args) { T t(std::forward(args)...); BEAST_EXPECT(buffers_to_string(t) == match); @@ -64,7 +64,7 @@ class chunk_encode_test static cb_t - cb(boost::core::string_view s) + cb(core::string_view s) { return {s.data(), s.size()}; } @@ -227,7 +227,7 @@ class chunk_encode_test testParseChunkExtensions() { auto const grind = - [&](boost::core::string_view s) + [&](core::string_view s) { error_code ec; static_string<200> ss(s.data(), s.size()); @@ -235,7 +235,7 @@ class chunk_encode_test for(auto i = 3; i--;) { test::fuzz(ss, 5, 5, r, - [&](boost::core::string_view s) + [&](core::string_view s) { chunk_extensions c1; c1.parse(s, ec); @@ -259,7 +259,7 @@ class chunk_encode_test } }; auto const good = - [&](boost::core::string_view s) + [&](core::string_view s) { error_code ec; chunk_extensions ce; @@ -268,7 +268,7 @@ class chunk_encode_test grind(s); }; auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { error_code ec; chunk_extensions ce; diff --git a/test/beast/http/field.cpp b/test/beast/http/field.cpp index 3cf19883c9..c6f5c98e69 100644 --- a/test/beast/http/field.cpp +++ b/test/beast/http/field.cpp @@ -23,7 +23,7 @@ class field_test : public beast::unit_test::suite testField() { auto const match = - [&](field f, boost::core::string_view s) + [&](field f, core::string_view s) { BEAST_EXPECT(iequals(to_string(f), s)); BEAST_EXPECT(string_to_field(s) == f); @@ -163,7 +163,7 @@ class field_test : public beast::unit_test::suite match(field::x_xss_protection, "X-XSS-Protection"); auto const unknown = - [&](boost::core::string_view s) + [&](core::string_view s) { BEAST_EXPECT(string_to_field(s) == field::unknown); }; diff --git a/test/beast/http/fields.cpp b/test/beast/http/fields.cpp index 620cac9253..0eb3036342 100644 --- a/test/beast/http/fields.cpp +++ b/test/beast/http/fields.cpp @@ -1042,30 +1042,30 @@ class fields_test : public beast::unit_test::suite BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); - BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); + BOOST_CORE_STATIC_ASSERT((! set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); - BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); + BOOST_CORE_STATIC_ASSERT(( set_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); - BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); + BOOST_CORE_STATIC_ASSERT((! insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); - BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); + BOOST_CORE_STATIC_ASSERT(( insert_test::value)); } template diff --git a/test/beast/http/file_body.cpp b/test/beast/http/file_body.cpp index 1ba2c80e9f..00bf40fdff 100644 --- a/test/beast/http/file_body.cpp +++ b/test/beast/http/file_body.cpp @@ -103,7 +103,7 @@ class file_body_test : public beast::unit_test::suite doTestFileBody() { error_code ec; - boost::core::string_view const s = + core::string_view const s = "HTTP/1.1 200 OK\r\n" "Server: test\r\n" "Content-Length: 3\r\n" @@ -147,7 +147,7 @@ class file_body_test : public beast::unit_test::suite sr.next(ec, visit); BEAST_EXPECTS(! ec, ec.message()); auto const b = buffers_front(visit.buffer.data()); - boost::core::string_view const s1{ + core::string_view const s1{ reinterpret_cast(b.data()), b.size()}; BEAST_EXPECTS(s1 == s, s1); @@ -164,7 +164,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - boost::core::string_view const ten = + core::string_view const ten = "0123456789"; // 40 // create the temporary file { @@ -219,7 +219,7 @@ class file_body_test : public beast::unit_test::suite auto temp = temp_file(log); error_code ec; - boost::core::string_view const ten = + core::string_view const ten = "0123456789"; // 40 // create the temporary file { diff --git a/test/beast/http/message.cpp b/test/beast/http/message.cpp index e897eb66f8..0392a47754 100644 --- a/test/beast/http/message.cpp +++ b/test/beast/http/message.cpp @@ -87,23 +87,23 @@ class message_test : public beast::unit_test::suite >::value); //BOOST_CORE_STATIC_ASSERT(! std::is_constructible, - // verb, boost::core::string_view, unsigned>::value); + // verb, core::string_view, unsigned>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, boost::core::string_view, unsigned, Arg1>::value); + verb, core::string_view, unsigned, Arg1>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, boost::core::string_view, unsigned, Arg1&&>::value); + verb, core::string_view, unsigned, Arg1&&>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, boost::core::string_view, unsigned, Arg1 const>::value); + verb, core::string_view, unsigned, Arg1 const>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, boost::core::string_view, unsigned, Arg1 const&>::value); + verb, core::string_view, unsigned, Arg1 const&>::value); // 1-arg + fields BOOST_CORE_STATIC_ASSERT(std::is_constructible, - verb, boost::core::string_view, unsigned, Arg1, fields::allocator_type>::value); + verb, core::string_view, unsigned, Arg1, fields::allocator_type>::value); BOOST_CORE_STATIC_ASSERT(std::is_constructible, std::piecewise_construct_t, std::tuple>::value); @@ -198,15 +198,15 @@ class message_test : public beast::unit_test::suite test_fields() = delete; test_fields(token) {} - boost::core::string_view get_method_impl() const { return {}; } - boost::core::string_view get_target_impl() const { return target; } - boost::core::string_view get_reason_impl() const { return {}; } + core::string_view get_method_impl() const { return {}; } + core::string_view get_target_impl() const { return target; } + core::string_view get_reason_impl() const { return {}; } bool get_chunked_impl() const { return false; } bool get_keep_alive_impl(unsigned) const { return true; } bool has_content_length_impl() const { return false; } - void set_method_impl(boost::core::string_view) {} - void set_target_impl(boost::core::string_view s) { target = std::string(s); } - void set_reason_impl(boost::core::string_view) {} + void set_method_impl(core::string_view) {} + void set_target_impl(core::string_view s) { target = std::string(s); } + void set_reason_impl(core::string_view) {} void set_chunked_impl(bool) {} void set_content_length_impl(boost::optional) {} void set_keep_alive_impl(unsigned, bool) {} @@ -352,7 +352,7 @@ class message_test : public beast::unit_test::suite BEAST_EXPECT(h.method_string() == to_string(v)); }; auto const scheck = - [&](boost::core::string_view s) + [&](core::string_view s) { h.method_string(s); BEAST_EXPECT(h.method() == string_to_verb(s)); diff --git a/test/beast/http/message_fuzz.hpp b/test/beast/http/message_fuzz.hpp index 8033a0147b..f719c2f055 100644 --- a/test/beast/http/message_fuzz.hpp +++ b/test/beast/http/message_fuzz.hpp @@ -22,7 +22,7 @@ namespace http { template std::string -escaped_string(boost::core::string_view s) +escaped_string(core::string_view s) { std::string out; out.reserve(s.size()); diff --git a/test/beast/http/parser.cpp b/test/beast/http/parser.cpp index f839b0c449..09eef495db 100644 --- a/test/beast/http/parser.cpp +++ b/test/beast/http/parser.cpp @@ -36,7 +36,7 @@ class parser_test static net::const_buffer - buf(boost::core::string_view s) + buf(core::string_view s) { return {s.data(), s.size()}; } @@ -70,7 +70,7 @@ class parser_test template void - doMatrix(boost::core::string_view s0, F const& f) + doMatrix(core::string_view s0, F const& f) { // parse a single buffer { diff --git a/test/beast/http/read.cpp b/test/beast/http/read.cpp index 0b2ace4d89..b5888fb951 100644 --- a/test/beast/http/read.cpp +++ b/test/beast/http/read.cpp @@ -440,7 +440,7 @@ class read_test template void - readgrind(boost::core::string_view s, Pred&& pred) + readgrind(core::string_view s, Pred&& pred) { for(std::size_t n = 1; n < s.size() - 1; ++n) { @@ -600,8 +600,8 @@ class read_test request_parser p; test::stream s(ioc_); - s.append(boost::core::string_view(hdr)); - s.append(boost::core::string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); flat_buffer fb; error_code ec; auto bt = async_read_header(s, fb, p, yield[ec]); @@ -685,8 +685,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(boost::core::string_view(hdr)); - s.append(boost::core::string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); flat_buffer fb; error_code ec; auto bt = read_header(s, fb, p, ec); @@ -703,8 +703,8 @@ class read_test // bytes_transferred returns length of header request_parser p; test::stream s(ioc); - s.append(boost::core::string_view(hdr)); - s.append(boost::core::string_view(body)); + s.append(core::string_view(hdr)); + s.append(core::string_view(body)); std::string res ; auto fb = asio::dynamic_buffer(res); error_code ec; diff --git a/test/beast/http/rfc7230.cpp b/test/beast/http/rfc7230.cpp index 31d5e1f72e..52584295de 100644 --- a/test/beast/http/rfc7230.cpp +++ b/test/beast/http/rfc7230.cpp @@ -31,7 +31,7 @@ class rfc7230_test : public beast::unit_test::suite static std::string - str(boost::core::string_view s) + str(core::string_view s) { return std::string(s.data(), s.size()); } @@ -246,7 +246,7 @@ class rfc7230_test : public beast::unit_test::suite template static std::vector - to_vector(boost::core::string_view in) + to_vector(core::string_view in) { std::vector v; detail::basic_parsed_list list{in}; @@ -258,7 +258,7 @@ class rfc7230_test : public beast::unit_test::suite template void - validate(boost::core::string_view in, + validate(core::string_view in, std::vector const& v) { BEAST_EXPECT(to_vector(in) == v); @@ -266,7 +266,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(boost::core::string_view in) + good(core::string_view in) { BEAST_EXPECT(validate_list( detail::basic_parsed_list{in})); @@ -274,7 +274,7 @@ class rfc7230_test : public beast::unit_test::suite template void - good(boost::core::string_view in, + good(core::string_view in, std::vector const& v) { BEAST_EXPECT(validate_list( @@ -284,7 +284,7 @@ class rfc7230_test : public beast::unit_test::suite template void - bad(boost::core::string_view in) + bad(core::string_view in) { BEAST_EXPECT(! validate_list( detail::basic_parsed_list{in})); diff --git a/test/beast/http/test_parser.hpp b/test/beast/http/test_parser.hpp index 260a583657..681a28028e 100644 --- a/test/beast/http/test_parser.hpp +++ b/test/beast/http/test_parser.hpp @@ -55,8 +55,8 @@ class test_parser } void - on_request_impl(verb, boost::core::string_view method_str_, - boost::core::string_view path_, int version_, error_code& ec) + on_request_impl(verb, core::string_view method_str_, + core::string_view path_, int version_, error_code& ec) { method = std::string( method_str_.data(), method_str_.size()); @@ -70,7 +70,7 @@ class test_parser void on_response_impl(int code, - boost::core::string_view reason_, + core::string_view reason_, int version_, error_code& ec) { status = code; @@ -83,8 +83,8 @@ class test_parser } void - on_field_impl(field, boost::core::string_view name, - boost::core::string_view value, error_code& ec) + on_field_impl(field, core::string_view name, + core::string_view value, error_code& ec) { ++got_on_field; if(fc_) @@ -93,8 +93,8 @@ class test_parser } void - on_trailer_field_impl(field, boost::core::string_view name, - boost::core::string_view value, error_code& ec) + on_trailer_field_impl(field, core::string_view name, + core::string_view value, error_code& ec) { ++got_on_trailer_field; if(fc_) @@ -125,7 +125,7 @@ class test_parser } std::size_t - on_body_impl(boost::core::string_view s, + on_body_impl(core::string_view s, error_code& ec) { body.append(s.data(), s.size()); @@ -137,7 +137,7 @@ class test_parser void on_chunk_header_impl( std::uint64_t, - boost::core::string_view, + core::string_view, error_code& ec) { ++got_on_chunk; @@ -148,7 +148,7 @@ class test_parser std::size_t on_chunk_body_impl( std::uint64_t, - boost::core::string_view s, + core::string_view s, error_code& ec) { body.append(s.data(), s.size()); diff --git a/test/beast/http/verb.cpp b/test/beast/http/verb.cpp index 6ad7b4125b..e9b956b4a7 100644 --- a/test/beast/http/verb.cpp +++ b/test/beast/http/verb.cpp @@ -66,7 +66,7 @@ class verb_test good(verb::unlink); auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { auto const v = string_to_verb(s); BEAST_EXPECTS(v == verb::unknown, to_string(v)); diff --git a/test/beast/http/write.cpp b/test/beast/http/write.cpp index c629db1da0..4bc7629dd3 100644 --- a/test/beast/http/write.cpp +++ b/test/beast/http/write.cpp @@ -274,7 +274,7 @@ class write_test template bool - equal_body(boost::core::string_view sv, boost::core::string_view body) + equal_body(core::string_view sv, core::string_view body) { test::stream ts{ioc_, sv}, tr{ioc_}; ts.connect(tr); diff --git a/test/beast/websocket/accept.cpp b/test/beast/websocket/accept.cpp index 72584291cb..18a53b5c68 100644 --- a/test/beast/websocket/accept.cpp +++ b/test/beast/websocket/accept.cpp @@ -482,7 +482,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite net::io_context ioc; auto const check = - [&](error_code ev, boost::core::string_view s) + [&](error_code ev, core::string_view s) { for(int i = 0; i < 3; ++i) { @@ -798,7 +798,7 @@ class accept_test : public unit_test::suite //: public websocket_test_suite { { stream ws1(ioc); - boost::core::string_view s = + core::string_view s = "GET / HTTP/1.1\r\n" "Host: localhost\r\n" "Upgrade: websocket\r\n" diff --git a/test/beast/websocket/close.cpp b/test/beast/websocket/close.cpp index 8d65341865..f80d3a1c2b 100644 --- a/test/beast/websocket/close.cpp +++ b/test/beast/websocket/close.cpp @@ -361,7 +361,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; ws.async_read(b, @@ -402,7 +402,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x09\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -443,7 +443,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_read(b, @@ -485,7 +485,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), @@ -529,7 +529,7 @@ class close_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00", 2}); std::size_t count = 0; ws.async_write(net::buffer(s), diff --git a/test/beast/websocket/handshake.cpp b/test/beast/websocket/handshake.cpp index 0ce6e84298..33ac381282 100644 --- a/test/beast/websocket/handshake.cpp +++ b/test/beast/websocket/handshake.cpp @@ -309,7 +309,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const accept = - [&](boost::core::string_view s) + [&](core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -319,7 +319,7 @@ class handshake_test : public websocket_test_suite }; auto const reject = - [&](boost::core::string_view s) + [&](core::string_view s) { http::fields f; f.set(http::field::sec_websocket_extensions, s); @@ -401,7 +401,7 @@ class handshake_test : public websocket_test_suite detail::pmd_offer po; auto const check = - [&](boost::core::string_view match) + [&](core::string_view match) { http::fields f; detail::pmd_write(f, po); @@ -447,7 +447,7 @@ class handshake_test : public websocket_test_suite auto const reject = [&]( - boost::core::string_view offer) + core::string_view offer) { detail::pmd_offer po; { @@ -463,8 +463,8 @@ class handshake_test : public websocket_test_suite auto const accept = [&]( - boost::core::string_view offer, - boost::core::string_view result) + core::string_view offer, + core::string_view result) { detail::pmd_offer po; { diff --git a/test/beast/websocket/ping.cpp b/test/beast/websocket/ping.cpp index 007dbd43a0..c2933e3fb7 100644 --- a/test/beast/websocket/ping.cpp +++ b/test/beast/websocket/ping.cpp @@ -148,7 +148,7 @@ class ping_test : public websocket_test_suite true }); unsigned n_pongs = 0; - ws1.control_callback({[&](frame_type kind, boost::core::string_view) + ws1.control_callback({[&](frame_type kind, core::string_view) { if (kind == frame_type::pong) ++n_pongs; @@ -247,7 +247,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; @@ -288,7 +288,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add an invalid frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x09\x00", 2}); std::size_t count = 0; @@ -330,7 +330,7 @@ class ping_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a close frame to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x88\x00", 2}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/websocket/read1.cpp b/test/beast/websocket/read1.cpp index 524ec573fe..e99e2c3558 100644 --- a/test/beast/websocket/read1.cpp +++ b/test/beast/websocket/read1.cpp @@ -185,7 +185,7 @@ class read1_test : public unit_test::suite stream_base::none(), false}); // add a close frame to the input - ws1.next_layer().append(boost::core::string_view{ + ws1.next_layer().append(core::string_view{ "\x88\x00", 2}); ws1.async_read(b, test::fail_handler( beast::error::timeout)); diff --git a/test/beast/websocket/read2.cpp b/test/beast/websocket/read2.cpp index ca52d0ec34..d3150228b9 100644 --- a/test/beast/websocket/read2.cpp +++ b/test/beast/websocket/read2.cpp @@ -102,7 +102,7 @@ class read2_test [&](ws_type_t& ws) { ws.next_layer().append( - boost::core::string_view( + core::string_view( "\x01\x00" "\x80\x00", 4)); multi_buffer b; w.read(ws, b); @@ -133,7 +133,7 @@ class read2_test {0x89, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, boost::core::string_view) + [&](frame_type kind, core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::ping); @@ -155,7 +155,7 @@ class read2_test {0x88, 0x00})); bool invoked = false; ws.control_callback( - [&](frame_type kind, boost::core::string_view) + [&](frame_type kind, core::string_view) { BEAST_EXPECT(! invoked); BEAST_EXPECT(kind == frame_type::close); @@ -171,7 +171,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, boost::core::string_view s) + [&](frame_type kind, core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -194,7 +194,7 @@ class read2_test { bool once = false; ws.control_callback( - [&](frame_type kind, boost::core::string_view s) + [&](frame_type kind, core::string_view s) { BEAST_EXPECT(kind == frame_type::pong); BEAST_EXPECT(! once); @@ -389,7 +389,7 @@ class read2_test // close frames { auto const check = - [&](error_code ev, boost::core::string_view s) + [&](error_code ev, core::string_view s) { echo_server es{log}; stream ws{ioc_}; @@ -560,7 +560,7 @@ class read2_test w.read_some(ws, net::buffer(buf, sizeof(buf))); BEAST_EXPECT(bytes_written > 0); BEAST_EXPECT( - boost::core::string_view(buf, 3).substr(0, bytes_written) == + core::string_view(buf, 3).substr(0, bytes_written) == s.substr(0, bytes_written)); }); @@ -637,7 +637,7 @@ class read2_test // Read close frames { auto const check = - [&](error_code ev, boost::core::string_view s) + [&](error_code ev, core::string_view s) { echo_server es{log}; stream ws{ioc_}; diff --git a/test/beast/websocket/read3.cpp b/test/beast/websocket/read3.cpp index 8e2042f6c3..92ebc67e79 100644 --- a/test/beast/websocket/read3.cpp +++ b/test/beast/websocket/read3.cpp @@ -99,7 +99,7 @@ class read3_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // insert a ping - ws.next_layer().append(boost::core::string_view( + ws.next_layer().append(core::string_view( "\x89\x00", 2)); std::size_t count = 0; std::string const s = "Hello, world"; @@ -139,7 +139,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a ping in between the frames. - ws.next_layer().append(boost::core::string_view( + ws.next_layer().append(core::string_view( "\x01\x01*" "\x89\x00" "\x80\x01*", 8)); @@ -187,7 +187,7 @@ class read3_test : public websocket_test_suite std::size_t count = 0; // insert fragmented message with // a close in between the frames. - ws.next_layer().append(boost::core::string_view( + ws.next_layer().append(core::string_view( "\x01\x01*" "\x88\x00" "\x80\x01*", 8)); @@ -219,7 +219,7 @@ class read3_test : public websocket_test_suite testParseFrame() { auto const bad = - [&](boost::core::string_view s) + [&](core::string_view s) { echo_server es{log}; net::io_context ioc; @@ -335,8 +335,8 @@ class read3_test : public websocket_test_suite } // length not canonical - bad(boost::core::string_view("\x81\x7e\x00\x7d", 4)); - bad(boost::core::string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); + bad(core::string_view("\x81\x7e\x00\x7d", 4)); + bad(core::string_view("\x81\x7f\x00\x00\x00\x00\x00\x00\xff\xff", 10)); } void @@ -398,7 +398,7 @@ class read3_test : public websocket_test_suite bool called_cb = false; bool called_handler = false; ws.control_callback( - [&called_cb](frame_type, boost::core::string_view) + [&called_cb](frame_type, core::string_view) { called_cb = true; }); diff --git a/test/beast/websocket/test.hpp b/test/beast/websocket/test.hpp index f385c03e09..ee4b98af5b 100644 --- a/test/beast/websocket/test.hpp +++ b/test/beast/websocket/test.hpp @@ -526,8 +526,8 @@ class websocket_test_suite void handshake( stream& ws, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(uri, path); } @@ -537,8 +537,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(res, uri, path); } @@ -549,8 +549,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -563,8 +563,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -780,8 +780,8 @@ class websocket_test_suite void handshake( stream& ws, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -795,8 +795,8 @@ class websocket_test_suite handshake( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -811,8 +811,8 @@ class websocket_test_suite void handshake_ex( stream& ws, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -829,8 +829,8 @@ class websocket_test_suite handshake_ex( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -1061,8 +1061,8 @@ struct test_sync_api handshake( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { ws.handshake(res, uri, path); } @@ -1073,8 +1073,8 @@ struct test_sync_api void handshake_ex( stream& ws, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(uri, path, d); @@ -1087,8 +1087,8 @@ struct test_sync_api handshake_ex( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const& d) const { ws.handshake_ex(res, uri, path, d); @@ -1361,8 +1361,8 @@ class test_async_api void handshake( stream& ws, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -1378,8 +1378,8 @@ class test_async_api handshake( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path) const + core::string_view uri, + core::string_view path) const { error_code ec; ws.async_handshake( @@ -1396,8 +1396,8 @@ class test_async_api void handshake_ex( stream& ws, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; @@ -1416,8 +1416,8 @@ class test_async_api handshake_ex( stream& ws, response_type& res, - boost::core::string_view uri, - boost::core::string_view path, + core::string_view uri, + core::string_view path, Decorator const &d) const { error_code ec; diff --git a/test/beast/websocket/timer.cpp b/test/beast/websocket/timer.cpp index 39ce3dcdc7..311b971a03 100644 --- a/test/beast/websocket/timer.cpp +++ b/test/beast/websocket/timer.cpp @@ -48,7 +48,7 @@ struct timer_test : unit_test::suite flat_buffer b2; bool received = false; ws1.control_callback( - [&received](frame_type ft, boost::core::string_view) + [&received](frame_type ft, core::string_view) { received = true; BEAST_EXPECT(ft == frame_type::ping); diff --git a/test/beast/websocket/write.cpp b/test/beast/websocket/write.cpp index 368c38d2fc..a679fafaaa 100644 --- a/test/beast/websocket/write.cpp +++ b/test/beast/websocket/write.cpp @@ -375,7 +375,7 @@ class write_test : public websocket_test_suite ws.next_layer().connect(es.stream()); ws.handshake("localhost", "/"); // add a ping and message to the input - ws.next_layer().append(boost::core::string_view{ + ws.next_layer().append(core::string_view{ "\x89\x00" "\x81\x01*", 5}); std::size_t count = 0; multi_buffer b; diff --git a/test/beast/zlib/deflate_stream.cpp b/test/beast/zlib/deflate_stream.cpp index a585ea4174..9557db1fec 100644 --- a/test/beast/zlib/deflate_stream.cpp +++ b/test/beast/zlib/deflate_stream.cpp @@ -203,7 +203,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string compress( - boost::core::string_view const& in, + core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel) // 1..9 (8=default) @@ -240,7 +240,7 @@ class deflate_stream_test : public beast::unit_test::suite static std::string - decompress(boost::core::string_view const& in) + decompress(core::string_view const& in) { int result; std::string out; @@ -474,7 +474,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - boost::core::string_view s = "Hello"; + core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); @@ -501,7 +501,7 @@ class deflate_stream_test : public beast::unit_test::suite c.init(); std::string out; out.resize(1024); - boost::core::string_view s = "Hello"; + core::string_view s = "Hello"; c.next_in(s.data()); c.avail_in(s.size()); c.next_out(&out.front()); diff --git a/test/beast/zlib/inflate_stream.cpp b/test/beast/zlib/inflate_stream.cpp index 4909ce253a..03631d96e5 100644 --- a/test/beast/zlib/inflate_stream.cpp +++ b/test/beast/zlib/inflate_stream.cpp @@ -187,7 +187,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string compress( - boost::core::string_view const& in, + core::string_view const& in, int level, // 0=none, 1..9, -1=default int windowBits, // 9..15 int memLevel, // 1..9 (8=default) diff --git a/test/bench/buffers/bench_buffers.cpp b/test/bench/buffers/bench_buffers.cpp index dc36b5de1f..8af640908b 100644 --- a/test/bench/buffers/bench_buffers.cpp +++ b/test/bench/buffers/bench_buffers.cpp @@ -174,7 +174,7 @@ class buffers_test : public beast::unit_test::suite template void - do_trials(boost::core::string_view name, + do_trials(core::string_view name, std::size_t trials, F0&& f0, FN... fn) { using namespace std::chrono; diff --git a/test/bench/parser/bench_parser.cpp b/test/bench/parser/bench_parser.cpp index 4f97455658..e79ffe74e8 100644 --- a/test/bench/parser/bench_parser.cpp +++ b/test/bench/parser/bench_parser.cpp @@ -153,21 +153,21 @@ class parser_test : public beast::unit_test::suite { void on_request_impl( - verb, boost::core::string_view, boost::core::string_view, + verb, core::string_view, core::string_view, int, error_code&) override { } void on_response_impl( - int, boost::core::string_view, int, + int, core::string_view, int, error_code&) override { } void on_field_impl( - field, boost::core::string_view, boost::core::string_view, + field, core::string_view, core::string_view, error_code&) override { } @@ -186,7 +186,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - boost::core::string_view, + core::string_view, error_code&) override { return 0; @@ -195,7 +195,7 @@ class parser_test : public beast::unit_test::suite void on_chunk_header_impl( std::uint64_t, - boost::core::string_view, + core::string_view, error_code&) override { } @@ -203,7 +203,7 @@ class parser_test : public beast::unit_test::suite std::size_t on_chunk_body_impl( std::uint64_t, - boost::core::string_view, + core::string_view, error_code&) override { return 0; @@ -222,26 +222,26 @@ class parser_test : public beast::unit_test::suite net::mutable_buffer; void - on_request_impl(verb, boost::core::string_view, - boost::core::string_view, int, error_code&) override + on_request_impl(verb, core::string_view, + core::string_view, int, error_code&) override { } void on_response_impl(int, - boost::core::string_view, int, error_code&) override + core::string_view, int, error_code&) override { } void on_field_impl(field, - boost::core::string_view, boost::core::string_view, error_code&) override + core::string_view, core::string_view, error_code&) override { } void on_trailer_field_impl(field, - boost::core::string_view, boost::core::string_view, error_code&) override + core::string_view, core::string_view, error_code&) override { } @@ -259,20 +259,20 @@ class parser_test : public beast::unit_test::suite std::size_t on_body_impl( - boost::core::string_view s, error_code&) override + core::string_view s, error_code&) override { return s.size(); } void on_chunk_header_impl(std::uint64_t, - boost::core::string_view, error_code&) override + core::string_view, error_code&) override { } std::size_t on_chunk_body_impl(std::uint64_t, - boost::core::string_view s, error_code&) override + core::string_view s, error_code&) override { return s.size(); } diff --git a/test/bench/zlib/deflate_stream.cpp b/test/bench/zlib/deflate_stream.cpp index bb3afa947c..912ddf0f1f 100644 --- a/test/bench/zlib/deflate_stream.cpp +++ b/test/bench/zlib/deflate_stream.cpp @@ -65,7 +65,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateBeast(boost::core::string_view const& in) + doDeflateBeast(core::string_view const& in) { z_params zs; deflate_stream ds; @@ -88,7 +88,7 @@ class deflate_stream_test : public beast::unit_test::suite } std::string - doDeflateZLib(boost::core::string_view const& in) + doDeflateZLib(core::string_view const& in) { int result; z_stream zs; diff --git a/test/bench/zlib/inflate_stream.cpp b/test/bench/zlib/inflate_stream.cpp index d28bab9e55..0c2e7fefe2 100644 --- a/test/bench/zlib/inflate_stream.cpp +++ b/test/bench/zlib/inflate_stream.cpp @@ -66,7 +66,7 @@ class inflate_stream_test : public beast::unit_test::suite static std::string - compress(boost::core::string_view const& in) + compress(core::string_view const& in) { int result; z_stream zs; @@ -98,7 +98,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateBeast(boost::core::string_view const& in) + doInflateBeast(core::string_view const& in) { z_params zs; std::string out; @@ -125,7 +125,7 @@ class inflate_stream_test : public beast::unit_test::suite } std::string - doInflateZLib(boost::core::string_view const& in) + doInflateZLib(core::string_view const& in) { int result; z_stream zs; diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 338b6409e4..69fc960922 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -33,13 +33,13 @@ snippets() { //[code_core_1_refresher_1s net::const_buffer cb("Hello, world!", 13); - assert(boost::core::string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( cb.data()), cb.size()) == "Hello, world!"); char storage[13]; net::mutable_buffer mb(storage, sizeof(storage)); std::memcpy(mb.data(), cb.data(), mb.size()); - assert(boost::core::string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( mb.data()), mb.size()) == "Hello, world!"); //] } diff --git a/test/doc/core_snippets.cpp b/test/doc/core_snippets.cpp index 7214a959a0..d46f5473e0 100644 --- a/test/doc/core_snippets.cpp +++ b/test/doc/core_snippets.cpp @@ -68,7 +68,7 @@ net::connect(stream, r.resolve("www.example.com", "http")); //[snippet_core_3 template -void write_string(SyncWriteStream& stream, boost::core::string_view s) +void write_string(SyncWriteStream& stream, core::string_view s) { static_assert(is_sync_write_stream::value, "SyncWriteStream type requirements not met"); diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index b290229ae9..5f502cd0e6 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -199,21 +199,21 @@ class Fields @note Only called for requests. */ - boost::core::string_view + core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - boost::core::string_view + core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - boost::core::string_view + core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -236,21 +236,21 @@ class Fields @note Only called for requests. */ void - set_method_impl(boost::core::string_view s); + set_method_impl(core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(boost::core::string_view s); + set_target_impl(core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(boost::core::string_view s); + set_reason_impl(core::string_view s); /** Sets or clears the chunked Transfer-Encoding value */ diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index d77bdb6a19..32119699d8 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -40,11 +40,11 @@ class custom_parser : public basic_parser */ void on_request_impl( - verb method, // The method verb, verb::unknown if no match - boost::core::string_view method_str, // The method as a string - boost::core::string_view target, // The request-target - int version, // The HTTP-version - error_code& ec) override; // The error returned to the caller, if any + verb method, // The method verb, verb::unknown if no match + core::string_view method_str, // The method as a string + core::string_view target, // The request-target + int version, // The HTTP-version + error_code& ec) override; // The error returned to the caller, if any /** Called after receiving the status-line. @@ -66,10 +66,10 @@ class custom_parser : public basic_parser */ void on_response_impl( - int code, // The status-code - boost::core::string_view reason, // The obsolete reason-phrase - int version, // The HTTP-version - error_code& ec) override; // The error returned to the caller, if any + int code, // The status-code + core::string_view reason, // The obsolete reason-phrase + int version, // The HTTP-version + error_code& ec) override; // The error returned to the caller, if any /** Called once for each complete field in the HTTP header. @@ -89,10 +89,10 @@ class custom_parser : public basic_parser */ void on_field_impl( - field f, // The known-field enumeration constant - boost::core::string_view name, // The field name string. - boost::core::string_view value, // The field value - error_code& ec) override; // The error returned to the caller, if any + field f, // The known-field enumeration constant + core::string_view name, // The field name string. + core::string_view value, // The field value + error_code& ec) override; // The error returned to the caller, if any /** Called once after the complete HTTP header is received. @@ -141,8 +141,8 @@ class custom_parser : public basic_parser */ std::size_t on_body_impl( - boost::core::string_view s, // A portion of the body - error_code& ec) override; // The error returned to the caller, if any + core::string_view s, // A portion of the body + error_code& ec) override; // The error returned to the caller, if any /** Called each time a new chunk header of a chunk encoded body is received. @@ -159,10 +159,10 @@ class custom_parser : public basic_parser */ void on_chunk_header_impl( - std::uint64_t size, // The size of the upcoming chunk, - // or zero for the last chunk - boost::core::string_view extension, // The chunk extensions (may be empty) - error_code& ec) override; // The error returned to the caller, if any + std::uint64_t size, // The size of the upcoming chunk, + // or zero for the last chunk + core::string_view extension, // The chunk extensions (may be empty) + error_code& ec) override; // The error returned to the caller, if any /** Called each time additional data is received representing part of a body chunk. @@ -188,11 +188,11 @@ class custom_parser : public basic_parser */ std::size_t on_chunk_body_impl( - std::uint64_t remain, // The number of bytes remaining in the chunk, - // including what is being passed here. - // or zero for the last chunk - boost::core::string_view body, // The next piece of the chunk body - error_code& ec) override; // The error returned to the caller, if any + std::uint64_t remain, // The number of bytes remaining in the chunk, + // including what is being passed here. + // or zero for the last chunk + core::string_view body, // The next piece of the chunk body + error_code& ec) override; // The error returned to the caller, if any /** Called once when the complete message is received. @@ -216,8 +216,8 @@ class custom_parser : public basic_parser template void custom_parser:: -on_request_impl(verb method, boost::core::string_view method_str, - boost::core::string_view path, int version, error_code& ec) +on_request_impl(verb method, core::string_view method_str, + core::string_view path, int version, error_code& ec) { boost::ignore_unused(method, method_str, path, version); ec = {}; @@ -227,7 +227,7 @@ template void custom_parser:: on_response_impl( int status, - boost::core::string_view reason, + core::string_view reason, int version, error_code& ec) { @@ -239,8 +239,8 @@ template void custom_parser:: on_field_impl( field f, - boost::core::string_view name, - boost::core::string_view value, + core::string_view name, + core::string_view value, error_code& ec) { boost::ignore_unused(f, name, value); @@ -266,7 +266,7 @@ on_body_init_impl( template std::size_t custom_parser:: -on_body_impl(boost::core::string_view body, error_code& ec) +on_body_impl(core::string_view body, error_code& ec) { boost::ignore_unused(body); ec = {}; @@ -277,7 +277,7 @@ template void custom_parser:: on_chunk_header_impl( std::uint64_t size, - boost::core::string_view extension, + core::string_view extension, error_code& ec) { boost::ignore_unused(size, extension); @@ -288,7 +288,7 @@ template std::size_t custom_parser:: on_chunk_body_impl( std::uint64_t remain, - boost::core::string_view body, + core::string_view body, error_code& ec) { boost::ignore_unused(remain); diff --git a/test/doc/http_examples.cpp b/test/doc/http_examples.cpp index c6dc0b8865..a8ffb565bf 100644 --- a/test/doc/http_examples.cpp +++ b/test/doc/http_examples.cpp @@ -55,7 +55,7 @@ class examples_test template bool - equal_body(boost::core::string_view sv, boost::core::string_view body) + equal_body(core::string_view sv, core::string_view body) { test::stream ts{ioc_, sv}; message m; @@ -271,7 +271,7 @@ class examples_test doExplicitChunkSerialize() { auto const buf = - [](boost::core::string_view s) + [](core::string_view s) { return net::const_buffer{ s.data(), s.size()}; diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 3d53831792..867f115573 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -251,7 +251,7 @@ void fxx() { //[http_snippet_23 // Manually emit a trailer. // We are responsible for ensuring that the trailer format adheres to the specification. - boost::core::string_view ext = + core::string_view ext = "Content-Digest: f4a5c16584f03d90\r\n" "\r\n"; net::write(sock, make_chunk_last(net::const_buffer{ext.data(), ext.size()})); diff --git a/test/doc/websocket_2_handshaking.cpp b/test/doc/websocket_2_handshaking.cpp index 76670c5ae4..0f2532507b 100644 --- a/test/doc/websocket_2_handshaking.cpp +++ b/test/doc/websocket_2_handshaking.cpp @@ -136,14 +136,14 @@ snippets() //[code_websocket_2_6 // a function to select the most preferred protocol from a comma-separated list - auto select_protocol = [](boost::core::string_view offered_tokens) -> std::string + auto select_protocol = [](core::string_view offered_tokens) -> std::string { // tokenize the Sec-Websocket-Protocol header offered by the client http::token_list offered( offered_tokens ); // an array of protocols supported by this server // in descending order of preference - static const std::array + static const std::array supported = {{ "v3.my.chat", "v2.my.chat", diff --git a/test/doc/websocket_5_control_frames.cpp b/test/doc/websocket_5_control_frames.cpp index 930795093c..54c587b660 100644 --- a/test/doc/websocket_5_control_frames.cpp +++ b/test/doc/websocket_5_control_frames.cpp @@ -33,7 +33,7 @@ snippets() //[code_websocket_5_1 ws.control_callback( - [](frame_type kind, boost::core::string_view payload) + [](frame_type kind, core::string_view payload) { // Do something with the payload boost::ignore_unused(kind, payload); diff --git a/test/extras/include/boost/beast/test/fuzz.hpp b/test/extras/include/boost/beast/test/fuzz.hpp index 8a034270a3..f127d8234b 100644 --- a/test/extras/include/boost/beast/test/fuzz.hpp +++ b/test/extras/include/boost/beast/test/fuzz.hpp @@ -92,7 +92,7 @@ fuzz( break; } } - f(boost::core::string_view{mod.data(), mod.size()}); + f(core::string_view{mod.data(), mod.size()}); if(depth > 0) fuzz(mod, repeat, depth - 1, r, f); } diff --git a/test/fuzz/http_response.cpp b/test/fuzz/http_response.cpp index 07de5b0e9a..bdc029af07 100644 --- a/test/fuzz/http_response.cpp +++ b/test/fuzz/http_response.cpp @@ -21,7 +21,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) http::chunk_extensions ce; http::response_parser parser; - auto chunk_header_cb = [&ce](std::uint64_t, boost::core::string_view extensions, error_code& ev) + auto chunk_header_cb = [&ce](std::uint64_t, core::string_view extensions, error_code& ev) { ce.parse(extensions, ev); }; diff --git a/test/fuzz/websocket_server.cpp b/test/fuzz/websocket_server.cpp index 1e0cf5be11..ab83da5e0e 100644 --- a/test/fuzz/websocket_server.cpp +++ b/test/fuzz/websocket_server.cpp @@ -18,7 +18,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) test::stream remote{ioc}; websocket::stream ws{ - ioc, boost::core::string_view{reinterpret_cast(data), size}}; + ioc, core::string_view{reinterpret_cast(data), size}}; ws.set_option(websocket::stream_base::decorator( [](websocket::response_type& res) From 8015b7a5e46b512b36c87a950d768e876cfaec23 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 13:59:36 -0600 Subject: [PATCH 07/10] Fix MSVC compilation errors in test/doc files by using boost::core::string_view The test/doc files are not inside the boost namespace, so they need the fully qualified boost::core::string_view instead of core::string_view. Changed back to boost::core::string_view in all affected test/doc files. --- example/doc/http_examples.hpp | 6 ++--- test/doc/core_1_refresher.cpp | 4 ++-- test/doc/core_snippets.cpp | 2 +- test/doc/exemplars.cpp | 12 +++++----- test/doc/http_10_custom_parser.cpp | 32 ++++++++++++------------- test/doc/http_examples.cpp | 4 ++-- test/doc/http_snippets.cpp | 2 +- test/doc/websocket_2_handshaking.cpp | 4 ++-- test/doc/websocket_5_control_frames.cpp | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/example/doc/http_examples.hpp b/example/doc/http_examples.hpp index 3bca1ef3d9..94398c334f 100644 --- a/example/doc/http_examples.hpp +++ b/example/doc/http_examples.hpp @@ -978,8 +978,8 @@ print_chunked_body( // Declare our chunk header callback This is invoked // after each chunk header and also after the last chunk. auto header_cb = - [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk - core::string_view extensions, // The raw chunk-extensions string. Already validated. + [&](std::uint64_t size, // Size of the chunk, or zero for the last chunk + core::string_view extensions, // The raw chunk-extensions string. Already validated. error_code& ev) // We can set this to indicate an error { // Parse the chunk extensions so we can access them easily @@ -1007,7 +1007,7 @@ print_chunked_body( // Declare the chunk body callback. This is called one or // more times for each piece of a chunk body. auto body_cb = - [&](std::uint64_t remain, // The number of bytes left in this chunk + [&](std::uint64_t remain, // The number of bytes left in this chunk core::string_view body, // A buffer holding chunk body data error_code& ec) // We can set this to indicate an error { diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 69fc960922..338b6409e4 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -33,13 +33,13 @@ snippets() { //[code_core_1_refresher_1s net::const_buffer cb("Hello, world!", 13); - assert(core::string_view(reinterpret_cast( + assert(boost::core::string_view(reinterpret_cast( cb.data()), cb.size()) == "Hello, world!"); char storage[13]; net::mutable_buffer mb(storage, sizeof(storage)); std::memcpy(mb.data(), cb.data(), mb.size()); - assert(core::string_view(reinterpret_cast( + assert(boost::core::string_view(reinterpret_cast( mb.data()), mb.size()) == "Hello, world!"); //] } diff --git a/test/doc/core_snippets.cpp b/test/doc/core_snippets.cpp index d46f5473e0..7214a959a0 100644 --- a/test/doc/core_snippets.cpp +++ b/test/doc/core_snippets.cpp @@ -68,7 +68,7 @@ net::connect(stream, r.resolve("www.example.com", "http")); //[snippet_core_3 template -void write_string(SyncWriteStream& stream, core::string_view s) +void write_string(SyncWriteStream& stream, boost::core::string_view s) { static_assert(is_sync_write_stream::value, "SyncWriteStream type requirements not met"); diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index 5f502cd0e6..b290229ae9 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -199,21 +199,21 @@ class Fields @note Only called for requests. */ - core::string_view + boost::core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - core::string_view + boost::core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - core::string_view + boost::core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -236,21 +236,21 @@ class Fields @note Only called for requests. */ void - set_method_impl(core::string_view s); + set_method_impl(boost::core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(core::string_view s); + set_target_impl(boost::core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(core::string_view s); + set_reason_impl(boost::core::string_view s); /** Sets or clears the chunked Transfer-Encoding value */ diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index 32119699d8..3e8b1a00cc 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -41,8 +41,8 @@ class custom_parser : public basic_parser void on_request_impl( verb method, // The method verb, verb::unknown if no match - core::string_view method_str, // The method as a string - core::string_view target, // The request-target + boost::core::string_view method_str, // The method as a string + boost::core::string_view target, // The request-target int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -67,7 +67,7 @@ class custom_parser : public basic_parser void on_response_impl( int code, // The status-code - core::string_view reason, // The obsolete reason-phrase + boost::core::string_view reason, // The obsolete reason-phrase int version, // The HTTP-version error_code& ec) override; // The error returned to the caller, if any @@ -90,8 +90,8 @@ class custom_parser : public basic_parser void on_field_impl( field f, // The known-field enumeration constant - core::string_view name, // The field name string. - core::string_view value, // The field value + boost::core::string_view name, // The field name string. + boost::core::string_view value, // The field value error_code& ec) override; // The error returned to the caller, if any /** Called once after the complete HTTP header is received. @@ -141,7 +141,7 @@ class custom_parser : public basic_parser */ std::size_t on_body_impl( - core::string_view s, // A portion of the body + boost::core::string_view s, // A portion of the body error_code& ec) override; // The error returned to the caller, if any /** Called each time a new chunk header of a chunk encoded body is received. @@ -161,7 +161,7 @@ class custom_parser : public basic_parser on_chunk_header_impl( std::uint64_t size, // The size of the upcoming chunk, // or zero for the last chunk - core::string_view extension, // The chunk extensions (may be empty) + boost::core::string_view extension, // The chunk extensions (may be empty) error_code& ec) override; // The error returned to the caller, if any /** Called each time additional data is received representing part of a body chunk. @@ -191,7 +191,7 @@ class custom_parser : public basic_parser std::uint64_t remain, // The number of bytes remaining in the chunk, // including what is being passed here. // or zero for the last chunk - core::string_view body, // The next piece of the chunk body + boost::core::string_view body, // The next piece of the chunk body error_code& ec) override; // The error returned to the caller, if any /** Called once when the complete message is received. @@ -216,8 +216,8 @@ class custom_parser : public basic_parser template void custom_parser:: -on_request_impl(verb method, core::string_view method_str, - core::string_view path, int version, error_code& ec) +on_request_impl(verb method, boost::core::string_view method_str, + boost::core::string_view path, int version, error_code& ec) { boost::ignore_unused(method, method_str, path, version); ec = {}; @@ -227,7 +227,7 @@ template void custom_parser:: on_response_impl( int status, - core::string_view reason, + boost::core::string_view reason, int version, error_code& ec) { @@ -239,8 +239,8 @@ template void custom_parser:: on_field_impl( field f, - core::string_view name, - core::string_view value, + boost::core::string_view name, + boost::core::string_view value, error_code& ec) { boost::ignore_unused(f, name, value); @@ -266,7 +266,7 @@ on_body_init_impl( template std::size_t custom_parser:: -on_body_impl(core::string_view body, error_code& ec) +on_body_impl(boost::core::string_view body, error_code& ec) { boost::ignore_unused(body); ec = {}; @@ -277,7 +277,7 @@ template void custom_parser:: on_chunk_header_impl( std::uint64_t size, - core::string_view extension, + boost::core::string_view extension, error_code& ec) { boost::ignore_unused(size, extension); @@ -288,7 +288,7 @@ template std::size_t custom_parser:: on_chunk_body_impl( std::uint64_t remain, - core::string_view body, + boost::core::string_view body, error_code& ec) { boost::ignore_unused(remain); diff --git a/test/doc/http_examples.cpp b/test/doc/http_examples.cpp index a8ffb565bf..c6dc0b8865 100644 --- a/test/doc/http_examples.cpp +++ b/test/doc/http_examples.cpp @@ -55,7 +55,7 @@ class examples_test template bool - equal_body(core::string_view sv, core::string_view body) + equal_body(boost::core::string_view sv, boost::core::string_view body) { test::stream ts{ioc_, sv}; message m; @@ -271,7 +271,7 @@ class examples_test doExplicitChunkSerialize() { auto const buf = - [](core::string_view s) + [](boost::core::string_view s) { return net::const_buffer{ s.data(), s.size()}; diff --git a/test/doc/http_snippets.cpp b/test/doc/http_snippets.cpp index 867f115573..3d53831792 100644 --- a/test/doc/http_snippets.cpp +++ b/test/doc/http_snippets.cpp @@ -251,7 +251,7 @@ void fxx() { //[http_snippet_23 // Manually emit a trailer. // We are responsible for ensuring that the trailer format adheres to the specification. - core::string_view ext = + boost::core::string_view ext = "Content-Digest: f4a5c16584f03d90\r\n" "\r\n"; net::write(sock, make_chunk_last(net::const_buffer{ext.data(), ext.size()})); diff --git a/test/doc/websocket_2_handshaking.cpp b/test/doc/websocket_2_handshaking.cpp index 0f2532507b..76670c5ae4 100644 --- a/test/doc/websocket_2_handshaking.cpp +++ b/test/doc/websocket_2_handshaking.cpp @@ -136,14 +136,14 @@ snippets() //[code_websocket_2_6 // a function to select the most preferred protocol from a comma-separated list - auto select_protocol = [](core::string_view offered_tokens) -> std::string + auto select_protocol = [](boost::core::string_view offered_tokens) -> std::string { // tokenize the Sec-Websocket-Protocol header offered by the client http::token_list offered( offered_tokens ); // an array of protocols supported by this server // in descending order of preference - static const std::array + static const std::array supported = {{ "v3.my.chat", "v2.my.chat", diff --git a/test/doc/websocket_5_control_frames.cpp b/test/doc/websocket_5_control_frames.cpp index 54c587b660..930795093c 100644 --- a/test/doc/websocket_5_control_frames.cpp +++ b/test/doc/websocket_5_control_frames.cpp @@ -33,7 +33,7 @@ snippets() //[code_websocket_5_1 ws.control_callback( - [](frame_type kind, core::string_view payload) + [](frame_type kind, boost::core::string_view payload) { // Do something with the payload boost::ignore_unused(kind, payload); From b05074bc841c92693784db8a3c1e98a85c1178d2 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Tue, 18 Nov 2025 14:40:33 -0600 Subject: [PATCH 08/10] Fix MSVC compilation errors in example files by using boost::core::string_view Example files are standalone programs not inside the boost namespace, so they require the fully qualified boost::core::string_view. Updated all example files except those in example/doc/ which are already inside the boost namespace. --- .../advanced_server_flex_awaitable.cpp | 30 +++++++++---------- .../server-flex/advanced_server_flex.cpp | 22 +++++++------- example/advanced/server/advanced_server.cpp | 22 +++++++------- .../client/methods/http_client_methods.cpp | 2 +- .../async-local/http_server_async_local.cpp | 22 +++++++------- .../async-ssl/http_server_async_ssl.cpp | 22 +++++++------- .../http/server/async/http_server_async.cpp | 22 +++++++------- .../awaitable/http_server_awaitable.cpp | 22 +++++++------- .../server/coro-ssl/http_server_coro_ssl.cpp | 22 +++++++------- example/http/server/coro/http_server_coro.cpp | 22 +++++++------- example/http/server/fast/http_server_fast.cpp | 10 +++---- example/http/server/flex/http_server_flex.cpp | 22 +++++++------- .../http_server_stackless_ssl.cpp | 22 +++++++------- .../stackless/http_server_stackless.cpp | 22 +++++++------- .../server/sync-ssl/http_server_sync_ssl.cpp | 22 +++++++------- example/http/server/sync/http_server_sync.cpp | 22 +++++++------- .../server/chat-multi/http_session.cpp | 22 +++++++------- 17 files changed, 175 insertions(+), 175 deletions(-) diff --git a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp index d4631da354..e5e5b31863 100644 --- a/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp +++ b/example/advanced/server-flex-awaitable/advanced_server_flex_awaitable.cpp @@ -42,15 +42,15 @@ using stream_type = typename beast::tcp_stream::rebind_executor using acceptor_type = typename net::ip::tcp::acceptor::rebind_executor::other; // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -81,8 +81,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -111,12 +111,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -129,7 +129,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -142,7 +142,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -161,7 +161,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file @@ -416,7 +416,7 @@ net::awaitable run_session( Stream& stream, beast::flat_buffer& buffer, - core::string_view doc_root) + boost::core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; @@ -457,7 +457,7 @@ net::awaitable detect_session( stream_type stream, ssl::context& ctx, - core::string_view doc_root) + boost::core::string_view doc_root) { beast::flat_buffer buffer; @@ -509,7 +509,7 @@ listen( task_group& task_group, ssl::context& ctx, net::ip::tcp::endpoint endpoint, - core::string_view doc_root) + boost::core::string_view doc_root) { auto cs = co_await net::this_coro::cancellation_state; auto executor = co_await net::this_coro::executor; @@ -600,7 +600,7 @@ main(int argc, char* argv[]) auto const address = net::ip::make_address(argv[1]); auto const port = static_cast(std::atoi(argv[2])); auto const endpoint = net::ip::tcp::endpoint{ address, port }; - auto const doc_root = core::string_view{ argv[3] }; + auto const doc_root = boost::core::string_view{ argv[3] }; auto const threads = std::max(1, std::atoi(argv[4])); // The io_context is required for all I/O diff --git a/example/advanced/server-flex/advanced_server_flex.cpp b/example/advanced/server-flex/advanced_server_flex.cpp index 9ab2f53bcf..6d078c610e 100644 --- a/example/advanced/server-flex/advanced_server_flex.cpp +++ b/example/advanced/server-flex/advanced_server_flex.cpp @@ -44,15 +44,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -83,8 +83,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -113,12 +113,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -131,7 +131,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -144,7 +144,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -163,7 +163,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/advanced/server/advanced_server.cpp b/example/advanced/server/advanced_server.cpp index f9c65f5590..6c3e6d8e5a 100644 --- a/example/advanced/server/advanced_server.cpp +++ b/example/advanced/server/advanced_server.cpp @@ -40,15 +40,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -79,8 +79,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -109,12 +109,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -127,7 +127,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -140,7 +140,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -159,7 +159,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/client/methods/http_client_methods.cpp b/example/http/client/methods/http_client_methods.cpp index 0d1b9ce0dc..7c11e9dfa3 100644 --- a/example/http/client/methods/http_client_methods.cpp +++ b/example/http/client/methods/http_client_methods.cpp @@ -147,7 +147,7 @@ int main(int argc, char** argv) for (char * c = argv[1]; *c != '\0'; c++) *c = static_cast(std::tolower(*c)); - core::string_view method{argv[1]}; + boost::core::string_view method{argv[1]}; // The io_context is required for all I/O net::io_context ioc; diff --git a/example/http/server/async-local/http_server_async_local.cpp b/example/http/server/async-local/http_server_async_local.cpp index 2fdc63b463..ffa2561c19 100644 --- a/example/http/server/async-local/http_server_async_local.cpp +++ b/example/http/server/async-local/http_server_async_local.cpp @@ -38,15 +38,15 @@ namespace net = boost::asio; // from using stream_protocol = net::local::stream_protocol; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -77,8 +77,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -107,12 +107,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -125,7 +125,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -138,7 +138,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -157,7 +157,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async-ssl/http_server_async_ssl.cpp b/example/http/server/async-ssl/http_server_async_ssl.cpp index e21f419f96..5409d0d202 100644 --- a/example/http/server/async-ssl/http_server_async_ssl.cpp +++ b/example/http/server/async-ssl/http_server_async_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/async/http_server_async.cpp b/example/http/server/async/http_server_async.cpp index 63e2c122c0..df99661ae2 100644 --- a/example/http/server/async/http_server_async.cpp +++ b/example/http/server/async/http_server_async.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/awaitable/http_server_awaitable.cpp b/example/http/server/awaitable/http_server_awaitable.cpp index fc9cb9c19c..fb531ef7e9 100644 --- a/example/http/server/awaitable/http_server_awaitable.cpp +++ b/example/http/server/awaitable/http_server_awaitable.cpp @@ -37,15 +37,15 @@ namespace http = beast::http; namespace net = boost::asio; // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro-ssl/http_server_coro_ssl.cpp b/example/http/server/coro-ssl/http_server_coro_ssl.cpp index 8b418f123d..28a3646e35 100644 --- a/example/http/server/coro-ssl/http_server_coro_ssl.cpp +++ b/example/http/server/coro-ssl/http_server_coro_ssl.cpp @@ -37,15 +37,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -76,8 +76,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -106,12 +106,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -124,7 +124,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -137,7 +137,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -156,7 +156,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/coro/http_server_coro.cpp b/example/http/server/coro/http_server_coro.cpp index 9ea834d7fb..a774fe9d58 100644 --- a/example/http/server/coro/http_server_coro.cpp +++ b/example/http/server/coro/http_server_coro.cpp @@ -34,15 +34,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -73,8 +73,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -103,12 +103,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -121,7 +121,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -153,7 +153,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/fast/http_server_fast.cpp b/example/http/server/fast/http_server_fast.cpp index 2b78e17a98..9f73734320 100644 --- a/example/http/server/fast/http_server_fast.cpp +++ b/example/http/server/fast/http_server_fast.cpp @@ -33,15 +33,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -230,7 +230,7 @@ class http_worker }); } - void send_file(core::string_view target) + void send_file(boost::core::string_view target) { // Request path must be absolute and not contain "..". if (target.empty() || target[0] != '/' || target.find("..") != std::string::npos) diff --git a/example/http/server/flex/http_server_flex.cpp b/example/http/server/flex/http_server_flex.cpp index ac57a19747..120bd31127 100644 --- a/example/http/server/flex/http_server_flex.cpp +++ b/example/http/server/flex/http_server_flex.cpp @@ -36,15 +36,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -75,8 +75,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -105,12 +105,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -123,7 +123,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -136,7 +136,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -155,7 +155,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp index 62595cf05f..018055933f 100644 --- a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp +++ b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp @@ -39,15 +39,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -78,8 +78,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -108,12 +108,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -126,7 +126,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -139,7 +139,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -158,7 +158,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/stackless/http_server_stackless.cpp b/example/http/server/stackless/http_server_stackless.cpp index c5d7d0bc76..89a6a0f943 100644 --- a/example/http/server/stackless/http_server_stackless.cpp +++ b/example/http/server/stackless/http_server_stackless.cpp @@ -35,15 +35,15 @@ namespace net = boost::asio; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync-ssl/http_server_sync_ssl.cpp b/example/http/server/sync-ssl/http_server_sync_ssl.cpp index a53ab39983..362bdc5c78 100644 --- a/example/http/server/sync-ssl/http_server_sync_ssl.cpp +++ b/example/http/server/sync-ssl/http_server_sync_ssl.cpp @@ -35,15 +35,15 @@ namespace ssl = boost::asio::ssl; // from using tcp = boost::asio::ip::tcp; // from // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -74,8 +74,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -104,12 +104,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -122,7 +122,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -135,7 +135,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -154,7 +154,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/http/server/sync/http_server_sync.cpp b/example/http/server/sync/http_server_sync.cpp index d800fbd36f..539d75ab3f 100644 --- a/example/http/server/sync/http_server_sync.cpp +++ b/example/http/server/sync/http_server_sync.cpp @@ -32,15 +32,15 @@ using tcp = boost::asio::ip::tcp; // from //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -71,8 +71,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if (base.empty()) return std::string(path); @@ -101,12 +101,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -119,7 +119,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -132,7 +132,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -151,7 +151,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file diff --git a/example/websocket/server/chat-multi/http_session.cpp b/example/websocket/server/chat-multi/http_session.cpp index 550b479193..b649724774 100644 --- a/example/websocket/server/chat-multi/http_session.cpp +++ b/example/websocket/server/chat-multi/http_session.cpp @@ -15,15 +15,15 @@ //------------------------------------------------------------------------------ // Return a reasonable mime type based on the extension of a file. -core::string_view -mime_type(core::string_view path) +boost::core::string_view +mime_type(boost::core::string_view path) { using beast::iequals; auto const ext = [&path] { auto const pos = path.rfind("."); - if(pos == core::string_view::npos) - return core::string_view{}; + if(pos == boost::core::string_view::npos) + return boost::core::string_view{}; return path.substr(pos); }(); if(iequals(ext, ".htm")) return "text/html"; @@ -54,8 +54,8 @@ mime_type(core::string_view path) // The returned path is normalized for the platform. std::string path_cat( - core::string_view base, - core::string_view path) + boost::core::string_view base, + boost::core::string_view path) { if(base.empty()) return std::string(path); @@ -84,12 +84,12 @@ path_cat( template http::message_generator handle_request( - core::string_view doc_root, + boost::core::string_view doc_root, http::request>&& req) { // Returns a bad request response auto const bad_request = - [&req](core::string_view why) + [&req](boost::core::string_view why) { http::response res{http::status::bad_request, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -102,7 +102,7 @@ handle_request( // Returns a not found response auto const not_found = - [&req](core::string_view target) + [&req](boost::core::string_view target) { http::response res{http::status::not_found, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -115,7 +115,7 @@ handle_request( // Returns a server error response auto const server_error = - [&req](core::string_view what) + [&req](boost::core::string_view what) { http::response res{http::status::internal_server_error, req.version()}; res.set(http::field::server, BOOST_BEAST_VERSION_STRING); @@ -134,7 +134,7 @@ handle_request( // Request path must be absolute and not contain "..". if( req.target().empty() || req.target()[0] != '/' || - req.target().find("..") != core::string_view::npos) + req.target().find("..") != boost::core::string_view::npos) return bad_request("Illegal request-target"); // Build the path to the requested file From 0f8c18f20cdef4e6645e774034ae00f82f39b912 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Wed, 19 Nov 2025 12:42:00 -0600 Subject: [PATCH 09/10] Remove unnecessary boost:: namespace prefix in .ipp files Remove boost:: prefix from core::string_view in implementation files (.ipp) where code is already inside the boost namespace. This makes the code cleaner and follows the project's namespace usage conventions. Also reverted unintended change to release notes as requested by maintainer. Signed-off-by: Samaresh Kumar Singh --- doc/qbk/release_notes.qbk | 2 +- .../beast/_experimental/test/impl/stream.ipp | 8 ++++---- .../core/detail/impl/temporary_buffer.ipp | 6 +++--- include/boost/beast/core/impl/string.ipp | 8 ++++---- .../boost/beast/http/detail/basic_parser.ipp | 12 +++++------ include/boost/beast/http/detail/rfc7230.ipp | 8 ++++---- .../boost/beast/http/impl/basic_parser.ipp | 20 +++++++++---------- include/boost/beast/http/impl/field.ipp | 14 ++++++------- include/boost/beast/http/impl/fields.ipp | 6 +++--- include/boost/beast/http/impl/rfc7230.ipp | 16 +++++++-------- include/boost/beast/http/impl/status.ipp | 2 +- include/boost/beast/http/impl/verb.ipp | 4 ++-- .../boost/beast/websocket/detail/hybi13.ipp | 2 +- .../beast/websocket/detail/pmd_extension.ipp | 2 +- 14 files changed, 55 insertions(+), 55 deletions(-) diff --git a/doc/qbk/release_notes.qbk b/doc/qbk/release_notes.qbk index 6cbca33a0b..0f371575fe 100644 --- a/doc/qbk/release_notes.qbk +++ b/doc/qbk/release_notes.qbk @@ -258,7 +258,7 @@ [*Miscellaneous] * [issue 2363] Remove `BOOST_BEAST_USE_STD_STRING_VIEW` -* [issue 2417] use boost::core::string_view. This improves inter-conversion between core::string_view implementations. Some observable differences for users: +* [issue 2417] use boost::core::string_view. This improves inter-conversion between string_view implementations. Some observable differences for users: * `core::string_view` no longer supports the `.to_string()` or `.clear()` extensions from Utility * code that relied on `.max_size()` returning `.size(),` needs to be fixed to use `.size()` instead * `remove_suffix()` and `remove_prefix()` were more lenient than the standard specs; be sure you don't rely on it clamping the argument to valid range diff --git a/include/boost/beast/_experimental/test/impl/stream.ipp b/include/boost/beast/_experimental/test/impl/stream.ipp index 4b1cd715b5..790c17df07 100644 --- a/include/boost/beast/_experimental/test/impl/stream.ipp +++ b/include/boost/beast/_experimental/test/impl/stream.ipp @@ -123,7 +123,7 @@ template basic_stream:: basic_stream( net::io_context& ioc, - boost::core::string_view s) + core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), nullptr)) { in_->b.commit(net::buffer_copy( @@ -136,7 +136,7 @@ basic_stream:: basic_stream( net::io_context& ioc, fail_count& fc, - boost::core::string_view s) + core::string_view s) : in_(detail::stream_service::make_impl(ioc.get_executor(), &fc)) { in_->b.commit(net::buffer_copy( @@ -161,7 +161,7 @@ connect(basic_stream& remote) } template -boost::core::string_view +core::string_view basic_stream:: str() const { @@ -175,7 +175,7 @@ str() const template void basic_stream:: -append(boost::core::string_view s) +append(core::string_view s) { std::lock_guard lock{in_->m}; in_->b.commit(net::buffer_copy( diff --git a/include/boost/beast/core/detail/impl/temporary_buffer.ipp b/include/boost/beast/core/detail/impl/temporary_buffer.ipp index 46ee97e6a5..9ea06be1a5 100644 --- a/include/boost/beast/core/detail/impl/temporary_buffer.ipp +++ b/include/boost/beast/core/detail/impl/temporary_buffer.ipp @@ -23,7 +23,7 @@ namespace detail { void temporary_buffer:: -append(boost::core::string_view s) +append(core::string_view s) { grow(s.size()); unchecked_append(s); @@ -31,7 +31,7 @@ append(boost::core::string_view s) void temporary_buffer:: -append(boost::core::string_view s1, boost::core::string_view s2) +append(core::string_view s1, core::string_view s2) { grow(s1.size() + s2.size()); unchecked_append(s1); @@ -40,7 +40,7 @@ append(boost::core::string_view s1, boost::core::string_view s2) void temporary_buffer:: -unchecked_append(boost::core::string_view s) +unchecked_append(core::string_view s) { auto n = s.size(); std::memcpy(&data_[size_], s.data(), n); diff --git a/include/boost/beast/core/impl/string.ipp b/include/boost/beast/core/impl/string.ipp index 4f3c53d9cb..3652f89a13 100644 --- a/include/boost/beast/core/impl/string.ipp +++ b/include/boost/beast/core/impl/string.ipp @@ -20,8 +20,8 @@ namespace beast { bool iequals( - boost::core::string_view lhs, - boost::core::string_view rhs) + core::string_view lhs, + core::string_view rhs) { if(lhs.size() != rhs.size()) return false; @@ -50,8 +50,8 @@ slow: bool iless::operator()( - boost::core::string_view lhs, - boost::core::string_view rhs) const + core::string_view lhs, + core::string_view rhs) const { using std::begin; using std::end; diff --git a/include/boost/beast/http/detail/basic_parser.ipp b/include/boost/beast/http/detail/basic_parser.ipp index e725b820f8..105468d1e0 100644 --- a/include/boost/beast/http/detail/basic_parser.ipp +++ b/include/boost/beast/http/detail/basic_parser.ipp @@ -155,7 +155,7 @@ find_eol( bool basic_parser_base:: parse_dec( - boost::core::string_view s, + core::string_view s, std::uint64_t& v) { char const* it = s.data(); @@ -271,7 +271,7 @@ void basic_parser_base:: parse_method( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { // parse token SP auto const first = it; @@ -308,7 +308,7 @@ void basic_parser_base:: parse_target( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { // parse target SP auto const first = it; @@ -437,7 +437,7 @@ void basic_parser_base:: parse_reason( char const*& it, char const* last, - boost::core::string_view& result, error_code& ec) + core::string_view& result, error_code& ec) { auto const first = it; char const* token_last = nullptr; @@ -459,8 +459,8 @@ basic_parser_base:: parse_field( char const*& p, char const* last, - boost::core::string_view& name, - boost::core::string_view& value, + core::string_view& name, + core::string_view& value, beast::detail::char_buffer& buf, error_code& ec) { diff --git a/include/boost/beast/http/detail/rfc7230.ipp b/include/boost/beast/http/detail/rfc7230.ipp index b5d0ff1add..144e1883b3 100644 --- a/include/boost/beast/http/detail/rfc7230.ipp +++ b/include/boost/beast/http/detail/rfc7230.ipp @@ -239,8 +239,8 @@ skip_token(ForwardIt& it, ForwardIt last) ++it; } -boost::core::string_view -trim(boost::core::string_view s) +core::string_view +trim(core::string_view s) { auto first = s.begin(); auto last = s.end(); @@ -344,7 +344,7 @@ increment() bool opt_token_list_policy::operator()(value_type& v, - char const*& it, boost::core::string_view s) const + char const*& it, core::string_view s) const { v = {}; auto need_comma = it != s.data(); @@ -370,7 +370,7 @@ opt_token_list_policy::operator()(value_type& v, if(! detail::is_token_char(*it)) break; } - v = boost::core::string_view{p0, + v = core::string_view{p0, static_cast(it - p0)}; return true; } diff --git a/include/boost/beast/http/impl/basic_parser.ipp b/include/boost/beast/http/impl/basic_parser.ipp index cadfa59b26..6d918aba82 100644 --- a/include/boost/beast/http/impl/basic_parser.ipp +++ b/include/boost/beast/http/impl/basic_parser.ipp @@ -236,12 +236,12 @@ inner_parse_start_line( */ auto p = in; - boost::core::string_view method; + core::string_view method; parse_method(p, last, method, ec); if(ec) return; - boost::core::string_view target; + core::string_view target; parse_target(p, last, target, ec); if(ec) return; @@ -321,7 +321,7 @@ inner_parse_start_line( return; // parse reason CRLF - boost::core::string_view reason; + core::string_view reason; parse_reason(p, last, reason, ec); if(ec) return; @@ -361,8 +361,8 @@ basic_parser:: inner_parse_fields(char const*& in, char const* last, error_code& ec) { - boost::core::string_view name; - boost::core::string_view value; + core::string_view name; + core::string_view value; // https://stackoverflow.com/questions/686217/maximum-on-http-header-values beast::detail::char_buffer buf; auto p = in; @@ -533,7 +533,7 @@ parse_body(char const*& p, std::size_t n, error_code& ec) { ec = {}; - n = this->on_body_impl(boost::core::string_view{p, + n = this->on_body_impl(core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -561,7 +561,7 @@ parse_body_to_eof(char const*& p, *body_limit_ -= n; } ec = {}; - n = this->on_body_impl(boost::core::string_view{p, n}, ec); + n = this->on_body_impl(core::string_view{p, n}, ec); p += n; if(ec) return; @@ -666,7 +666,7 @@ parse_chunk_body(char const*& p, { ec = {}; n = this->on_chunk_body_impl( - len_, boost::core::string_view{p, + len_, core::string_view{p, beast::detail::clamp(len_, n)}, ec); p += n; len_ -= n; @@ -678,7 +678,7 @@ template void basic_parser:: do_field(field f, - boost::core::string_view value, error_code& ec) + core::string_view value, error_code& ec) { using namespace beast::detail::string_literals; // Connection @@ -790,7 +790,7 @@ do_field(field f, ec = {}; auto const v = token_list{value}; auto const p = std::find_if(v.begin(), v.end(), - [&](boost::core::string_view const& s) + [&](core::string_view const& s) { return beast::iequals("chunked"_sv, s); }); diff --git a/include/boost/beast/http/impl/field.ipp b/include/boost/beast/http/impl/field.ipp index bedd355534..fc1089c6a3 100644 --- a/include/boost/beast/http/impl/field.ipp +++ b/include/boost/beast/http/impl/field.ipp @@ -42,12 +42,12 @@ struct field_table } using array_type = - std::array; + std::array; // Strings are converted to lowercase static std::uint32_t - digest(boost::core::string_view s) + digest(core::string_view s) { std::uint32_t r = 0; std::size_t n = s.size(); @@ -77,7 +77,7 @@ struct field_table // strings must contain only valid http field characters. static bool - equals(boost::core::string_view lhs, boost::core::string_view rhs) + equals(core::string_view lhs, core::string_view rhs) { using Int = std::uint32_t; // VFALCO std::size_t? auto n = lhs.size(); @@ -257,7 +257,7 @@ struct field_table } field - string_to_field(boost::core::string_view s) const + string_to_field(core::string_view s) const { auto h = digest(s); auto j = h % N; @@ -302,7 +302,7 @@ get_field_table() } BOOST_BEAST_DECL -boost::core::string_view +core::string_view to_string(field f) { auto const& v = get_field_table(); @@ -312,14 +312,14 @@ to_string(field f) } // detail -boost::core::string_view +core::string_view to_string(field f) { return detail::to_string(f); } field -string_to_field(boost::core::string_view s) +string_to_field(core::string_view s) { return detail::get_field_table().string_to_field(s); } diff --git a/include/boost/beast/http/impl/fields.ipp b/include/boost/beast/http/impl/fields.ipp index d8c651b8da..8450b90576 100644 --- a/include/boost/beast/http/impl/fields.ipp +++ b/include/boost/beast/http/impl/fields.ipp @@ -29,7 +29,7 @@ inline void filter_token_list( beast::detail::temporary_buffer& s, - boost::core::string_view value, + core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -53,7 +53,7 @@ filter_token_list( void filter_token_list_last( beast::detail::temporary_buffer& s, - boost::core::string_view value, + core::string_view value, iequals_predicate const& pred) { token_list te{value}; @@ -87,7 +87,7 @@ filter_token_list_last( void keep_alive_impl( - beast::detail::temporary_buffer& s, boost::core::string_view value, + beast::detail::temporary_buffer& s, core::string_view value, unsigned version, bool keep_alive) { if(version < 11) diff --git a/include/boost/beast/http/impl/rfc7230.ipp b/include/boost/beast/http/impl/rfc7230.ipp index 937ee00ac8..a060ece23d 100644 --- a/include/boost/beast/http/impl/rfc7230.ipp +++ b/include/boost/beast/http/impl/rfc7230.ipp @@ -19,7 +19,7 @@ namespace http { void param_list::const_iterator:: -unquote(boost::core::string_view sr, std::string &s) +unquote(core::string_view sr, std::string &s) { s.clear(); s.reserve(sr.size()); @@ -49,7 +49,7 @@ increment() pi_.v.second.front() == '"') { unquote(pi_.v.second, s_); - pi_.v.second = boost::core::string_view{ + pi_.v.second = core::string_view{ s_.data(), s_.size()}; } } @@ -96,7 +96,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_.first = boost::core::string_view{&*p0, + v_.first = core::string_view{&*p0, static_cast(it_ - p0)}; if (it_ == last_) return; @@ -110,7 +110,7 @@ increment() if(pi.empty()) break; } - v_.second = param_list{boost::core::string_view{&*it_, + v_.second = param_list{core::string_view{&*it_, static_cast(pi.it - it_)}}; it_ = pi.it; return; @@ -124,7 +124,7 @@ increment() auto ext_list:: -find(boost::core::string_view const& s) -> const_iterator +find(core::string_view const& s) -> const_iterator { return std::find_if(begin(), end(), [&s](value_type const& v) @@ -135,7 +135,7 @@ find(boost::core::string_view const& s) -> const_iterator bool ext_list:: -exists(boost::core::string_view const& s) +exists(core::string_view const& s) { return find(s) != end(); } @@ -175,7 +175,7 @@ increment() if(! detail::is_token_char(*it_)) break; } - v_ = boost::core::string_view{&*p0, + v_ = core::string_view{&*p0, static_cast(it_ - p0)}; return; } @@ -188,7 +188,7 @@ increment() bool token_list:: -exists(boost::core::string_view const& s) +exists(core::string_view const& s) { return std::find_if(begin(), end(), [&s](value_type const& v) diff --git a/include/boost/beast/http/impl/status.ipp b/include/boost/beast/http/impl/status.ipp index 351368fa0d..7071f198f2 100644 --- a/include/boost/beast/http/impl/status.ipp +++ b/include/boost/beast/http/impl/status.ipp @@ -127,7 +127,7 @@ to_status_class(status v) return to_status_class(static_cast(v)); } -boost::core::string_view +core::string_view obsolete_reason(status v) { switch(static_cast(v)) diff --git a/include/boost/beast/http/impl/verb.ipp b/include/boost/beast/http/impl/verb.ipp index 1815a322b8..24017da411 100644 --- a/include/boost/beast/http/impl/verb.ipp +++ b/include/boost/beast/http/impl/verb.ipp @@ -18,7 +18,7 @@ namespace boost { namespace beast { namespace http { -boost::core::string_view +core::string_view to_string(verb v) { using namespace beast::detail::string_literals; @@ -72,7 +72,7 @@ to_string(verb v) } verb -string_to_verb(boost::core::string_view v) +string_to_verb(core::string_view v) { /* ACL diff --git a/include/boost/beast/websocket/detail/hybi13.ipp b/include/boost/beast/websocket/detail/hybi13.ipp index 8c6c6b3e0d..dcf7ded705 100644 --- a/include/boost/beast/websocket/detail/hybi13.ipp +++ b/include/boost/beast/websocket/detail/hybi13.ipp @@ -38,7 +38,7 @@ make_sec_ws_key(sec_ws_key_type& key) void make_sec_ws_accept( sec_ws_accept_type& accept, - boost::core::string_view key) + core::string_view key) { BOOST_ASSERT(key.size() <= sec_ws_key_type::static_capacity); using namespace beast::detail::string_literals; diff --git a/include/boost/beast/websocket/detail/pmd_extension.ipp b/include/boost/beast/websocket/detail/pmd_extension.ipp index 3162e8b76f..b86455209e 100644 --- a/include/boost/beast/websocket/detail/pmd_extension.ipp +++ b/include/boost/beast/websocket/detail/pmd_extension.ipp @@ -18,7 +18,7 @@ namespace websocket { namespace detail { int -parse_bits(boost::core::string_view s) +parse_bits(core::string_view s) { if(s.size() == 0) return -1; From 7188b56256315f29b79015710a14db902cff3216 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Thu, 20 Nov 2025 11:58:42 -0600 Subject: [PATCH 10/10] removed the boost namespace from test/doc as per code review comment --- test/doc/core_1_refresher.cpp | 4 ++-- test/doc/exemplars.cpp | 12 ++++++------ test/doc/http_10_custom_parser.cpp | 10 +++++----- test/doc/http_examples.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/doc/core_1_refresher.cpp b/test/doc/core_1_refresher.cpp index 338b6409e4..69fc960922 100644 --- a/test/doc/core_1_refresher.cpp +++ b/test/doc/core_1_refresher.cpp @@ -33,13 +33,13 @@ snippets() { //[code_core_1_refresher_1s net::const_buffer cb("Hello, world!", 13); - assert(boost::core::string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( cb.data()), cb.size()) == "Hello, world!"); char storage[13]; net::mutable_buffer mb(storage, sizeof(storage)); std::memcpy(mb.data(), cb.data(), mb.size()); - assert(boost::core::string_view(reinterpret_cast( + assert(core::string_view(reinterpret_cast( mb.data()), mb.size()) == "Hello, world!"); //] } diff --git a/test/doc/exemplars.cpp b/test/doc/exemplars.cpp index b290229ae9..5f502cd0e6 100644 --- a/test/doc/exemplars.cpp +++ b/test/doc/exemplars.cpp @@ -199,21 +199,21 @@ class Fields @note Only called for requests. */ - boost::core::string_view + core::string_view get_method_impl() const; /** Returns the request-target string. @note Only called for requests. */ - boost::core::string_view + core::string_view get_target_impl() const; /** Returns the response reason-phrase string. @note Only called for responses. */ - boost::core::string_view + core::string_view get_reason_impl() const; /** Returns the chunked Transfer-Encoding setting @@ -236,21 +236,21 @@ class Fields @note Only called for requests. */ void - set_method_impl(boost::core::string_view s); + set_method_impl(core::string_view s); /** Set or clear the target string. @note Only called for requests. */ void - set_target_impl(boost::core::string_view s); + set_target_impl(core::string_view s); /** Set or clear the reason string. @note Only called for responses. */ void - set_reason_impl(boost::core::string_view s); + set_reason_impl(core::string_view s); /** Sets or clears the chunked Transfer-Encoding value */ diff --git a/test/doc/http_10_custom_parser.cpp b/test/doc/http_10_custom_parser.cpp index 3e8b1a00cc..6db27230f2 100644 --- a/test/doc/http_10_custom_parser.cpp +++ b/test/doc/http_10_custom_parser.cpp @@ -40,11 +40,11 @@ class custom_parser : public basic_parser */ void on_request_impl( - verb method, // The method verb, verb::unknown if no match - boost::core::string_view method_str, // The method as a string - boost::core::string_view target, // The request-target - int version, // The HTTP-version - error_code& ec) override; // The error returned to the caller, if any + verb method, // The method verb, verb::unknown if no match + core::string_view method_str, // The method as a string + core::string_view target, // The request-target + int version, // The HTTP-version + error_code& ec) override; // The error returned to the caller, if any /** Called after receiving the status-line. diff --git a/test/doc/http_examples.cpp b/test/doc/http_examples.cpp index c6dc0b8865..a8ffb565bf 100644 --- a/test/doc/http_examples.cpp +++ b/test/doc/http_examples.cpp @@ -55,7 +55,7 @@ class examples_test template bool - equal_body(boost::core::string_view sv, boost::core::string_view body) + equal_body(core::string_view sv, core::string_view body) { test::stream ts{ioc_, sv}; message m; @@ -271,7 +271,7 @@ class examples_test doExplicitChunkSerialize() { auto const buf = - [](boost::core::string_view s) + [](core::string_view s) { return net::const_buffer{ s.data(), s.size()};