Skip to content

Commit 2e30bf0

Browse files
committed
public interfaces are documented
1 parent 1bd63e5 commit 2e30bf0

79 files changed

Lines changed: 5113 additions & 2443 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (BOOST_HTTP_PROTO_IS_ROOT)
3737
endif ()
3838
option(BOOST_HTTP_PROTO_BUILD_TESTS "Build boost::http_proto tests" ${BUILD_TESTING})
3939
option(BOOST_HTTP_PROTO_BUILD_EXAMPLES "Build boost::http_proto examples" ${BOOST_HTTP_PROTO_IS_ROOT})
40-
40+
option(BOOST_HTTP_PROTO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)
4141

4242
# Check if environment variable BOOST_SRC_DIR is set
4343
if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR})
@@ -73,11 +73,13 @@ foreach (BOOST_HTTP_PROTO_DEPENDENCY ${BOOST_HTTP_PROTO_DEPENDENCIES})
7373
endif ()
7474
endforeach ()
7575
# Conditional dependencies
76-
if (BOOST_HTTP_PROTO_BUILD_TESTS)
77-
set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem)
78-
endif ()
79-
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
80-
# set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json)
76+
if (NOT BOOST_URL_MRDOCS_BUILD)
77+
if (BOOST_HTTP_PROTO_BUILD_TESTS)
78+
set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem)
79+
endif ()
80+
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
81+
# set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json)
82+
endif ()
8183
endif ()
8284
# Complete dependency list
8385
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_PROTO_INCLUDE_LIBRARIES} ${BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES})
@@ -143,19 +145,31 @@ source_group("" FILES "include/boost/http_proto.hpp" "build/Jamfile")
143145
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http_proto PREFIX "include" FILES ${BOOST_HTTP_PROTO_HEADERS})
144146
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_PROTO_SOURCES})
145147

148+
function(boost_http_proto_setup_properties target)
149+
target_compile_features(${target} PUBLIC cxx_constexpr)
150+
target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include")
151+
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}")
152+
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
153+
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_NO_LIB)
154+
target_compile_definitions(${target} PRIVATE BOOST_HTTP_PROTO_SOURCE)
155+
if (BUILD_SHARED_LIBS)
156+
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
157+
else ()
158+
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
159+
endif ()
160+
endfunction()
161+
162+
if (BOOST_HTTP_PROTO_MRDOCS_BUILD)
163+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/http_proto.hpp>\n")
164+
add_library(boost_http_proto_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
165+
boost_http_proto_setup_properties(boost_http_proto_mrdocs)
166+
boost_http_proto_setup_properties(boost_http_proto_mrdocs PUBLIC BOOST_HTTP_PROTO_MRDOCS)
167+
return()
168+
endif()
169+
146170
add_library(boost_http_proto include/boost/http_proto.hpp build/Jamfile ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_SOURCES})
147171
add_library(Boost::http_proto ALIAS boost_http_proto)
148-
target_compile_features(boost_http_proto PUBLIC cxx_constexpr)
149-
target_include_directories(boost_http_proto PUBLIC "${PROJECT_SOURCE_DIR}/include")
150-
target_include_directories(boost_http_proto PRIVATE "${PROJECT_SOURCE_DIR}")
151-
target_link_libraries(boost_http_proto PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
152-
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_NO_LIB)
153-
target_compile_definitions(boost_http_proto PRIVATE BOOST_HTTP_PROTO_SOURCE)
154-
if (BUILD_SHARED_LIBS)
155-
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
156-
else ()
157-
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
158-
endif ()
172+
boost_http_proto_setup_properties(boost_http_proto)
159173

160174
#-------------------------------------------------
161175
#

doc/local-playbook.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ ui:
1919

2020
antora:
2121
extensions:
22-
- require: '@antora/lunr-extension' # https://gitlab.com/antora/antora-lunr-extension
23-
index_latest_only: true
2422
- require: '@cppalliance/antora-cpp-tagfiles-extension'
2523
cpp-tagfiles:
2624
using-namespaces:

