Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/bin64
/_build*
temp
/build/CMakeCache.txt
/build/CMakeFiles/
/build/DartConfiguration.tcl

# Emacs
*#
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cpp:boost::http_proto::file_source[file_source]

cpp:boost::http_proto::header_limits[header_limits]

cpp:boost::http_proto::message_base[message_base]
cpp:boost::http_proto::header[header]

cpp:boost::http_proto::metadata[metadata]

Expand Down
2 changes: 1 addition & 1 deletion include/boost/http_proto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <boost/http_proto/file_sink.hpp>
#include <boost/http_proto/file_source.hpp>
#include <boost/http_proto/header_limits.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>
#include <boost/http_proto/method.hpp>
#include <boost/http_proto/parser.hpp>
#include <boost/http_proto/request.hpp>
Expand Down
2 changes: 1 addition & 1 deletion include/boost/http_proto/fields_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class fields_base
};

friend class fields;
friend class message_base;
friend class header;
friend class request_base;
friend class request;
friend class static_request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// Official repository: https://github.com/cppalliance/http_proto
//

#ifndef BOOST_HTTP_PROTO_MESSAGE_BASE_HPP
#define BOOST_HTTP_PROTO_MESSAGE_BASE_HPP
#ifndef BOOST_HTTP_PROTO_HEADER_HPP
#define BOOST_HTTP_PROTO_HEADER_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/fields_base.hpp>
Expand All @@ -19,7 +19,7 @@ namespace boost {
namespace http_proto {

/** Mixin for modifing common metadata
in HTTP request and response messages.
in HTTP request and response headers.

This type is useful for modifying common
properties shared by both requests
Expand All @@ -32,7 +32,7 @@ namespace http_proto {
@ref static_request,
@ref metadata.
*/
class message_base
class header
: public fields_base
{
friend class request_base;
Expand Down
12 changes: 6 additions & 6 deletions include/boost/http_proto/impl/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ template<
void
serializer::
start(
message_base const& m,
header const& h,
ConstBufferSequence&& cbs)
{
static_assert(buffers::is_const_buffer_sequence<
ConstBufferSequence>::value,
"ConstBufferSequence type requirements not met");

start_init(m);
start_init(h);
start_buffers(
m,
h,
ws().emplace<cbs_gen_impl<typename
std::decay<ConstBufferSequence>::type>>(
std::forward<ConstBufferSequence>(cbs)));
Expand All @@ -139,7 +139,7 @@ template<
Source&
serializer::
start(
message_base const& m,
header const& h,
Args&&... args)
{
static_assert(
Expand All @@ -149,10 +149,10 @@ start(
std::is_constructible<Source, detail::workspace&, Args...>::value,
"The Source cannot be constructed with the given arguments");

start_init(m);
start_init(h);
auto& source = ws().emplace<Source>(
std::forward<Args>(args)...);
start_source(m, source);
start_source(h, source);
return source;
}

Expand Down
12 changes: 6 additions & 6 deletions include/boost/http_proto/request_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@
#define BOOST_HTTP_PROTO_REQUEST_BASE_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>

namespace boost {
namespace http_proto {

/** Mixin for modifing HTTP requests.

@see
@ref message_base,
@ref header,
@ref request,
@ref static_request.
*/
class request_base
: public message_base
: public header
{
friend class request;
friend class static_request;

request_base() noexcept
: message_base(detail::kind::request)
: header(detail::kind::request)
{
}

explicit
request_base(core::string_view s)
: message_base(detail::kind::request, s)
: header(detail::kind::request, s)
{
}

request_base(
void* storage,
std::size_t cap) noexcept
: message_base(
: header(
detail::kind::request, storage, cap)
{
}
Expand Down
12 changes: 6 additions & 6 deletions include/boost/http_proto/response_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define BOOST_HTTP_PROTO_RESPONSE_BASE_HPP

#include <boost/http_proto/detail/config.hpp>
#include <boost/http_proto/message_base.hpp>
#include <boost/http_proto/header.hpp>
#include <boost/http_proto/status.hpp>

namespace boost {
Expand All @@ -22,31 +22,31 @@ namespace http_proto {
/** Mixin for modifing HTTP responses.

@see
@ref message_base,
@ref header,
@ref response,
@ref static_response.
*/
class response_base
: public message_base
: public header
{
friend class response;
friend class static_response;

response_base() noexcept
: message_base(detail::kind::response)
: header(detail::kind::response)
{
}

explicit
response_base(core::string_view s)
: message_base(detail::kind::response, s)
: header(detail::kind::response, s)
{
}

response_base(
void* storage,
std::size_t cap) noexcept
: message_base(
: header(
detail::kind::response, storage, cap)
{
}
Expand Down
40 changes: 20 additions & 20 deletions include/boost/http_proto/serializer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace boost {
namespace http_proto {

// Forward declaration
class message_base;
class header;

/** A serializer for HTTP/1 messages

Expand Down Expand Up @@ -161,7 +161,7 @@ class serializer
/** Prepare the serializer for a new message without a body.

Initializes the serializer with the HTTP
start-line and headers from `m`, and
start-line and headers from `h`, and
without a body.

@par Preconditions
Expand All @@ -187,20 +187,20 @@ class serializer
insufficient internal buffer space to
start the operation.

@param m The message to read the HTTP
@param h The message to read the HTTP
start-line and headers from.

@see
@ref message_base.
@ref header.
*/
void
BOOST_HTTP_PROTO_DECL
start(message_base const& m);
start(header const& h);

/** Prepare the serializer for a new message with a ConstBufferSequence body.

Initializes the serializer with the HTTP
start-line and headers from `m`, and the
start-line and headers from `h`, and the
provided `buffers` for reading the
message body from.

Expand Down Expand Up @@ -237,7 +237,7 @@ class serializer
insufficient internal buffer space to
start the operation.

@param m The message to read the HTTP
@param h The message to read the HTTP
start-line and headers from.

@param buffers One or more buffers
Expand All @@ -248,7 +248,7 @@ class serializer
until @ref is_done returns `true`.

@see
@ref message_base.
@ref header.
*/
template<
class ConstBufferSequence,
Expand All @@ -258,13 +258,13 @@ class serializer
>
void
start(
message_base const& m,
header const& h,
ConstBufferSequence&& buffers);

/** Prepare the serializer for a new message with a Source body.

Initializes the serializer with the
HTTP start-line and headers from `m`,
HTTP start-line and headers from `h`,
and constructs a `Source` object to read
the message body.

Expand Down Expand Up @@ -310,7 +310,7 @@ class serializer
insufficient internal buffer space to
start the operation.

@param m The message to read the HTTP
@param h The message to read the HTTP
start-line and headers from.

@param args Arguments to be passed to the
Expand All @@ -321,7 +321,7 @@ class serializer
@see
@ref source,
@ref file_source,
@ref message_base.
@ref header.
*/
template<
class Source,
Expand All @@ -330,13 +330,13 @@ class serializer
is_source<Source>::value>::type>
Source&
start(
message_base const& m,
header const& h,
Args&&... args);

/** Prepare the serializer for a new message using a stream interface.

Initializes the serializer with the HTTP
start-line and headers from `m`, and returns
start-line and headers from `h`, and returns
a @ref stream object for reading the body
from an external source.

Expand Down Expand Up @@ -394,20 +394,20 @@ class serializer
insufficient internal buffer space to
start the operation.

@param m The message to read the HTTP
@param h The message to read the HTTP
start-line and headers from.

@return A @ref stream object for reading body
content into the serializer's buffer.

@see
@ref stream,
@ref message_base.
@ref header.
*/
BOOST_HTTP_PROTO_DECL
stream
start_stream(
message_base const& m);
header const& h);

/** Return the output area.

Expand Down Expand Up @@ -527,18 +527,18 @@ class serializer
BOOST_HTTP_PROTO_DECL
void
start_init(
message_base const&);
header const&);

BOOST_HTTP_PROTO_DECL
void
start_buffers(
message_base const&,
header const&,
cbs_gen&);

BOOST_HTTP_PROTO_DECL
void
start_source(
message_base const&,
header const&,
source&);

impl* impl_;
Expand Down
Loading