Skip to content
Merged
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
48 changes: 31 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (BOOST_HTTP_PROTO_IS_ROOT)
endif ()
option(BOOST_HTTP_PROTO_BUILD_TESTS "Build boost::http_proto tests" ${BUILD_TESTING})
option(BOOST_HTTP_PROTO_BUILD_EXAMPLES "Build boost::http_proto examples" ${BOOST_HTTP_PROTO_IS_ROOT})

option(BOOST_HTTP_PROTO_MRDOCS_BUILD "Build the target for MrDocs: see mrdocs.yml" OFF)

# Check if environment variable BOOST_SRC_DIR is set
if (NOT DEFINED BOOST_SRC_DIR AND DEFINED ENV{BOOST_SRC_DIR})
Expand Down Expand Up @@ -73,11 +73,13 @@ foreach (BOOST_HTTP_PROTO_DEPENDENCY ${BOOST_HTTP_PROTO_DEPENDENCIES})
endif ()
endforeach ()
# Conditional dependencies
if (BOOST_HTTP_PROTO_BUILD_TESTS)
set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem)
endif ()
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
# set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json)
if (NOT BOOST_URL_MRDOCS_BUILD)
if (BOOST_HTTP_PROTO_BUILD_TESTS)
set(BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES filesystem)
endif ()
if (BOOST_HTTP_PROTO_BUILD_EXAMPLES)
# set(BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES json)
endif ()
endif ()
# Complete dependency list
set(BOOST_INCLUDE_LIBRARIES ${BOOST_HTTP_PROTO_INCLUDE_LIBRARIES} ${BOOST_HTTP_PROTO_UNIT_TEST_LIBRARIES} ${BOOST_HTTP_PROTO_EXAMPLE_LIBRARIES})
Expand Down Expand Up @@ -143,19 +145,31 @@ source_group("" FILES "include/boost/http_proto.hpp" "build/Jamfile")
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/include/boost/http_proto PREFIX "include" FILES ${BOOST_HTTP_PROTO_HEADERS})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/src PREFIX "src" FILES ${BOOST_HTTP_PROTO_SOURCES})

function(boost_http_proto_setup_properties target)
target_compile_features(${target} PUBLIC cxx_constexpr)
target_include_directories(${target} PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(${target} PRIVATE "${PROJECT_SOURCE_DIR}")
target_link_libraries(${target} PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_NO_LIB)
target_compile_definitions(${target} PRIVATE BOOST_HTTP_PROTO_SOURCE)
if (BUILD_SHARED_LIBS)
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
else ()
target_compile_definitions(${target} PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
endif ()
endfunction()

if (BOOST_HTTP_PROTO_MRDOCS_BUILD)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp" "#include <boost/http_proto.hpp>\n")
add_library(boost_http_proto_mrdocs "${CMAKE_CURRENT_BINARY_DIR}/mrdocs.cpp")
boost_http_proto_setup_properties(boost_http_proto_mrdocs)
boost_http_proto_setup_properties(boost_http_proto_mrdocs PUBLIC BOOST_HTTP_PROTO_MRDOCS)
return()
endif()

add_library(boost_http_proto include/boost/http_proto.hpp build/Jamfile ${BOOST_HTTP_PROTO_HEADERS} ${BOOST_HTTP_PROTO_SOURCES})
add_library(Boost::http_proto ALIAS boost_http_proto)
target_compile_features(boost_http_proto PUBLIC cxx_constexpr)
target_include_directories(boost_http_proto PUBLIC "${PROJECT_SOURCE_DIR}/include")
target_include_directories(boost_http_proto PRIVATE "${PROJECT_SOURCE_DIR}")
target_link_libraries(boost_http_proto PUBLIC ${BOOST_HTTP_PROTO_DEPENDENCIES})
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_NO_LIB)
target_compile_definitions(boost_http_proto PRIVATE BOOST_HTTP_PROTO_SOURCE)
if (BUILD_SHARED_LIBS)
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_DYN_LINK)
else ()
target_compile_definitions(boost_http_proto PUBLIC BOOST_HTTP_PROTO_STATIC_LINK)
endif ()
boost_http_proto_setup_properties(boost_http_proto)

#-------------------------------------------------
#
Expand Down
6 changes: 6 additions & 0 deletions doc/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ nav:
ext:
cpp-reference:
config: doc/mrdocs.yml
cpp-tagfiles:
files:
- file: ./doc/tagfiles/boost-http_proto-doxygen.tag.xml
base_url: 'xref:reference:'
using-namespaces:
- boost::http_proto
2 changes: 0 additions & 2 deletions doc/local-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ ui:

antora:
extensions:
- require: '@antora/lunr-extension' # https://gitlab.com/antora/antora-lunr-extension
index_latest_only: true
- require: '@cppalliance/antora-cpp-tagfiles-extension'
cpp-tagfiles:
using-namespaces:
Expand Down
5 changes: 2 additions & 3 deletions doc/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
** xref:design_requirements/serializer.adoc[Serializer]
** xref:design_requirements/parser.adoc[Parser]

* Design Choices

