Skip to content
Merged

Work2 #142

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
25 changes: 25 additions & 0 deletions .cursorignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/bin
/bin64

/__build__
/toolchain.cmake

# Emacs
*#

# Vim
*~

# Visual Studio
/.vs
/out

# Visual Studio Code
/.vscode
CMakeUserPresets.json

# clangd
/.cache
/.clangd
/compile_commands.json
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
97 changes: 0 additions & 97 deletions .github/workflows/ci-failure-auto-fix.yml

This file was deleted.

58 changes: 0 additions & 58 deletions .github/workflows/claude.yml

This file was deleted.

1 change: 1 addition & 0 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

add_subdirectory(client)
add_subdirectory(server)
add_subdirectory(cpp20)
1 change: 1 addition & 0 deletions example/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@

build-project client ;
build-project server ;
build-project cpp20 ;
69 changes: 36 additions & 33 deletions example/client/burl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,51 @@
# Official repository: https://github.com/cppalliance/beast2
#

if (CMAKE_CXX_STANDARD EQUAL 20)
file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS *.cpp *.hpp
CMakeLists.txt
Jamfile)
if(NOT cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
return()
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${PFILES})
file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS *.cpp *.hpp
CMakeLists.txt
Jamfile)

add_executable(beast2_example_client_burl ${PFILES})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${PFILES})

target_compile_definitions(beast2_example_client_burl
PRIVATE BOOST_ASIO_NO_DEPRECATED)
add_executable(beast2_example_client_burl ${PFILES})

set_property(TARGET beast2_example_client_burl
PROPERTY FOLDER "examples")
target_compile_definitions(beast2_example_client_burl
PRIVATE BOOST_ASIO_NO_DEPRECATED)

find_package(OpenSSL REQUIRED)
set_property(TARGET beast2_example_client_burl
PROPERTY FOLDER "examples")

target_link_libraries(beast2_example_client_burl
Boost::beast2
Boost::url
Boost::program_options
Boost::scope
OpenSSL::SSL
OpenSSL::Crypto)
find_package(OpenSSL REQUIRED)

if (WIN32)
target_link_libraries(beast2_example_client_burl crypt32)
endif()
target_compile_features(beast2_example_client_burl PUBLIC cxx_std_20)

if (TARGET Boost::capy_zlib)
target_link_libraries(beast2_example_client_burl Boost::capy_zlib)
endif()
target_link_libraries(beast2_example_client_burl
Boost::beast2
Boost::url
Boost::program_options
Boost::scope
OpenSSL::SSL
OpenSSL::Crypto)

if (TARGET Boost::capy_brotli)
target_link_libraries(beast2_example_client_burl Boost::capy_brotli)
endif()
if (WIN32)
target_link_libraries(beast2_example_client_burl crypt32)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Libpsl)
if (Libpsl_FOUND)
target_link_libraries(beast2_example_client_burl Libpsl::Libpsl)
target_compile_definitions(beast2_example_client_burl PRIVATE BURL_HAS_LIBPSL)
endif ()
if (TARGET Boost::capy_zlib)
target_link_libraries(beast2_example_client_burl Boost::capy_zlib)
endif()

if (TARGET Boost::capy_brotli)
target_link_libraries(beast2_example_client_burl Boost::capy_brotli)
endif()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Libpsl)
if (Libpsl_FOUND)
target_link_libraries(beast2_example_client_burl Libpsl::Libpsl)
target_compile_definitions(beast2_example_client_burl PRIVATE BURL_HAS_LIBPSL)
endif ()
5 changes: 3 additions & 2 deletions example/client/burl/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "message.hpp"
#include "mime_type.hpp"

#include <boost/capy/file.hpp>
#include <boost/http_proto/field.hpp>
#include <boost/system/system_error.hpp>

Expand Down Expand Up @@ -77,9 +78,9 @@ file_body::content_length() const
http_proto::file_source
file_body::body() const
{
http_proto::file file;
boost::capy::file file;
error_code ec;
file.open(path_.c_str(), http_proto::file_mode::read, ec);
file.open(path_.c_str(), boost::capy::file_mode::read, ec);
if(ec)
throw system_error{ ec };

Expand Down
7 changes: 4 additions & 3 deletions example/client/burl/multipart_form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@

#include <boost/buffers/copy.hpp>
#include <boost/buffers/slice.hpp>
#include <boost/http_proto/file.hpp>
#include <boost/capy/file.hpp>
#include <boost/system/system_error.hpp>

#include <filesystem>
#include <random>

namespace capy = boost::capy;
namespace core = boost::core;
namespace fs = std::filesystem;
using system_error = boost::system::system_error;
Expand Down Expand Up @@ -171,9 +172,9 @@ multipart_form::source::on_read(buffers::mutable_buffer mb)

auto read = [&](const std::string& path, uint64_t size)
{
http_proto::file file;
capy::file file;

file.open(path.c_str(), http_proto::file_mode::read, rs.ec);
file.open(path.c_str(), capy::file_mode::read, rs.ec);
if(rs.ec)
return false;

Expand Down
31 changes: 17 additions & 14 deletions example/client/jsonrpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# Official repository: https://github.com/cppalliance/beast2
#

if(NOT cxx_std_20 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
return()
endif()

file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS *.cpp *.hpp
CMakeLists.txt
Jamfile)
Expand Down Expand Up @@ -52,17 +56,16 @@ if (TARGET Boost::capy_brotli)
endif()

# CPP20 Example
if (CMAKE_CXX_STANDARD EQUAL 20)
add_executable(beast2_example_client_jsonrpc_cpp20 cpp20.cpp eth_methods.hpp Jamfile)
set_property(TARGET beast2_example_client_jsonrpc_cpp20
PROPERTY FOLDER "examples")
target_link_libraries(beast2_example_client_jsonrpc_cpp20
PRIVATE
beast2_example_client_jsonrpc_lib)
if (TARGET Boost::capy_zlib)
target_link_libraries(beast2_example_client_jsonrpc_cpp20 PRIVATE Boost::capy_zlib)
endif()
if (TARGET Boost::capy_brotli)
target_link_libraries(beast2_example_client_jsonrpc_cpp20 PRIVATE Boost::capy_brotli)
endif()
endif ()
add_executable(beast2_example_client_jsonrpc_cpp20 cpp20.cpp eth_methods.hpp Jamfile)
set_property(TARGET beast2_example_client_jsonrpc_cpp20
PROPERTY FOLDER "examples")
target_compile_features(beast2_example_client_jsonrpc_cpp20 PUBLIC cxx_std_20)
target_link_libraries(beast2_example_client_jsonrpc_cpp20
PRIVATE
beast2_example_client_jsonrpc_lib)
if (TARGET Boost::capy_zlib)
target_link_libraries(beast2_example_client_jsonrpc_cpp20 PRIVATE Boost::capy_zlib)
endif()
if (TARGET Boost::capy_brotli)
target_link_libraries(beast2_example_client_jsonrpc_cpp20 PRIVATE Boost::capy_brotli)
endif()
10 changes: 10 additions & 0 deletions example/cpp20/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/cppalliance/beast2
#

add_subdirectory(co_spawn)
10 changes: 10 additions & 0 deletions example/cpp20/Jamfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Official repository: https://github.com/cppalliance/beast2
#

build-project co_spawn ;
Loading
Loading