From 159895fbd32f10b3f955c8f0b3ef7326e784cfe9 Mon Sep 17 00:00:00 2001 From: Soo-Hwan Na Date: Tue, 27 Feb 2024 09:52:48 +0900 Subject: tgbot-cpp: Update C++ STL to 17 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 290d201..fcc1bc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ option(BUILD_SHARED_LIBS "Build tgbot-cpp shared/static library." OFF) option(BUILD_DOCUMENTATION "Build doxygen API documentation." OFF) # sources -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) if(WIN32) -- cgit v1.2.3 From f28792e5c73f8c9d6bfa8651b2104bd0917ce98e Mon Sep 17 00:00:00 2001 From: Soo-Hwan Na Date: Tue, 27 Feb 2024 09:55:26 +0900 Subject: tgbot-cpp: InputFile: Use std::fs for getting filename - A platform independent way, to fix Windows-style directory delimiters --- src/types/InputFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/InputFile.cpp b/src/types/InputFile.cpp index c74c73e..c4d804d 100644 --- a/src/types/InputFile.cpp +++ b/src/types/InputFile.cpp @@ -1,7 +1,7 @@ #include "tgbot/types/InputFile.h" -#include "tgbot/tools/StringTools.h" #include "tgbot/tools/FileTools.h" +#include #include #include @@ -13,7 +13,7 @@ InputFile::Ptr InputFile::fromFile(const string& filePath, const string& mimeTyp auto result(make_shared()); result->data = FileTools::read(filePath); result->mimeType = mimeType; - result->fileName = StringTools::split(filePath, '/').back(); + result->fileName = std::filesystem::path(filePath).filename().string(); return result; } -- cgit v1.2.3 From a92beb1d03d9df51667207b2f529a2a4a39b0d8f Mon Sep 17 00:00:00 2001 From: Soo Hwan Na Date: Tue, 27 Feb 2024 14:04:38 +0900 Subject: tgbot-cpp: Slience a pragma warning seen with boost placeholders --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcc1bc4..d376267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,7 @@ link_directories(${Boost_LIBRARY_DIR_RELEASE}) if(NOT Boost_USE_STATIC_LIBS) add_definitions(-DBOOST_ALL_DYN_LINK) endif() +add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS) set(LIB_LIST ${CMAKE_THREAD_LIBS_INIT} -- cgit v1.2.3