Skip to content

Commit

Permalink
Add to qbks
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Dec 16, 2024
1 parent 845f01b commit 0ba8b09
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 8 deletions.
10 changes: 10 additions & 0 deletions doc/qbk/00_main.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
31 changes: 30 additions & 1 deletion doc/qbk/21_examples.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/handle_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/pfr/config.hpp>
#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
//
Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/handle_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/repository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/pfr/config.hpp>
#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
//
Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/repository.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <boost/pfr/config.hpp>
#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
//
Expand Down
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
15 changes: 14 additions & 1 deletion tools/scripts/examples_qbk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand Down

0 comments on commit 0ba8b09

Please sign in to comment.