Refactor type_traits (API Change):

fix #373

* concepts.hpp is renamed to type_traits.hpp

* Body reader and writer concepts are renamed
This commit is contained in:
Vinnie Falco
2017-05-28 16:00:05 -07:00
parent 8578419433
commit c29451a8dd
32 changed files with 435 additions and 462 deletions
+1 -1
View File
@@ -12,7 +12,6 @@ add_executable (http-tests
../../extras/beast/unit_test/main.cpp
basic_parser.cpp
buffer_body.cpp
concepts.cpp
design.cpp
dynamic_body.cpp
empty_body.cpp
@@ -24,6 +23,7 @@ add_executable (http-tests
read.cpp
rfc7230.cpp
string_body.cpp
type_traits.cpp
write.cpp
)
+4 -4
View File
@@ -203,7 +203,7 @@ public:
{
using value_type = std::string;
class reader
class writer
{
value_type& body_;
std::size_t len_ = 0;
@@ -216,7 +216,7 @@ public:
template<bool isRequest, class Fields>
explicit
reader(message<isRequest, direct_body, Fields>& m)
writer(message<isRequest, direct_body, Fields>& m)
: body_(m.body)
{
}
@@ -315,7 +315,7 @@ public:
{
using value_type = std::string;
class reader
class writer
{
value_type& body_;
@@ -327,7 +327,7 @@ public:
template<bool isRequest, class Fields>
explicit
reader(message<isRequest, indirect_body, Fields>& m)
writer(message<isRequest, indirect_body, Fields>& m)
: body_(m.body)
{
}
@@ -6,16 +6,16 @@
//
// Test that header file is self-contained.
#include <beast/http/concepts.hpp>
#include <beast/http/type_traits.hpp>
#include <beast/http/empty_body.hpp>
namespace beast {
namespace http {
BOOST_STATIC_ASSERT(! is_Writer<int>::value);
BOOST_STATIC_ASSERT(! is_body_reader<int>::value);
BOOST_STATIC_ASSERT(is_Writer<empty_body>::value);
BOOST_STATIC_ASSERT(is_body_reader<empty_body>::value);
} // http
} // beast
+8 -8
View File
@@ -37,7 +37,7 @@ public:
{
using value_type = std::string;
class writer
class reader
{
value_type const& body_;
@@ -49,7 +49,7 @@ public:
template<bool isRequest, class Allocator>
explicit
writer(message<isRequest, unsized_body, Allocator> const& msg)
reader(message<isRequest, unsized_body, Allocator> const& msg)
: body_(msg.body)
{
}
@@ -82,7 +82,7 @@ public:
bool mutable read = false;
};
class writer
class reader
{
int step_ = 0;
value_type const& body_;
@@ -96,7 +96,7 @@ public:
template<bool isRequest, class Fields>
explicit
writer(message<isRequest, test_body,
reader(message<isRequest, test_body,
Fields> const& msg)
: body_(msg.body)
{
@@ -196,11 +196,11 @@ public:
struct fail_body
{
class writer;
class reader;
class value_type
{
friend class writer;
friend class reader;
std::string s_;
test::fail_counter& fc_;
@@ -220,7 +220,7 @@ public:
}
};
class writer
class reader
{
std::size_t n_ = 0;
value_type const& body_;
@@ -233,7 +233,7 @@ public:
template<bool isRequest, class Allocator>
explicit
writer(message<isRequest, fail_body, Allocator> const& msg)
reader(message<isRequest, fail_body, Allocator> const& msg)
: body_(msg.body)
{
}