doc/modules/ROOT/nav.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
** xref:design_requirements/serializer.adoc[Serializer]
1717
** xref:design_requirements/parser.adoc[Parser]
1818
19-
* Design Choices
20-
21-
* xref:reference:boost/http_proto.adoc[Reference]
19+
// * xref:reference:boost/http_proto.adoc[Reference]
20+
* xref:reference.adoc[Reference]
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
//
2+
// Copyright (c) 2025 Mohammad Nejati
3+
//
4+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
6+
//
7+
// Official repository: https://github.com/boostorg/url
8+
//
9+
10+
11+
[#reference]
12+
= Reference
13+
14+
[width=100%]
15+
|===
16+
3+| *HTTP PROTO* | *RFC*
17+
18+
| *Types (1/2)*
19+
20+
cpp:boost::http_proto::fields[fields]
21+
22+
cpp:boost::http_proto::fields_base[fields_base]
23+
24+
cpp:boost::http_proto::fields_view[fields_view]
25+
26+
cpp:boost::http_proto::fields_view_base[fields_view_base]
27+
28+
cpp:boost::http_proto::file[file]
29+
30+
cpp:boost::http_proto::file_sink[file_sink]
31+
32+
cpp:boost::http_proto::file_source[file_source]
33+
34+
cpp:boost::http_proto::header_limits[header_limits]
35+
36+
cpp:boost::http_proto::message_base[message_base]
37+
38+
cpp:boost::http_proto::message_view_base[message_view_base]
39+
40+
cpp:boost::http_proto::metadata[metadata]
41+
42+
cpp:boost::http_proto::parser[parser]
43+
44+
cpp:boost::http_proto::request[request]
45+
46+
cpp:boost::http_proto::request_base[request_base]
47+
48+
cpp:boost::http_proto::request_parser[request_parser]
49+
50+
cpp:boost::http_proto::request_view[request_view]
51+
52+
cpp:boost::http_proto::response[response]
53+
54+
cpp:boost::http_proto::response_base[response_base]
55+
56+
| **Types (2/2)**
57+
58+
cpp:boost::http_proto::response_parser[response_parser]
59+
60+
cpp:boost::http_proto::response_view[response_view]
61+
62+
cpp:boost::http_proto::serializer[serializer]
63+
64+
cpp:boost::http_proto::sink[sink]
65+
66+
cpp:boost::http_proto::source[source]
67+
68+
cpp:boost::http_proto::static_fields[static_fields]
69+
70+
cpp:boost::http_proto::static_request[static_request]
71+
72+
cpp:boost::http_proto::static_response[static_response]
73+
74+
**Functions**
75+
76+
cpp:boost::http_proto::combine_field_values[combine_field_values]
77+
78+
cpp:boost::http_proto::install_parser_service[install_parser_service]
79+
80+
cpp:boost::http_proto::install_serializer_service[install_serializer_service]
81+
82+
cpp:boost::http_proto::int_to_status[int_to_status]
83+
84+
cpp:boost::http_proto::obsolete_reason[obsolete_reason]
85+
86+
cpp:boost::http_proto::string_to_field[string_to_field]
87+
88+
cpp:boost::http_proto::string_to_method[string_to_method]
89+
90+
cpp:boost::http_proto::to_status_class[to_status_class]
91+
92+
cpp:boost::http_proto::to_string[to_string]
93+
94+
// cpp:boost::http_proto::operator<<[operator<<]
95+
96+
| **Constants**
97+
98+
cpp:boost::http_proto::condition[condition]
99+
100+
cpp:boost::http_proto::content_coding[content_coding]
101+
102+
cpp:boost::http_proto::error[error]
103+
104+
cpp:boost::http_proto::field[field]
105+
106+
cpp:boost::http_proto::file_mode[file_mode]
107+
108+
cpp:boost::http_proto::method[method]
109+
110+
cpp:boost::http_proto::payload[payload]
111+
112+
cpp:boost::http_proto::status[status]
113+
114+
cpp:boost::http_proto::status_class[status_class]
115+
116+
cpp:boost::http_proto::version[version]
117+
118+
**Type Traits**
119+
120+
cpp:boost::http_proto::is_sink[is_sink]
121+
122+
cpp:boost::http_proto::is_source[is_source]
123+
124+
| **Grammar**
125+
126+
cpp:boost::http_proto::parameter_rule[parameter_rule]
127+
128+
cpp:boost::http_proto::quoted_token_rule[quoted_token_rule]
129+
130+
cpp:boost::http_proto::token_rule[token_rule]
131+
132+
cpp:boost::http_proto::upgrade_protocol_rule[upgrade_protocol_rule]
133+
134+
cpp:boost::http_proto::upgrade_rule[upgrade_rule]
135+
136+
**Types**
137+
138+
cpp:boost::http_proto::upgrade_protocol[upgrade_protocol]
139+
140+
cpp:boost::http_proto::parameter[parameter]
141+
142+
cpp:boost::http_proto::quoted_token_view[quoted_token_view]
143+
144+
**Functions**
145+
146+
cpp:boost::http_proto::list_rule[list_rule]
147+
148+
**Constants**
149+
150+
cpp:boost::http_proto::tchars[tchars]
151+
152+
|===

doc/mrdocs.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,33 @@ file-patterns:
1010
# Filters
1111
include-symbols:
1212
- 'boost::http_proto::**'
13+
exclude-symbols:
14+
- 'boost::http_proto::fields_view_base::reference::operator->'
15+
see-below:
16+
- 'boost::http_proto::fields_view_base::iterator'
17+
- 'boost::http_proto::fields_view_base::reverse_iterator'
18+
- 'boost::http_proto::fields_view_base::subrange'
19+
- 'boost::http_proto::file::native_handle_type'
1320
implementation-defined:
14-
- 'boost::http_proto::detail'
1521
- 'boost::http_proto::*::detail'
22+
- 'boost::http_proto::detail'
23+
- 'boost::http_proto::implementation_defined'
24+
- 'boost::http_proto::make_error_code'
25+
- 'boost::http_proto::make_error_condition'
1626
inaccessible-members: never
1727
inaccessible-bases: never
1828

1929
# Generator
2030
generate: adoc
21-
base-url: https://www.github.com/cppalliance/http_proto/blob/develop/include/
31+
base-url: https://www.github.com/cppalliance/http_proto/blob/develop/
2232

2333
# Style
2434
verbose: true
2535
multipage: true
2636
use-system-libc: true
2737

28-
cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_PROTO_BUILD_TESTS=OFF -DBOOST_HTTP_PROTO_BUILD_EXAMPLES=OFF'
38+
# Warnings
39+
warn-unnamed-param: true
40+
warn-if-undoc-enum-val: false
41+
42+
cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_PROTO_MRDOCS_BUILD=ON -DBOOST_HTTP_PROTO_BUILD_TESTS=OFF -DBOOST_HTTP_PROTO_BUILD_EXAMPLES=OFF'

include/boost/http_proto.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#ifndef BOOST_HTTP_PROTO_HPP
1111
#define BOOST_HTTP_PROTO_HPP
1212

13-
#include <boost/http_proto/deflate.hpp>
1413
#include <boost/http_proto/error.hpp>
1514
#include <boost/http_proto/field.hpp>
1615
#include <boost/http_proto/fields.hpp>
@@ -39,7 +38,6 @@
3938
#include <boost/http_proto/static_request.hpp>
4039
#include <boost/http_proto/static_response.hpp>
4140
#include <boost/http_proto/status.hpp>
42-
#include <boost/http_proto/string_body.hpp>
4341
#include <boost/http_proto/version.hpp>
4442

4543
#include <boost/http_proto/rfc/combine_field_values.hpp>

include/boost/http_proto/deflate.hpp

Lines changed: 0 additions & 46 deletions
This file was deleted.

include/boost/http_proto/detail/config.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ namespace http_proto {
4343

4444
//------------------------------------------------
4545

46-
#if ! defined(HTTP_PROTO_DOCS) && ( \
47-
defined(BOOST_NO_CXX14_AGGREGATE_NSDMI) || \
48-
defined(BOOST_MSVC) )
46+
#if defined(BOOST_NO_CXX14_AGGREGATE_NSDMI) || defined(BOOST_MSVC)
4947
# define BOOST_HTTP_PROTO_AGGREGATE_WORKAROUND
5048
#endif
5149

include/boost/http_proto/detail/file_win32.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424

2525
#include <boost/http_proto/error.hpp>
2626
#include <boost/http_proto/file_mode.hpp>
27-
#include <boost/winapi/basic_types.hpp>
2827
#include <boost/winapi/handles.hpp>
29-
#include <cstdio>
3028
#include <cstdint>
3129

3230
namespace boost {

include/boost/http_proto/detail/workspace.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ class workspace
9595

9696
/** Allocate internal storage.
9797
98-
@throws std::logic_error this->size() > 0
98+
@throw std::logic_error this->size() > 0
9999
100-
@throws std::invalid_argument n == 0
100+
@throw std::invalid_argument n == 0
101101
*/
102102
void
103103
allocate(
@@ -127,7 +127,7 @@ class workspace
127127

128128
/** Convert unused storage to reserved storage.
129129
130-
@throws std::invalid_argument n >= this->size()
130+
@throw std::invalid_argument n >= this->size()
131131
*/
132132
BOOST_HTTP_PROTO_DECL
133133
unsigned char*

0 commit comments

Comments
 (0)