Rename to http::dynamic_body, consolidate header:

fix #284

* streambuf_body is renamed to dynamic_body
* basic_dynabuf_body is renamed to basic_dynamic_body
This commit is contained in:
Vinnie Falco
2017-05-05 21:00:56 -07:00
parent 45a2d73993
commit 21ef97d220
17 changed files with 40 additions and 73 deletions
+1 -1
View File
@@ -12,6 +12,7 @@
#include <beast/http/basic_parser.hpp>
#include <beast/http/chunk_encode.hpp>
#include <beast/http/dynamic_body.hpp>
#include <beast/http/error.hpp>
#include <beast/http/fields.hpp>
#include <beast/http/header_parser.hpp>
@@ -21,7 +22,6 @@
#include <beast/http/read.hpp>
#include <beast/http/reason.hpp>
#include <beast/http/rfc7230.hpp>
#include <beast/http/streambuf_body.hpp>
#include <beast/http/string_body.hpp>
#include <beast/http/write.hpp>
@@ -5,14 +5,13 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef BEAST_HTTP_BASIC_DYNABUF_BODY_HPP
#define BEAST_HTTP_BASIC_DYNABUF_BODY_HPP
#ifndef BEAST_HTTP_DYNAMIC_BODY_HPP
#define BEAST_HTTP_DYNAMIC_BODY_HPP
#include <beast/config.hpp>
#include <beast/core/error.hpp>
#include <beast/core/streambuf.hpp>
#include <beast/http/message.hpp>
#include <beast/core/detail/type_traits.hpp>
#include <boost/asio/buffer.hpp>
namespace beast {
namespace http {
@@ -22,7 +21,7 @@ namespace http {
Meets the requirements of @b `Body`.
*/
template<class DynamicBuffer>
struct basic_dynabuf_body
struct basic_dynamic_body
{
/// The type of the `message::body` member
using value_type = DynamicBuffer;
@@ -44,7 +43,7 @@ private:
template<bool isRequest, class Fields>
explicit
reader(message<isRequest,
basic_dynabuf_body, Fields>& msg)
basic_dynamic_body, Fields>& msg)
: body_(msg.body)
{
}
@@ -85,7 +84,7 @@ private:
template<bool isRequest, class Fields>
explicit
writer(message<
isRequest, basic_dynabuf_body, Fields> const& m) noexcept
isRequest, basic_dynamic_body, Fields> const& m) noexcept
: body_(m.body)
{
}
@@ -112,6 +111,12 @@ private:
};
};
/** A dynamic message body represented by a @ref streambuf
Meets the requirements of @b `Body`.
*/
using dynamic_body = basic_dynamic_body<streambuf>;
} // http
} // beast
-27
View File
@@ -1,27 +0,0 @@
//
// Copyright (c) 2013-2017 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)
//
#ifndef BEAST_HTTP_STREAMBUF_BODY_HPP
#define BEAST_HTTP_STREAMBUF_BODY_HPP
#include <beast/config.hpp>
#include <beast/http/basic_dynabuf_body.hpp>
#include <beast/core/streambuf.hpp>
namespace beast {
namespace http {
/** A message body represented by a @ref streambuf
Meets the requirements of @b `Body`.
*/
using streambuf_body = basic_dynabuf_body<streambuf>;
} // http
} // beast
#endif
@@ -11,7 +11,6 @@
#include <beast/websocket/detail/type_traits.hpp>
#include <beast/http/message.hpp>
#include <beast/http/read.hpp>
#include <beast/http/streambuf_body.hpp>
#include <beast/http/write.hpp>
#include <beast/core/handler_helpers.hpp>
#include <beast/core/handler_ptr.hpp>