Remove dynamic_buffer_ref:

* dynamic_buffer_ref is removed, because Asio / Networking
  has introduced the DynamicBuffer_v2 concept which is incompatible
  with Beast's storage types.

The next version of Beast (1.70) will provide changes to
interoperate with Asio / Networking's new concepts.
This commit is contained in:
Vinnie Falco committed 2019-03-07 12:56:40 -08:00
1 parent f4e2a327c8
commit fdf64a4550
10 files changed
+1 -243

No files matched your search

-1
View File
@@ -44,7 +44,6 @@ add_executable (tests-beast-core
buffers_suffix.cpp
buffers_to_string.cpp
detect_ssl.cpp
dynamic_buffer_ref.cpp
error.cpp
file.cpp
file_base.cpp
-1
View File
@@ -32,7 +32,6 @@ local SOURCES =
buffers_suffix.cpp
buffers_to_string.cpp
detect_ssl.cpp
dynamic_buffer_ref.cpp
error.cpp
file.cpp
file_base.cpp
-73
View File
@@ -1,73 +0,0 @@
//
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/beast
//
// Test that header file is self-contained.
#include <boost/beast/core/dynamic_buffer_ref.hpp>
#include <boost/beast/_experimental/unit_test/suite.hpp>
#include <boost/beast/_experimental/test/stream.hpp>
#include <boost/beast/core/flat_buffer.hpp>
#include <boost/asio/read_until.hpp>
namespace boost {
namespace beast {
namespace {
template <class SyncReadStream>
std::size_t read_line (SyncReadStream& stream, flat_buffer& buffer)
{
return net::read_until(stream, dynamic_buffer_ref(buffer), "\r\n");
}
} // (anon)
class dynamic_buffer_ref_test : public beast::unit_test::suite
{
public:
void
testJavadocs()
{
BEAST_EXPECT(static_cast<
std::size_t(*)(test::stream&, flat_buffer&)>(
&read_line<test::stream>));
}
void
testBuffer()
{
flat_buffer b;
b.max_size(1000);
auto db = dynamic_buffer_ref(b);
BEAST_EXPECT(db.max_size() == 1000);
BEAST_EXPECT(db.size() == 0);
BEAST_EXPECT(db.capacity() == 0);
db.prepare(512);
BEAST_EXPECT(db.size() == 0);
BEAST_EXPECT(db.capacity() == 512);
db.commit(12);
BEAST_EXPECT(db.size() == 12);
BEAST_EXPECT(db.capacity() == 512);
BEAST_EXPECT(buffer_bytes(db.data()) == 12);
db.consume(12);
BEAST_EXPECT(db.size() == 0);
BEAST_EXPECT(db.capacity() == 512);
}
void run() override
{
testJavadocs();
testBuffer();
}
};
BEAST_DEFINE_TESTSUITE(beast,core,dynamic_buffer_ref);
} // beast
} // boost