diff --git a/doc/qbk/00_main.qbk b/doc/qbk/00_main.qbk index 520e2d3e9..2d3ce7c85 100644 --- a/doc/qbk/00_main.qbk +++ b/doc/qbk/00_main.qbk @@ -148,6 +148,16 @@ END [import ../../example/2_simple/patch_updates.cpp] [import ../../example/2_simple/source_script.cpp] [import ../../example/2_simple/pipeline.cpp] +[import ../../example/3_advanced/http_server_cpp20/main.cpp] +[import ../../example/3_advanced/http_server_cpp20/types.hpp] +[import ../../example/3_advanced/http_server_cpp20/error.hpp] +[import ../../example/3_advanced/http_server_cpp20/error.cpp] +[import ../../example/3_advanced/http_server_cpp20/repository.hpp] +[import ../../example/3_advanced/http_server_cpp20/repository.cpp] +[import ../../example/3_advanced/http_server_cpp20/handle_request.hpp] +[import ../../example/3_advanced/http_server_cpp20/handle_request.cpp] +[import ../../example/3_advanced/http_server_cpp20/server.hpp] +[import ../../example/3_advanced/http_server_cpp20/server.cpp] [import ../../example/3_advanced/connection_pool/main.cpp] [import ../../example/3_advanced/connection_pool/types.hpp] [import ../../example/3_advanced/connection_pool/repository.hpp] diff --git a/doc/qbk/21_examples.qbk b/doc/qbk/21_examples.qbk index c4246be0d..7d06790a4 100644 --- a/doc/qbk/21_examples.qbk +++ b/doc/qbk/21_examples.qbk @@ -331,7 +331,36 @@ This example assumes you have gone through the [link mysql.examples.setup setup] -[section:connection_pool A REST API server that uses connection pooling] +[section:http_server_cpp20 A REST API server that uses C++20 coroutines] + +This example assumes you have gone through the [link mysql.examples.setup setup]. + +[example_http_server_cpp20_main_cpp] + +[example_http_server_cpp20_types_hpp] + +[example_http_server_cpp20_error_hpp] + +[example_http_server_cpp20_error_cpp] + +[example_http_server_cpp20_repository_hpp] + +[example_http_server_cpp20_repository_cpp] + +[example_http_server_cpp20_handle_request_hpp] + +[example_http_server_cpp20_handle_request_cpp] + +[example_http_server_cpp20_server_hpp] + +[example_http_server_cpp20_server_cpp] + +[endsect] + + + + +[section:connection_pool A REST API server that uses asio::yield_context] This example assumes you have gone through the [link mysql.examples.setup setup]. diff --git a/example/3_advanced/http_server_cpp20/handle_request.cpp b/example/3_advanced/http_server_cpp20/handle_request.cpp index 7f5e67d0e..60b3af32e 100644 --- a/example/3_advanced/http_server_cpp20/handle_request.cpp +++ b/example/3_advanced/http_server_cpp20/handle_request.cpp @@ -9,7 +9,7 @@ #include #if defined(BOOST_ASIO_HAS_CO_AWAIT) && BOOST_PFR_CORE_NAME_ENABLED -//[example_connection_pool_handle_request_cpp +//[example_http_server_cpp20_handle_request_cpp // // File: handle_request.cpp // diff --git a/example/3_advanced/http_server_cpp20/handle_request.hpp b/example/3_advanced/http_server_cpp20/handle_request.hpp index 99a123473..5a8b80469 100644 --- a/example/3_advanced/http_server_cpp20/handle_request.hpp +++ b/example/3_advanced/http_server_cpp20/handle_request.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_HANDLE_REQUEST_HPP #define BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_HANDLE_REQUEST_HPP -//[example_connection_pool_handle_request_hpp +//[example_http_server_cpp20_handle_request_hpp // // File: handle_request.hpp // diff --git a/example/3_advanced/http_server_cpp20/repository.cpp b/example/3_advanced/http_server_cpp20/repository.cpp index 4f23780b3..2b95ca2d2 100644 --- a/example/3_advanced/http_server_cpp20/repository.cpp +++ b/example/3_advanced/http_server_cpp20/repository.cpp @@ -9,7 +9,7 @@ #include #if defined(BOOST_ASIO_HAS_CO_AWAIT) && BOOST_PFR_CORE_NAME_ENABLED -//[example_connection_pool_repository_cpp +//[example_http_server_cpp20_repository_cpp // // File: repository.cpp // diff --git a/example/3_advanced/http_server_cpp20/repository.hpp b/example/3_advanced/http_server_cpp20/repository.hpp index 1b5521562..df1e079a4 100644 --- a/example/3_advanced/http_server_cpp20/repository.hpp +++ b/example/3_advanced/http_server_cpp20/repository.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_REPOSITORY_HPP #define BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_REPOSITORY_HPP -//[example_connection_pool_repository_hpp +//[example_http_server_cpp20_repository_hpp // // File: repository.hpp // diff --git a/example/3_advanced/http_server_cpp20/server.cpp b/example/3_advanced/http_server_cpp20/server.cpp index 6197559d4..4718e9119 100644 --- a/example/3_advanced/http_server_cpp20/server.cpp +++ b/example/3_advanced/http_server_cpp20/server.cpp @@ -9,7 +9,7 @@ #include #if defined(BOOST_ASIO_HAS_CO_AWAIT) && BOOST_PFR_CORE_NAME_ENABLED -//[example_connection_pool_server_cpp +//[example_http_server_cpp20_server_cpp // // File: server.cpp // diff --git a/example/3_advanced/http_server_cpp20/types.hpp b/example/3_advanced/http_server_cpp20/types.hpp index db609cadb..d16caf91b 100644 --- a/example/3_advanced/http_server_cpp20/types.hpp +++ b/example/3_advanced/http_server_cpp20/types.hpp @@ -8,7 +8,7 @@ #ifndef BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_TYPES_HPP #define BOOST_MYSQL_EXAMPLE_3_ADVANCED_HTTP_SERVER_CPP20_TYPES_HPP -//[example_http_cpp20_types_hpp +//[example_http_server_cpp20_types_hpp // // File: types.hpp // diff --git a/tools/scripts/examples_qbk.py b/tools/scripts/examples_qbk.py index c16d4e02b..6f66860b8 100644 --- a/tools/scripts/examples_qbk.py +++ b/tools/scripts/examples_qbk.py @@ -129,6 +129,19 @@ class MultiExample(NamedTuple): ] ADVANCED_EXAMPLES = [ + MultiExample('http_server_cpp20', [ + '3_advanced/http_server_cpp20/main.cpp', + '3_advanced/http_server_cpp20/types.hpp', + '3_advanced/http_server_cpp20/error.hpp', + '3_advanced/http_server_cpp20/error.cpp', + '3_advanced/http_server_cpp20/repository.hpp', + '3_advanced/http_server_cpp20/repository.cpp', + '3_advanced/http_server_cpp20/handle_request.hpp', + '3_advanced/http_server_cpp20/handle_request.cpp', + '3_advanced/http_server_cpp20/server.hpp', + '3_advanced/http_server_cpp20/server.cpp', + ], 'A REST API server that uses C++20 coroutines'), + MultiExample('connection_pool', [ '3_advanced/connection_pool/main.cpp', '3_advanced/connection_pool/types.hpp', @@ -139,7 +152,7 @@ class MultiExample(NamedTuple): '3_advanced/connection_pool/server.hpp', '3_advanced/connection_pool/server.cpp', '3_advanced/connection_pool/log_error.hpp', - ], 'A REST API server that uses connection pooling') + ], 'A REST API server that uses asio::yield_context'), ] ALL_EXAMPLES = TUTORIALS + SIMPLE_EXAMPLES + ADVANCED_EXAMPLES