From 407a2bfb5695446335b2401eb7c87921d017cd60 Mon Sep 17 00:00:00 2001 From: Mohammad Nejati Date: Tue, 15 Oct 2024 12:12:48 +0000 Subject: [PATCH] Add forward declaration headers --- .../boost/beast/http/basic_dynamic_body.hpp | 3 +- .../beast/http/basic_dynamic_body_fwd.hpp | 24 +++++++++++ include/boost/beast/http/basic_file_body.hpp | 1 + .../boost/beast/http/basic_file_body_fwd.hpp | 24 +++++++++++ include/boost/beast/http/buffer_body.hpp | 4 +- include/boost/beast/http/buffer_body_fwd.hpp | 23 ++++++++++ .../boost/beast/http/detail/type_traits.hpp | 12 +----- include/boost/beast/http/dynamic_body_fwd.hpp | 32 ++++++++++++++ include/boost/beast/http/empty_body.hpp | 1 + include/boost/beast/http/empty_body_fwd.hpp | 23 ++++++++++ include/boost/beast/http/fields.hpp | 4 +- include/boost/beast/http/fields_fwd.hpp | 28 ++++++++++++ include/boost/beast/http/file_body.hpp | 4 +- include/boost/beast/http/file_body_fwd.hpp | 26 +++++++++++ include/boost/beast/http/message.hpp | 23 +++++----- include/boost/beast/http/message_fwd.hpp | 43 +++++++++++++++++++ .../boost/beast/http/message_generator.hpp | 1 + .../beast/http/message_generator_fwd.hpp | 23 ++++++++++ include/boost/beast/http/parser.hpp | 10 +++++ include/boost/beast/http/parser_fwd.hpp | 37 ++++++++++++++++ include/boost/beast/http/serializer.hpp | 18 +++++--- include/boost/beast/http/serializer_fwd.hpp | 34 +++++++++++++++ include/boost/beast/http/span_body.hpp | 3 +- include/boost/beast/http/span_body_fwd.hpp | 24 +++++++++++ include/boost/beast/http/string_body.hpp | 17 +++++--- include/boost/beast/http/string_body_fwd.hpp | 32 ++++++++++++++ include/boost/beast/http/type_traits.hpp | 3 -- include/boost/beast/http/vector_body.hpp | 14 +++--- include/boost/beast/http/vector_body_fwd.hpp | 26 +++++++++++ test/beast/http/CMakeLists.txt | 20 +++++++-- test/beast/http/Jamfile | 16 ++++++- test/beast/http/basic_dynamic_body_fwd.cpp | 11 +++++ test/beast/http/basic_file_body_fwd.cpp | 11 +++++ test/beast/http/buffer_body_fwd.cpp | 11 +++++ test/beast/http/dynamic_body_fwd.cpp | 11 +++++ test/beast/http/empty_body.cpp | 2 + test/beast/http/empty_body_fwd.cpp | 11 +++++ test/beast/http/fields_fwd.cpp | 11 +++++ test/beast/http/file_body_fwd.cpp | 11 +++++ test/beast/http/message_fwd.cpp | 11 +++++ test/beast/http/message_generator_fwd.cpp | 11 +++++ test/beast/http/parser_fwd.cpp | 11 +++++ test/beast/http/serializer_fwd.cpp | 11 +++++ test/beast/http/span_body.cpp | 3 +- test/beast/http/span_body_fwd.cpp | 11 +++++ test/beast/http/string_body.cpp | 2 + test/beast/http/string_body_fwd.cpp | 11 +++++ test/beast/http/type_traits.cpp | 1 + test/beast/http/vector_body.cpp | 3 ++ test/beast/http/vector_body_fwd.cpp | 11 +++++ 50 files changed, 662 insertions(+), 56 deletions(-) create mode 100644 include/boost/beast/http/basic_dynamic_body_fwd.hpp create mode 100644 include/boost/beast/http/basic_file_body_fwd.hpp create mode 100644 include/boost/beast/http/buffer_body_fwd.hpp create mode 100644 include/boost/beast/http/dynamic_body_fwd.hpp create mode 100644 include/boost/beast/http/empty_body_fwd.hpp create mode 100644 include/boost/beast/http/fields_fwd.hpp create mode 100644 include/boost/beast/http/file_body_fwd.hpp create mode 100644 include/boost/beast/http/message_fwd.hpp create mode 100644 include/boost/beast/http/message_generator_fwd.hpp create mode 100644 include/boost/beast/http/parser_fwd.hpp create mode 100644 include/boost/beast/http/serializer_fwd.hpp create mode 100644 include/boost/beast/http/span_body_fwd.hpp create mode 100644 include/boost/beast/http/string_body_fwd.hpp create mode 100644 include/boost/beast/http/vector_body_fwd.hpp create mode 100644 test/beast/http/basic_dynamic_body_fwd.cpp create mode 100644 test/beast/http/basic_file_body_fwd.cpp create mode 100644 test/beast/http/buffer_body_fwd.cpp create mode 100644 test/beast/http/dynamic_body_fwd.cpp create mode 100644 test/beast/http/empty_body_fwd.cpp create mode 100644 test/beast/http/fields_fwd.cpp create mode 100644 test/beast/http/file_body_fwd.cpp create mode 100644 test/beast/http/message_fwd.cpp create mode 100644 test/beast/http/message_generator_fwd.cpp create mode 100644 test/beast/http/parser_fwd.cpp create mode 100644 test/beast/http/serializer_fwd.cpp create mode 100644 test/beast/http/span_body_fwd.cpp create mode 100644 test/beast/http/string_body_fwd.cpp create mode 100644 test/beast/http/vector_body_fwd.cpp diff --git a/include/boost/beast/http/basic_dynamic_body.hpp b/include/boost/beast/http/basic_dynamic_body.hpp index fb5f8d4304..25bdbf2e9b 100644 --- a/include/boost/beast/http/basic_dynamic_body.hpp +++ b/include/boost/beast/http/basic_dynamic_body.hpp @@ -10,10 +10,11 @@ #ifndef BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_HPP #define BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_HPP -#include #include #include #include +#include +#include #include #include #include diff --git a/include/boost/beast/http/basic_dynamic_body_fwd.hpp b/include/boost/beast/http/basic_dynamic_body_fwd.hpp new file mode 100644 index 0000000000..a6fe9714f4 --- /dev/null +++ b/include/boost/beast/http/basic_dynamic_body_fwd.hpp @@ -0,0 +1,24 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +template +struct basic_dynamic_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/basic_file_body.hpp b/include/boost/beast/http/basic_file_body.hpp index 28ecacf96c..3a19c9a859 100644 --- a/include/boost/beast/http/basic_file_body.hpp +++ b/include/boost/beast/http/basic_file_body.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/include/boost/beast/http/basic_file_body_fwd.hpp b/include/boost/beast/http/basic_file_body_fwd.hpp new file mode 100644 index 0000000000..13b1af38fa --- /dev/null +++ b/include/boost/beast/http/basic_file_body_fwd.hpp @@ -0,0 +1,24 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_BASIC_FILE_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_BASIC_FILE_BODY_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +template +struct basic_file_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/buffer_body.hpp b/include/boost/beast/http/buffer_body.hpp index 98768cb8a5..263c36719f 100644 --- a/include/boost/beast/http/buffer_body.hpp +++ b/include/boost/beast/http/buffer_body.hpp @@ -10,15 +10,15 @@ #ifndef BOOST_BEAST_HTTP_BUFFER_BODY_HPP #define BOOST_BEAST_HTTP_BUFFER_BODY_HPP -#include #include +#include +#include #include #include #include #include #include -#include #include namespace boost { diff --git a/include/boost/beast/http/buffer_body_fwd.hpp b/include/boost/beast/http/buffer_body_fwd.hpp new file mode 100644 index 0000000000..66174d7a38 --- /dev/null +++ b/include/boost/beast/http/buffer_body_fwd.hpp @@ -0,0 +1,23 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_BUFFER_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_BUFFER_BODY_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +struct buffer_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/detail/type_traits.hpp b/include/boost/beast/http/detail/type_traits.hpp index 1da4c4e414..a9b5d64088 100644 --- a/include/boost/beast/http/detail/type_traits.hpp +++ b/include/boost/beast/http/detail/type_traits.hpp @@ -11,22 +11,14 @@ #define BOOST_BEAST_HTTP_DETAIL_TYPE_TRAITS_HPP #include +#include +#include #include #include namespace boost { namespace beast { namespace http { - -template -class header; - -template -class message; - -template -class parser; - namespace detail { template diff --git a/include/boost/beast/http/dynamic_body_fwd.hpp b/include/boost/beast/http/dynamic_body_fwd.hpp new file mode 100644 index 0000000000..235f6ee379 --- /dev/null +++ b/include/boost/beast/http/dynamic_body_fwd.hpp @@ -0,0 +1,32 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_DYNAMIC_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_DYNAMIC_BODY_FWD_HPP + +#include +#include + +namespace boost { +namespace beast { + +template +class basic_multi_buffer; + +using multi_buffer = basic_multi_buffer>; + +namespace http { + +using dynamic_body = basic_dynamic_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/empty_body.hpp b/include/boost/beast/http/empty_body.hpp index fb90e06192..af8e974253 100644 --- a/include/boost/beast/http/empty_body.hpp +++ b/include/boost/beast/http/empty_body.hpp @@ -11,6 +11,7 @@ #define BOOST_BEAST_HTTP_EMPTY_BODY_HPP #include +#include #include #include #include diff --git a/include/boost/beast/http/empty_body_fwd.hpp b/include/boost/beast/http/empty_body_fwd.hpp new file mode 100644 index 0000000000..a25806c912 --- /dev/null +++ b/include/boost/beast/http/empty_body_fwd.hpp @@ -0,0 +1,23 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_EMPTY_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_EMPTY_BODY_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +struct empty_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/fields.hpp b/include/boost/beast/http/fields.hpp index 787396de78..b405c86301 100644 --- a/include/boost/beast/http/fields.hpp +++ b/include/boost/beast/http/fields.hpp @@ -15,16 +15,16 @@ #include #include #include +#include #include #include #include #include #include -#include + #include #include #include -#include #include #include diff --git a/include/boost/beast/http/fields_fwd.hpp b/include/boost/beast/http/fields_fwd.hpp new file mode 100644 index 0000000000..50a167f97d --- /dev/null +++ b/include/boost/beast/http/fields_fwd.hpp @@ -0,0 +1,28 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_FIELDS_FWD_HPP +#define BOOST_BEAST_HTTP_FIELDS_FWD_HPP + +#include + +namespace boost { +namespace beast { +namespace http { + +template +class basic_fields; + +using fields = basic_fields>; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/file_body.hpp b/include/boost/beast/http/file_body.hpp index a78d7901de..4336a44d53 100644 --- a/include/boost/beast/http/file_body.hpp +++ b/include/boost/beast/http/file_body.hpp @@ -12,12 +12,10 @@ #include #include +#include #include #include -#include #include -#include -#include namespace boost { namespace beast { diff --git a/include/boost/beast/http/file_body_fwd.hpp b/include/boost/beast/http/file_body_fwd.hpp new file mode 100644 index 0000000000..351500d5a3 --- /dev/null +++ b/include/boost/beast/http/file_body_fwd.hpp @@ -0,0 +1,26 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_FILE_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_FILE_BODY_FWD_HPP + +#include +#include + +namespace boost { +namespace beast { +namespace http { + +using file_body = basic_file_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/message.hpp b/include/boost/beast/http/message.hpp index d10398263a..4aa51e5e99 100644 --- a/include/boost/beast/http/message.hpp +++ b/include/boost/beast/http/message.hpp @@ -11,19 +11,18 @@ #define BOOST_BEAST_HTTP_MESSAGE_HPP #include +#include #include -#include +#include #include #include -#include +#include +#include #include #include -#include #include #include -#include -#include -#include + #include #include @@ -48,11 +47,7 @@ namespace http { #if BOOST_BEAST_DOXYGEN template class header : public Fields - #else -template -class header; - template class header : public Fields #endif @@ -445,6 +440,7 @@ class header : public Fields #endif }; +#if BOOST_BEAST_DOXYGEN /// A typical HTTP request header template using request_header = header; @@ -452,6 +448,7 @@ using request_header = header; /// A typical HTTP response header template using response_header = header; +#endif #if defined(BOOST_MSVC) // Workaround for MSVC bug with private base classes @@ -490,7 +487,11 @@ using value_type_t = typename T::value_type; @tparam Fields The type of container used to hold the field value pairs. */ +#if BOOST_BEAST_DOXYGEN template +#else +template +#endif class message : public header #if ! BOOST_BEAST_DOXYGEN @@ -972,6 +973,7 @@ class message prepare_payload(std::false_type); }; +#if BOOST_BEAST_DOXYGEN /// A typical HTTP request template using request = message; @@ -979,6 +981,7 @@ using request = message; /// A typical HTTP response template using response = message; +#endif //------------------------------------------------------------------------------ diff --git a/include/boost/beast/http/message_fwd.hpp b/include/boost/beast/http/message_fwd.hpp new file mode 100644 index 0000000000..ec05482744 --- /dev/null +++ b/include/boost/beast/http/message_fwd.hpp @@ -0,0 +1,43 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_MESSAGE_FWD_HPP +#define BOOST_BEAST_HTTP_MESSAGE_FWD_HPP + +#include + +namespace boost { +namespace beast { +namespace http { + +#ifndef BOOST_BEAST_DOXYGEN +template +class header; + +template +class message; + +template +using request_header = header; + +template +using response_header = header; + +template +using request = message; + +template +using response = message; +#endif + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/message_generator.hpp b/include/boost/beast/http/message_generator.hpp index b4af27678b..e315577022 100644 --- a/include/boost/beast/http/message_generator.hpp +++ b/include/boost/beast/http/message_generator.hpp @@ -10,6 +10,7 @@ #define BOOST_BEAST_HTTP_MESSAGE_GENERATOR_HPP #include +#include #include #include #include diff --git a/include/boost/beast/http/message_generator_fwd.hpp b/include/boost/beast/http/message_generator_fwd.hpp new file mode 100644 index 0000000000..c6721bb78f --- /dev/null +++ b/include/boost/beast/http/message_generator_fwd.hpp @@ -0,0 +1,23 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_MESSAGE_GENERATOR_FWD_HPP +#define BOOST_BEAST_HTTP_MESSAGE_GENERATOR_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +class message_generator; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/parser.hpp b/include/boost/beast/http/parser.hpp index a5b93d17d4..16dff36acb 100644 --- a/include/boost/beast/http/parser.hpp +++ b/include/boost/beast/http/parser.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -43,10 +44,17 @@ namespace http { @note A new instance of the parser is required for each message. */ +#if BOOST_BEAST_DOXYGEN template< bool isRequest, class Body, class Allocator = std::allocator> +#else +template< + bool isRequest, + class Body, + class Allocator> +#endif class parser : public basic_parser { @@ -489,6 +497,7 @@ class parser } }; +#if BOOST_BEAST_DOXYGEN /// An HTTP/1 parser for producing a request message. template> using request_parser = parser; @@ -496,6 +505,7 @@ using request_parser = parser; /// An HTTP/1 parser for producing a response message. template> using response_parser = parser; +#endif } // http } // beast diff --git a/include/boost/beast/http/parser_fwd.hpp b/include/boost/beast/http/parser_fwd.hpp new file mode 100644 index 0000000000..47a5e84e37 --- /dev/null +++ b/include/boost/beast/http/parser_fwd.hpp @@ -0,0 +1,37 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_PARSER_FWD_HPP +#define BOOST_BEAST_HTTP_PARSER_FWD_HPP + +#include + +namespace boost { +namespace beast { +namespace http { + +#ifndef BOOST_BEAST_DOXYGEN +template< + bool isRequest, + class Body, + class Allocator = std::allocator> +class parser; + +template> +using request_parser = parser; + +template> +using response_parser = parser; +#endif + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/serializer.hpp b/include/boost/beast/http/serializer.hpp index 229554ddb0..743404f653 100644 --- a/include/boost/beast/http/serializer.hpp +++ b/include/boost/beast/http/serializer.hpp @@ -10,14 +10,15 @@ #ifndef BOOST_BEAST_HTTP_SERIALIZER_HPP #define BOOST_BEAST_HTTP_SERIALIZER_HPP -#include #include #include #include -#include +#include #include -#include +#include #include +#include +#include #include #include @@ -57,10 +58,11 @@ namespace http { @tparam Fields The type of fields in the message. */ -template< - bool isRequest, - class Body, - class Fields = fields> +#if BOOST_BEAST_DOXYGEN +template +#else +template +#endif class serializer { public: @@ -377,6 +379,7 @@ class serializer } }; +#if BOOST_BEAST_DOXYGEN /// A serializer for HTTP/1 requests template using request_serializer = serializer; @@ -384,6 +387,7 @@ using request_serializer = serializer; /// A serializer for HTTP/1 responses template using response_serializer = serializer; +#endif } // http } // beast diff --git a/include/boost/beast/http/serializer_fwd.hpp b/include/boost/beast/http/serializer_fwd.hpp new file mode 100644 index 0000000000..3abb04ee5c --- /dev/null +++ b/include/boost/beast/http/serializer_fwd.hpp @@ -0,0 +1,34 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_SERIALIZER_FWD_HPP +#define BOOST_BEAST_HTTP_SERIALIZER_FWD_HPP + +#include + +namespace boost { +namespace beast { +namespace http { + +#ifndef BOOST_BEAST_DOXYGEN +template +class serializer; + +template +using request_serializer = serializer; + +template +using response_serializer = serializer; +#endif + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/span_body.hpp b/include/boost/beast/http/span_body.hpp index 344d8d8506..79fb648a31 100644 --- a/include/boost/beast/http/span_body.hpp +++ b/include/boost/beast/http/span_body.hpp @@ -10,11 +10,12 @@ #ifndef BOOST_BEAST_HTTP_SPAN_BODY_HPP #define BOOST_BEAST_HTTP_SPAN_BODY_HPP -#include #include +#include #include #include #include +#include #include namespace boost { diff --git a/include/boost/beast/http/span_body_fwd.hpp b/include/boost/beast/http/span_body_fwd.hpp new file mode 100644 index 0000000000..e04b9c1e49 --- /dev/null +++ b/include/boost/beast/http/span_body_fwd.hpp @@ -0,0 +1,24 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_SPAN_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_SPAN_BODY_FWD_HPP + +namespace boost { +namespace beast { +namespace http { + +template +struct span_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/string_body.hpp b/include/boost/beast/http/string_body.hpp index b306312219..98be218d0a 100644 --- a/include/boost/beast/http/string_body.hpp +++ b/include/boost/beast/http/string_body.hpp @@ -10,18 +10,16 @@ #ifndef BOOST_BEAST_HTTP_STRING_BODY_HPP #define BOOST_BEAST_HTTP_STRING_BODY_HPP -#include #include -#include -#include #include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include #include #include @@ -35,10 +33,17 @@ namespace http { for holding message payloads. Messages using this body type may be serialized and parsed. */ +#if BOOST_BEAST_DOXYGEN template< class CharT, class Traits = std::char_traits, class Allocator = std::allocator> +#else +template< + class CharT, + class Traits, + class Allocator> +#endif struct basic_string_body { private: diff --git a/include/boost/beast/http/string_body_fwd.hpp b/include/boost/beast/http/string_body_fwd.hpp new file mode 100644 index 0000000000..322770033f --- /dev/null +++ b/include/boost/beast/http/string_body_fwd.hpp @@ -0,0 +1,32 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_STRING_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_STRING_BODY_FWD_HPP + +#include +#include + +namespace boost { +namespace beast { +namespace http { + +template< + class CharT, + class Traits = std::char_traits, + class Allocator = std::allocator> +struct basic_string_body; + +using string_body = basic_string_body; + +} // http +} // beast +} // boost + +#endif diff --git a/include/boost/beast/http/type_traits.hpp b/include/boost/beast/http/type_traits.hpp index 843e9a91b4..3afd76f620 100644 --- a/include/boost/beast/http/type_traits.hpp +++ b/include/boost/beast/http/type_traits.hpp @@ -24,9 +24,6 @@ namespace boost { namespace beast { namespace http { -template -class message; - /** Determine if a type meets the Body named requirements. This alias template is `std::true_type` if `T` meets diff --git a/include/boost/beast/http/vector_body.hpp b/include/boost/beast/http/vector_body.hpp index 4665b00bd7..076e091af9 100644 --- a/include/boost/beast/http/vector_body.hpp +++ b/include/boost/beast/http/vector_body.hpp @@ -10,19 +10,17 @@ #ifndef BOOST_BEAST_HTTP_VECTOR_BODY_HPP #define BOOST_BEAST_HTTP_VECTOR_BODY_HPP -#include #include +#include +#include #include #include -#include +#include #include #include #include -#include -#include -#include -#include #include +#include namespace boost { namespace beast { @@ -34,7 +32,11 @@ namespace http { for holding message payloads. Messages using this body type may be serialized and parsed. */ +#if BOOST_BEAST_DOXYGEN template> +#else +template +#endif struct vector_body { private: diff --git a/include/boost/beast/http/vector_body_fwd.hpp b/include/boost/beast/http/vector_body_fwd.hpp new file mode 100644 index 0000000000..081796ef78 --- /dev/null +++ b/include/boost/beast/http/vector_body_fwd.hpp @@ -0,0 +1,26 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 +// + +#ifndef BOOST_BEAST_HTTP_VECTOR_BODY_FWD_HPP +#define BOOST_BEAST_HTTP_VECTOR_BODY_FWD_HPP + +#include + +namespace boost { +namespace beast { +namespace http { + +template> +struct vector_body; + +} // http +} // beast +} // boost + +#endif diff --git a/test/beast/http/CMakeLists.txt b/test/beast/http/CMakeLists.txt index cd4b49ec1c..a0cf843097 100644 --- a/test/beast/http/CMakeLists.txt +++ b/test/beast/http/CMakeLists.txt @@ -16,31 +16,45 @@ add_executable (tests-beast-http ${EXTRAS_FILES} Jamfile any_completion_handler.cpp - message_fuzz.hpp - test_parser.hpp + basic_dynamic_body_fwd.cpp basic_dynamic_body.cpp + basic_file_body_fwd.cpp basic_file_body.cpp basic_parser.cpp + buffer_body_fwd.cpp buffer_body.cpp chunk_encode.cpp deferred.cpp + dynamic_body_fwd.cpp dynamic_body.cpp + empty_body_fwd.cpp empty_body.cpp error.cpp - field.cpp field_compiles.cpp + field.cpp + fields_fwd.cpp fields.cpp + file_body_fwd.cpp file_body.cpp + message_fuzz.hpp + message_fwd.cpp + message_generator_fwd.cpp message_generator.cpp message.cpp + parser_fwd.cpp parser.cpp read.cpp rfc7230.cpp + serializer_fwd.cpp serializer.cpp + span_body_fwd.cpp span_body.cpp status.cpp + string_body_fwd.cpp string_body.cpp + test_parser.hpp type_traits.cpp + vector_body_fwd.cpp vector_body.cpp verb.cpp write.cpp diff --git a/test/beast/http/Jamfile b/test/beast/http/Jamfile index 487be1abbf..6bcc7fd56a 100644 --- a/test/beast/http/Jamfile +++ b/test/beast/http/Jamfile @@ -9,28 +9,42 @@ local SOURCES = any_completion_handler.cpp + basic_dynamic_body_fwd.cpp basic_dynamic_body.cpp + basic_file_body_fwd.cpp basic_file_body.cpp basic_parser.cpp + buffer_body_fwd.cpp buffer_body.cpp chunk_encode.cpp deferred.cpp + dynamic_body_fwd.cpp dynamic_body.cpp + empty_body_fwd.cpp error.cpp - field.cpp field_compiles.cpp + field.cpp + fields_fwd.cpp fields.cpp + file_body_fwd.cpp file_body.cpp + message_fwd.cpp + message_generator_fwd.cpp message_generator.cpp message.cpp + parser_fwd.cpp parser.cpp read.cpp rfc7230.cpp + serializer_fwd.cpp serializer.cpp + span_body_fwd.cpp span_body.cpp status.cpp + string_body_fwd.cpp string_body.cpp type_traits.cpp + vector_body_fwd.cpp vector_body.cpp verb.cpp write.cpp diff --git a/test/beast/http/basic_dynamic_body_fwd.cpp b/test/beast/http/basic_dynamic_body_fwd.cpp new file mode 100644 index 0000000000..5cf30f85f1 --- /dev/null +++ b/test/beast/http/basic_dynamic_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/basic_file_body_fwd.cpp b/test/beast/http/basic_file_body_fwd.cpp new file mode 100644 index 0000000000..cb10bfe261 --- /dev/null +++ b/test/beast/http/basic_file_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/buffer_body_fwd.cpp b/test/beast/http/buffer_body_fwd.cpp new file mode 100644 index 0000000000..d9e145dda2 --- /dev/null +++ b/test/beast/http/buffer_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/dynamic_body_fwd.cpp b/test/beast/http/dynamic_body_fwd.cpp new file mode 100644 index 0000000000..c0c43b215b --- /dev/null +++ b/test/beast/http/dynamic_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/empty_body.cpp b/test/beast/http/empty_body.cpp index 96db2bc9d8..771eae0080 100644 --- a/test/beast/http/empty_body.cpp +++ b/test/beast/http/empty_body.cpp @@ -10,6 +10,8 @@ // Test that header file is self-contained. #include +#include + namespace boost { namespace beast { namespace http { diff --git a/test/beast/http/empty_body_fwd.cpp b/test/beast/http/empty_body_fwd.cpp new file mode 100644 index 0000000000..2b8dc06f3e --- /dev/null +++ b/test/beast/http/empty_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/fields_fwd.cpp b/test/beast/http/fields_fwd.cpp new file mode 100644 index 0000000000..9cc516abd9 --- /dev/null +++ b/test/beast/http/fields_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/file_body_fwd.cpp b/test/beast/http/file_body_fwd.cpp new file mode 100644 index 0000000000..dbd79c23b3 --- /dev/null +++ b/test/beast/http/file_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/message_fwd.cpp b/test/beast/http/message_fwd.cpp new file mode 100644 index 0000000000..71065ccdfe --- /dev/null +++ b/test/beast/http/message_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/message_generator_fwd.cpp b/test/beast/http/message_generator_fwd.cpp new file mode 100644 index 0000000000..71ea220bda --- /dev/null +++ b/test/beast/http/message_generator_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/parser_fwd.cpp b/test/beast/http/parser_fwd.cpp new file mode 100644 index 0000000000..27e64511e0 --- /dev/null +++ b/test/beast/http/parser_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/serializer_fwd.cpp b/test/beast/http/serializer_fwd.cpp new file mode 100644 index 0000000000..8b6a2678ac --- /dev/null +++ b/test/beast/http/serializer_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/span_body.cpp b/test/beast/http/span_body.cpp index ab75857be0..ef3d284b37 100644 --- a/test/beast/http/span_body.cpp +++ b/test/beast/http/span_body.cpp @@ -10,9 +10,10 @@ // Test that header file is self-contained. #include +#include #include #include -#include +#include namespace boost { namespace beast { diff --git a/test/beast/http/span_body_fwd.cpp b/test/beast/http/span_body_fwd.cpp new file mode 100644 index 0000000000..6ab7c1a794 --- /dev/null +++ b/test/beast/http/span_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/string_body.cpp b/test/beast/http/string_body.cpp index 14f873b5f4..9b5e8aa6e0 100644 --- a/test/beast/http/string_body.cpp +++ b/test/beast/http/string_body.cpp @@ -10,6 +10,8 @@ // Test that header file is self-contained. #include +#include + namespace boost { namespace beast { namespace http { diff --git a/test/beast/http/string_body_fwd.cpp b/test/beast/http/string_body_fwd.cpp new file mode 100644 index 0000000000..332ec00200 --- /dev/null +++ b/test/beast/http/string_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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 diff --git a/test/beast/http/type_traits.cpp b/test/beast/http/type_traits.cpp index fef17fb69e..e68d1b4b04 100644 --- a/test/beast/http/type_traits.cpp +++ b/test/beast/http/type_traits.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/test/beast/http/vector_body.cpp b/test/beast/http/vector_body.cpp index 142d17e186..14a57718cb 100644 --- a/test/beast/http/vector_body.cpp +++ b/test/beast/http/vector_body.cpp @@ -9,6 +9,9 @@ // Test that header file is self-contained. #include + +#include + #include namespace boost { diff --git a/test/beast/http/vector_body_fwd.cpp b/test/beast/http/vector_body_fwd.cpp new file mode 100644 index 0000000000..a02bb9289a --- /dev/null +++ b/test/beast/http/vector_body_fwd.cpp @@ -0,0 +1,11 @@ +// +// Copyright (c) 2024 Mohammad Nejati +// +// 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