From 4f67fdcf79f44c79805eba373640260bdf451356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 12 Jan 2024 17:59:29 +0100 Subject: [PATCH 1/4] Update vcpkg.json file (new version, name and url) --- vcpkg.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 10ba070..b2b718f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,10 +1,10 @@ { - "name": "github-api", - "version-string": "1.0.0", + "name": "cpp_restapi", + "version-string": "2.0.0", "port-version": 1, - "homepage": "https://github.com/Kicer86/github_api", - "description": "This is a c++ library for accessing GitHub REST API v3.", + "homepage": "https://github.com/Kicer86/cpp_restapi", + "description": "A c++ Rest API library", "dependencies": [ "jsoncpp" ] From eba9f34310e97fe2553d83630a6e646c0e16765a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 12 Jan 2024 18:07:48 +0100 Subject: [PATCH 2/4] Update agent name --- src/curl_backend/connection.cpp | 2 +- src/qt_backend/connection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/curl_backend/connection.cpp b/src/curl_backend/connection.cpp index 27da0d5..940b90c 100644 --- a/src/curl_backend/connection.cpp +++ b/src/curl_backend/connection.cpp @@ -73,7 +73,7 @@ namespace cpp_restapi::CurlBackend curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &result); curl_easy_setopt(curl, CURLOPT_HEADERDATA, &header_links); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "github_api/1.0"); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "cpp_restapi/2.0"); const auto header_entries = getHeaderEntries(); diff --git a/src/qt_backend/connection.cpp b/src/qt_backend/connection.cpp index a03ae62..9924085 100644 --- a/src/qt_backend/connection.cpp +++ b/src/qt_backend/connection.cpp @@ -87,7 +87,7 @@ namespace cpp_restapi::QtBackend for(const auto& [k, v]: header_entries) request.setRawHeader(k.c_str(), v.c_str()); - request.setRawHeader("User-Agent", "github_api/1.0"); + request.setRawHeader("User-Agent", "cpp_restapi/2.0"); return request; } From 01f7e12b6d44b0e09a34e5b48ae48a76f9e6c788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 12 Jan 2024 18:08:01 +0100 Subject: [PATCH 3/4] Drop remaining leftovers --- CMakeLists.txt | 2 -- README.md | 2 +- examples/CMakeLists.txt | 4 ++-- tests/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f23fb37..7d8876f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,6 @@ target_link_libraries(cpp_restapi generate_export_header(cpp_restapi) -add_library(github_api ALIAS cpp_restapi) - if(NOT CppRestAPI_QtBackend AND NOT CppRestAPI_CurlBackend) message(FATAL_ERROR "No backend was chosen. Set either CppRestAPI_QtBackend or CppRestAPI_CurlBackend variable to ON") endif() diff --git a/README.md b/README.md index 29158e2..b9057ae 100644 --- a/README.md +++ b/README.md @@ -166,4 +166,4 @@ Also please look into 'examples' directory for details. ## Links -Code documentation available at https://kicer86.github.io/github_api/index.html +Code documentation available at https://kicer86.github.io/cpp_restapi/index.html diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 299be19..cb7d13c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -10,7 +10,7 @@ endif() set(CppRestAPI_UseQt6 ${Qt6_FOUND}) set(CppRestAPI_QtBackend ON) set(CppRestAPI_CurlBackend ON) -add_subdirectory(.. cpp_restapi_root) #include directory with github_api +add_subdirectory(.. cpp_restapi_root) #include directory with cpp_restapi add_executable(qt_example qt_example.cpp) add_executable(curl_example curl_example.cpp) @@ -19,7 +19,7 @@ add_executable(bare_qt_connection_example bare_qt_connection_example.cpp) target_link_libraries(qt_example PRIVATE - github_api + cpp_restapi Qt::Network ) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f9bfefb..00868f4 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,7 +24,7 @@ target_link_libraries(api_tests httpmockserver microhttpd - github_api + cpp_restapi ) target_include_directories(api_tests From 7bb80b2421622a95368b92382b9f6f9e53d90dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Walenciak?= Date: Fri, 12 Jan 2024 18:12:04 +0100 Subject: [PATCH 4/4] Use valid vcpkg name --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index b2b718f..7e7918f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { - "name": "cpp_restapi", + "name": "cpp-restapi", "version-string": "2.0.0", "port-version": 1, "homepage": "https://github.com/Kicer86/cpp_restapi",