* xref:reference:boost/http_proto.adoc[Reference]
// * xref:reference:boost/http_proto.adoc[Reference]
* xref:reference.adoc[Reference]
152 changes: 152 additions & 0 deletions doc/modules/ROOT/pages/reference.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
//
// Copyright (c) 2025 Mohammad Nejati
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/url
//


[#reference]
= Reference

[width=100%]
|===
3+| *HTTP PROTO* | *RFC*

| *Types (1/2)*

cpp:boost::http_proto::fields[fields]

cpp:boost::http_proto::fields_base[fields_base]

cpp:boost::http_proto::fields_view[fields_view]

cpp:boost::http_proto::fields_view_base[fields_view_base]

cpp:boost::http_proto::file[file]

cpp:boost::http_proto::file_sink[file_sink]

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::message_view_base[message_view_base]

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

cpp:boost::http_proto::parser[parser]

cpp:boost::http_proto::request[request]

cpp:boost::http_proto::request_base[request_base]

cpp:boost::http_proto::request_parser[request_parser]

cpp:boost::http_proto::request_view[request_view]

cpp:boost::http_proto::response[response]

cpp:boost::http_proto::response_base[response_base]

| **Types (2/2)**

cpp:boost::http_proto::response_parser[response_parser]

cpp:boost::http_proto::response_view[response_view]

cpp:boost::http_proto::serializer[serializer]

cpp:boost::http_proto::sink[sink]

cpp:boost::http_proto::source[source]

cpp:boost::http_proto::static_fields[static_fields]

cpp:boost::http_proto::static_request[static_request]

cpp:boost::http_proto::static_response[static_response]

**Functions**

cpp:boost::http_proto::combine_field_values[combine_field_values]

cpp:boost::http_proto::install_parser_service[install_parser_service]

cpp:boost::http_proto::install_serializer_service[install_serializer_service]

cpp:boost::http_proto::int_to_status[int_to_status]

cpp:boost::http_proto::obsolete_reason[obsolete_reason]

cpp:boost::http_proto::string_to_field[string_to_field]

cpp:boost::http_proto::string_to_method[string_to_method]

cpp:boost::http_proto::to_status_class[to_status_class]

cpp:boost::http_proto::to_string[to_string]

// cpp:boost::http_proto::operator<<[operator<<]

| **Constants**

cpp:boost::http_proto::condition[condition]

cpp:boost::http_proto::content_coding[content_coding]

cpp:boost::http_proto::error[error]

cpp:boost::http_proto::field[field]

cpp:boost::http_proto::file_mode[file_mode]

cpp:boost::http_proto::method[method]

cpp:boost::http_proto::payload[payload]

cpp:boost::http_proto::status[status]

cpp:boost::http_proto::status_class[status_class]

cpp:boost::http_proto::version[version]

**Type Traits**

cpp:boost::http_proto::is_sink[is_sink]

cpp:boost::http_proto::is_source[is_source]

| **Grammar**

cpp:boost::http_proto::parameter_rule[parameter_rule]

cpp:boost::http_proto::quoted_token_rule[quoted_token_rule]

cpp:boost::http_proto::token_rule[token_rule]

cpp:boost::http_proto::upgrade_protocol_rule[upgrade_protocol_rule]

cpp:boost::http_proto::upgrade_rule[upgrade_rule]

**Types**

cpp:boost::http_proto::upgrade_protocol[upgrade_protocol]

cpp:boost::http_proto::parameter[parameter]

cpp:boost::http_proto::quoted_token_view[quoted_token_view]

**Functions**

cpp:boost::http_proto::list_rule[list_rule]

**Constants**

cpp:boost::http_proto::tchars[tchars]

|===
20 changes: 17 additions & 3 deletions doc/mrdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,33 @@ file-patterns:
# Filters
include-symbols:
- 'boost::http_proto::**'
exclude-symbols:
- 'boost::http_proto::fields_view_base::reference::operator->'
see-below:
- 'boost::http_proto::fields_view_base::iterator'
- 'boost::http_proto::fields_view_base::reverse_iterator'
- 'boost::http_proto::fields_view_base::subrange'
- 'boost::http_proto::file::native_handle_type'
implementation-defined:
- 'boost::http_proto::detail'
- 'boost::http_proto::*::detail'
- 'boost::http_proto::detail'
- 'boost::http_proto::implementation_defined'
- 'boost::http_proto::make_error_code'
- 'boost::http_proto::make_error_condition'
inaccessible-members: never
inaccessible-bases: never

# Generator
generate: adoc
base-url: https://www.github.com/cppalliance/http_proto/blob/develop/include/
base-url: https://www.github.com/cppalliance/http_proto/blob/develop/

# Style
verbose: true
multipage: true
use-system-libc: true

cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_PROTO_BUILD_TESTS=OFF -DBOOST_HTTP_PROTO_BUILD_EXAMPLES=OFF'
# Warnings
warn-unnamed-param: true
warn-if-undoc-enum-val: false

cmake: '-DCMAKE_CXX_STANDARD=20 -DBOOST_HTTP_PROTO_MRDOCS_BUILD=ON -DBOOST_HTTP_PROTO_BUILD_TESTS=OFF -DBOOST_HTTP_PROTO_BUILD_EXAMPLES=OFF'
Loading
Loading