Skip to content

Commit

Permalink
Add forward declaration headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtum committed Oct 17, 2024
1 parent 225a25b commit 0078272
Show file tree
Hide file tree
Showing 51 changed files with 694 additions and 57 deletions.
4 changes: 3 additions & 1 deletion include/boost/beast/http/basic_dynamic_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
#ifndef BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_HPP
#define BOOST_BEAST_HTTP_BASIC_DYNAMIC_BODY_HPP

#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/basic_dynamic_body_fwd.hpp>

#include <boost/beast/core/buffer_traits.hpp>
#include <boost/beast/core/detail/buffer.hpp>
#include <boost/beast/core/detail/clamp.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/error.hpp>
#include <boost/beast/http/message.hpp>
#include <boost/optional.hpp>
Expand Down
24 changes: 24 additions & 0 deletions include/boost/beast/http/basic_dynamic_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -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<class DynamicBuffer>
struct basic_dynamic_body;

} // http
} // beast
} // boost

#endif
2 changes: 2 additions & 0 deletions include/boost/beast/http/basic_file_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef BOOST_BEAST_HTTP_BASIC_FILE_BODY_HPP
#define BOOST_BEAST_HTTP_BASIC_FILE_BODY_HPP

#include <boost/beast/http/basic_file_body_fwd.hpp>

#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/error.hpp>
#include <boost/beast/core/file_base.hpp>
Expand Down
24 changes: 24 additions & 0 deletions include/boost/beast/http/basic_file_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -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<class File>
struct basic_file_body;

} // http
} // beast
} // boost

#endif
6 changes: 3 additions & 3 deletions include/boost/beast/http/buffer_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#ifndef BOOST_BEAST_HTTP_BUFFER_BODY_HPP
#define BOOST_BEAST_HTTP_BUFFER_BODY_HPP

#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/buffer_body_fwd.hpp>

#include <boost/beast/core/buffer_traits.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/error.hpp>
#include <boost/beast/http/message.hpp>
#include <boost/beast/http/type_traits.hpp>
#include <boost/optional.hpp>

#include <cstdint>
#include <type_traits>
#include <utility>

namespace boost {
Expand Down
23 changes: 23 additions & 0 deletions include/boost/beast/http/buffer_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -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
12 changes: 2 additions & 10 deletions include/boost/beast/http/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,14 @@
#define BOOST_BEAST_HTTP_DETAIL_TYPE_TRAITS_HPP

#include <boost/beast/core/detail/type_traits.hpp>
#include <boost/beast/http/message_fwd.hpp>
#include <boost/beast/http/parser_fwd.hpp>
#include <boost/optional.hpp>
#include <cstdint>

namespace boost {
namespace beast {
namespace http {

template<bool isRequest, class Fields>
class header;

template<bool, class, class>
class message;

template<bool isRequest, class Body, class Fields>
class parser;

namespace detail {

template<class T>
Expand Down
4 changes: 4 additions & 0 deletions include/boost/beast/http/dynamic_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@
#ifndef BOOST_BEAST_HTTP_DYNAMIC_BODY_HPP
#define BOOST_BEAST_HTTP_DYNAMIC_BODY_HPP

#include <boost/beast/http/dynamic_body_fwd.hpp>

#include <boost/beast/core/multi_buffer.hpp>
#include <boost/beast/http/basic_dynamic_body.hpp>

namespace boost {
namespace beast {
namespace http {

#if BOOST_BEAST_DOXYGEN
/** A dynamic message body represented by a @ref multi_buffer
Meets the requirements of <em>Body</em>.
*/
using dynamic_body = basic_dynamic_body<multi_buffer>;
#endif

} // http
} // beast
Expand Down
37 changes: 37 additions & 0 deletions include/boost/beast/http/dynamic_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -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_DYNAMIC_BODY_FWD_HPP
#define BOOST_BEAST_HTTP_DYNAMIC_BODY_FWD_HPP

#include <boost/beast/http/basic_dynamic_body_fwd.hpp>

#include <memory>

namespace boost {
namespace beast {

#ifndef BOOST_BEAST_DOXYGEN
template<class Allocator>
class basic_multi_buffer;

using multi_buffer = basic_multi_buffer<std::allocator<char>>;
#endif

namespace http {

#ifndef BOOST_BEAST_DOXYGEN
using dynamic_body = basic_dynamic_body<multi_buffer>;
#endif

} // http
} // beast
} // boost

#endif
2 changes: 2 additions & 0 deletions include/boost/beast/http/empty_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef BOOST_BEAST_HTTP_EMPTY_BODY_HPP
#define BOOST_BEAST_HTTP_EMPTY_BODY_HPP

#include <boost/beast/http/empty_body_fwd.hpp>

#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/http/error.hpp>
#include <boost/beast/http/message.hpp>
Expand Down
23 changes: 23 additions & 0 deletions include/boost/beast/http/empty_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions include/boost/beast/http/fields.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#ifndef BOOST_BEAST_HTTP_FIELDS_HPP
#define BOOST_BEAST_HTTP_FIELDS_HPP

#include <boost/beast/http/fields_fwd.hpp>

#include <boost/beast/core/detail/allocator.hpp>
#include <boost/beast/core/detail/config.hpp>
#include <boost/beast/core/error.hpp>
Expand All @@ -20,11 +22,9 @@
#include <boost/intrusive/list.hpp>
#include <boost/intrusive/set.hpp>
#include <boost/optional.hpp>
#include <algorithm>
#include <cctype>
#include <cstring>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>

Expand Down Expand Up @@ -864,8 +864,10 @@ class basic_fields
string_view target_or_reason_;
};

#if BOOST_BEAST_DOXYGEN
/// A typical HTTP header fields container
using fields = basic_fields<std::allocator<char>>;
#endif

} // http
} // beast
Expand Down
30 changes: 30 additions & 0 deletions include/boost/beast/http/fields_fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// 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 <memory>

namespace boost {
namespace beast {
namespace http {

template<class Allocator>
class basic_fields;

#ifndef BOOST_BEAST_DOXYGEN
using fields = basic_fields<std::allocator<char>>;
#endif

} // http
} // beast
} // boost

#endif
7 changes: 4 additions & 3 deletions include/boost/beast/http/file_body.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
#ifndef BOOST_BEAST_HTTP_FILE_BODY_HPP
#define BOOST_BEAST_HTTP_FILE_BODY_HPP

#include <boost/beast/http/file_body_fwd.hpp>

#include <boost/beast/core/file.hpp>
#include <boost/beast/http/basic_file_body.hpp>
#include <boost/assert.hpp>
#include <boost/optional.hpp>
#include <algorithm>
#include <cstdio>
#include <cstdint>
#include <utility>

namespace boost {
namespace beast {
namespace http {

#if BOOST_BEAST_DOXYGEN
/// A message body represented by a file on the filesystem.
using file_body = basic_file_body<file>;
#endif

} // http
} // beast
Expand Down
29 changes: 29 additions & 0 deletions include/boost/beast/http/file_body_fwd.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//
// 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 <boost/beast/http/basic_file_body_fwd.hpp>

#include <boost/beast/core/file.hpp>

namespace boost {
namespace beast {
namespace http {

#ifndef BOOST_BEAST_DOXYGEN
using file_body = basic_file_body<file>;
#endif

} // http
} // beast
} // boost

#endif
Loading

0 comments on commit 0078272

Please sign in to comment.