From 0ba8b09da7ddba82545977976e55837bd8e6a8cc Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Mon, 16 Dec 2024 14:11:00 +0100 Subject: [PATCH] Add to qbks --- doc/qbk/00_main.qbk | 10 ++++++ doc/qbk/21_examples.qbk | 31 ++++++++++++++++++- .../http_server_cpp20/handle_request.cpp | 2 +- .../http_server_cpp20/handle_request.hpp | 2 +- .../http_server_cpp20/repository.cpp | 2 +- .../http_server_cpp20/repository.hpp | 2 +- .../3_advanced/http_server_cpp20/server.cpp | 2 +- .../3_advanced/http_server_cpp20/types.hpp | 2 +- tools/scripts/examples_qbk.py | 15 ++++++++- 9 files changed, 60 insertions(+), 8 deletions(-) diff --git a/doc/qbk/00_main.qbk b/doc/qbk/00_main.qbk index 520e2d3e..2d3ce7c8 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 c4246be0..7d06790a 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 7f5e67d0..60b3af32 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 99a12347..5a8b8046 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 4f23780b..2b95ca2d 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 1b552156..df1e079a 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 6197559d..4718e911 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 db609cad..d16caf91 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 c16d4e02..6f66860b 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