1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2026-01-19 13:44:41 +01:00

Update libraries and make it build on windows.

Still gets some warnings because compilers have changed. But should work.
This commit is contained in:
Sandu Liviu Catalin
2025-06-25 22:34:23 +03:00
parent 520a5eacc5
commit f2b7499f85
3038 changed files with 251668 additions and 273857 deletions

View File

@@ -10,18 +10,10 @@ POCO_HEADERS_AUTO(SRCS ${HDRS_G})
POCO_SOURCES_AUTO_PLAT(SRCS UNIX src/SyslogChannel.cpp)
POCO_HEADERS_AUTO(SRCS include/Poco/SyslogChannel.h)
# For Windows CE we need to disable these
if(WINCE)
POCO_SOURCES_AUTO_PLAT(SRCS OFF
src/WindowsConsoleChannel.cpp
src/EventLogChannel.cpp
)
else()
POCO_SOURCES_AUTO_PLAT(SRCS WIN32
src/WindowsConsoleChannel.cpp
src/EventLogChannel.cpp
)
endif()
# Version Resource
if(MSVC AND BUILD_SHARED_LIBS)
@@ -37,6 +29,7 @@ POCO_MESSAGES(SRCS Logging src/pocomsg.mc)
if(POCO_UNBUNDLED)
find_package(PCRE2 REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Utf8Proc REQUIRED)
#HACK: Unicode.cpp requires functions from these files. The can't be taken from the library
POCO_SOURCES(SRCS RegExp
@@ -49,6 +42,7 @@ else()
POCO_SOURCES(SRCS pcre2
src/pcre2_auto_possess.c
src/pcre2_chartables.c
src/pcre2_chkdint.c
src/pcre2_compile.c
src/pcre2_config.c
src/pcre2_context.c
@@ -76,12 +70,6 @@ else()
src/pcre2_xclass.c
)
# zlib
POCO_HEADERS(SRCS zlib
include/Poco/zconf.h
include/Poco/zlib.h
)
POCO_SOURCES(SRCS zlib
src/adler32.c
src/compress.c
@@ -94,6 +82,10 @@ else()
src/trees.c
src/zutil.c
)
POCO_SOURCES(SRCS utf8proc
src/utf8proc.c
)
endif(POCO_UNBUNDLED)
@@ -106,15 +98,15 @@ set_target_properties(Foundation
DEFINE_SYMBOL Foundation_EXPORTS
)
if (GNUC OR MINGW)
target_compile_options(Foundation PUBLIC -Wno-deprecated-declarations)
endif()
if(POCO_UNBUNDLED)
target_link_libraries(Foundation PUBLIC Pcre2::Pcre2 ZLIB::ZLIB)
target_link_libraries(Foundation PRIVATE Pcre2::Pcre2 ZLIB::ZLIB Utf8Proc::Utf8Proc)
target_compile_definitions(Foundation PUBLIC POCO_UNBUNDLED)
else()
target_compile_definitions(Foundation PUBLIC UTF8PROC_STATIC)
endif(POCO_UNBUNDLED)
target_compile_definitions(Foundation PUBLIC POCO_CMAKE)
target_include_directories(Foundation
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -139,10 +131,9 @@ if(NOT DISABLE_CPP14 AND CMAKE_VERSION VERSION_GREATER "3.8")
endif()
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(Foundation
PUBLIC
POCO_STATIC
)
# The define must be set here to be included in the generated CMake files
# and properly detect build in the installed files.
target_compile_definitions(Foundation PUBLIC POCO_STATIC)
endif()
if(WIN32)
@@ -170,8 +161,10 @@ else()
target_compile_definitions(Foundation PUBLIC POCO_HAVE_FD_POLL)
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_compile_definitions(Foundation PUBLIC _XOPEN_SOURCE=500 POCO_HAVE_FD_POLL)
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
target_link_libraries(Foundation PUBLIC ${CMAKE_DL_LIBS} rt Threads::Threads)
else()
target_compile_definitions(Foundation PUBLIC _XOPEN_SOURCE=500 POCO_HAVE_FD_EPOLL)
target_link_libraries(Foundation PUBLIC pthread ${CMAKE_DL_LIBS} rt)
@@ -180,6 +173,10 @@ else()
endif(UNIX AND NOT ANDROID)
endif(CYGWIN)
if(ENABLE_TRACE)
target_link_libraries(Foundation PRIVATE Poco::Trace)
endif()
if(CMAKE_SYSTEM MATCHES "SunOS")
target_compile_definitions(Foundation
PUBLIC
@@ -193,7 +190,7 @@ if(CMAKE_SYSTEM MATCHES "SunOS")
target_link_libraries(Foundation PUBLIC pthread socket xnet nsl resolv rt ${CMAKE_DL_LIBS})
endif()
if(CMAKE_COMPILER_IS_MINGW)
if(MINGW)
target_compile_definitions(Foundation
PUBLIC
WC_NO_BEST_FIT_CHARS=0x400
@@ -212,6 +209,11 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro")
target_compile_options(Foundation PUBLIC -library=stlport4)
endif()
# AIX
if("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX")
target_compile_definitions(Foundation PUBLIC POCO_NO_THREADNAME)
endif()
# iOS
if(IOS)
target_compile_definitions(Foundation
@@ -238,10 +240,17 @@ endif()
POCO_INSTALL(Foundation)
POCO_GENERATE_PACKAGE(Foundation)
if(ENABLE_SAMPLES)
add_subdirectory(samples)
endif()
if(ENABLE_TESTS)
if(NOT BUILD_SHARED_LIBS)
set_property(TARGET Foundation PROPERTY POSITION_INDEPENDENT_CODE ON) # This is needed to build TestLibrary.so as shared.
endif()
add_subdirectory(samples)
add_subdirectory(testsuite)
endif()
if(ENABLE_FUZZING)
add_subdirectory(fuzzing)
endif()

View File

@@ -1,150 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Foundation", "Foundation_vs140.vcxproj", "{B01196CC-B693-4548-8464-2FF60499E73F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs140.vcxproj", "{F1EE93DF-347F-4CB3-B191-C4E63F38E972}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestApp", "testsuite\TestApp_vs140.vcxproj", "{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLibrary", "testsuite\TestLibrary_vs140.vcxproj", "{0955EB03-544B-4BD4-9C10-89CF38078F5F}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug_shared|Win32 = debug_shared|Win32
debug_shared|x64 = debug_shared|x64
debug_static_md|Win32 = debug_static_md|Win32
debug_static_md|x64 = debug_static_md|x64
debug_static_mt|Win32 = debug_static_mt|Win32
debug_static_mt|x64 = debug_static_mt|x64
release_shared|Win32 = release_shared|Win32
release_shared|x64 = release_shared|x64
release_static_md|Win32 = release_static_md|Win32
release_static_md|x64 = release_static_md|x64
release_static_mt|Win32 = release_static_mt|Win32
release_static_mt|x64 = release_static_mt|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.Build.0 = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|x64.ActiveCfg = debug_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|x64.Build.0 = debug_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|x64.Build.0 = debug_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.ActiveCfg = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.Build.0 = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.Deploy.0 = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|x64.ActiveCfg = release_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|x64.Build.0 = release_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.Build.0 = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|x64.ActiveCfg = release_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|x64.Build.0 = release_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|x64.Build.0 = release_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.Build.0 = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|x64.ActiveCfg = debug_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|x64.Build.0 = debug_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|x64.Build.0 = debug_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.ActiveCfg = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.Build.0 = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.Deploy.0 = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|x64.ActiveCfg = release_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|x64.Build.0 = release_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.Build.0 = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|x64.ActiveCfg = release_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|x64.Build.0 = release_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|x64.Build.0 = release_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|Win32.Build.0 = debug_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|x64.ActiveCfg = debug_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|x64.Build.0 = debug_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|x64.Build.0 = debug_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|Win32.ActiveCfg = release_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|Win32.Build.0 = release_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|x64.ActiveCfg = release_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|x64.Build.0 = release_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|Win32.Build.0 = release_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|x64.ActiveCfg = release_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|x64.Build.0 = release_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|x64.Build.0 = release_static_mt|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|x64.Build.0 = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|x64.Build.0 = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|x64.Build.0 = release_shared|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,150 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Foundation", "Foundation_vs150.vcxproj", "{B01196CC-B693-4548-8464-2FF60499E73F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSuite", "testsuite\TestSuite_vs150.vcxproj", "{F1EE93DF-347F-4CB3-B191-C4E63F38E972}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestApp", "testsuite\TestApp_vs150.vcxproj", "{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestLibrary", "testsuite\TestLibrary_vs150.vcxproj", "{0955EB03-544B-4BD4-9C10-89CF38078F5F}"
ProjectSection(ProjectDependencies) = postProject
{B01196CC-B693-4548-8464-2FF60499E73F} = {B01196CC-B693-4548-8464-2FF60499E73F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
debug_shared|Win32 = debug_shared|Win32
debug_shared|x64 = debug_shared|x64
debug_static_md|Win32 = debug_static_md|Win32
debug_static_md|x64 = debug_static_md|x64
debug_static_mt|Win32 = debug_static_mt|Win32
debug_static_mt|x64 = debug_static_mt|x64
release_shared|Win32 = release_shared|Win32
release_shared|x64 = release_shared|x64
release_static_md|Win32 = release_static_md|Win32
release_static_md|x64 = release_static_md|x64
release_static_mt|Win32 = release_static_mt|Win32
release_static_mt|x64 = release_static_mt|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.Build.0 = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|x64.ActiveCfg = debug_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_shared|x64.Build.0 = debug_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_md|x64.Build.0 = debug_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.ActiveCfg = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.Build.0 = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|Win32.Deploy.0 = release_shared|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|x64.ActiveCfg = release_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_shared|x64.Build.0 = release_shared|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.Build.0 = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|x64.ActiveCfg = release_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_md|x64.Build.0 = release_static_md|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{B01196CC-B693-4548-8464-2FF60499E73F}.release_static_mt|x64.Build.0 = release_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.Build.0 = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|Win32.Deploy.0 = debug_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|x64.ActiveCfg = debug_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_shared|x64.Build.0 = debug_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|Win32.Deploy.0 = debug_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_md|x64.Build.0 = debug_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|Win32.Deploy.0 = debug_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.ActiveCfg = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.Build.0 = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|Win32.Deploy.0 = release_shared|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|x64.ActiveCfg = release_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_shared|x64.Build.0 = release_shared|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.Build.0 = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|Win32.Deploy.0 = release_static_md|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|x64.ActiveCfg = release_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_md|x64.Build.0 = release_static_md|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|Win32.Deploy.0 = release_static_mt|Win32
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{F1EE93DF-347F-4CB3-B191-C4E63F38E972}.release_static_mt|x64.Build.0 = release_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|Win32.Build.0 = debug_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|x64.ActiveCfg = debug_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_shared|x64.Build.0 = debug_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|Win32.ActiveCfg = debug_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|Win32.Build.0 = debug_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|x64.ActiveCfg = debug_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_md|x64.Build.0 = debug_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|Win32.ActiveCfg = debug_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|Win32.Build.0 = debug_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|x64.ActiveCfg = debug_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.debug_static_mt|x64.Build.0 = debug_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|Win32.ActiveCfg = release_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|Win32.Build.0 = release_shared|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|x64.ActiveCfg = release_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_shared|x64.Build.0 = release_shared|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|Win32.ActiveCfg = release_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|Win32.Build.0 = release_static_md|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|x64.ActiveCfg = release_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_md|x64.Build.0 = release_static_md|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|Win32.ActiveCfg = release_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|Win32.Build.0 = release_static_mt|Win32
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|x64.ActiveCfg = release_static_mt|x64
{6C41E55D-C0FC-4E01-AA8D-B7DA40E31D3A}.release_static_mt|x64.Build.0 = release_static_mt|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_shared|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_md|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|Win32.ActiveCfg = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|Win32.Build.0 = debug_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|x64.ActiveCfg = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.debug_static_mt|x64.Build.0 = debug_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_shared|x64.Build.0 = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_md|x64.Build.0 = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|Win32.ActiveCfg = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|Win32.Build.0 = release_shared|Win32
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|x64.ActiveCfg = release_shared|x64
{0955EB03-544B-4BD4-9C10-89CF38078F5F}.release_static_mt|x64.Build.0 = release_shared|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -55,6 +55,7 @@
<ProjectGuid>{B01196CC-B693-4548-8464-2FF60499E73F}</ProjectGuid>
<RootNamespace>Foundation</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
@@ -227,7 +228,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -241,6 +242,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -258,7 +260,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -273,6 +275,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -293,7 +296,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -305,6 +308,7 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -327,7 +331,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -342,6 +346,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -359,7 +364,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -374,6 +379,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmtd.lib</OutputFile>
@@ -384,7 +390,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -400,6 +406,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmtd.lib</OutputFile>
@@ -413,7 +420,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -425,6 +432,7 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmt.lib</OutputFile>
@@ -439,7 +447,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -454,6 +462,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmt.lib</OutputFile>
@@ -463,7 +472,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -478,6 +487,7 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmdd.lib</OutputFile>
@@ -488,7 +498,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -504,6 +514,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmdd.lib</OutputFile>
@@ -517,7 +528,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -530,6 +541,7 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<AdditionalDependencies>
@@ -546,7 +558,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -562,6 +574,7 @@
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Lib>
<AdditionalDependencies>
@@ -577,6 +590,7 @@
<ClCompile Include="src\Ascii.cpp" />
<ClCompile Include="src\ASCIIEncoding.cpp" />
<ClCompile Include="src\AsyncChannel.cpp" />
<ClCompile Include="src\AsyncNotificationCenter.cpp" />
<ClCompile Include="src\AtomicCounter.cpp" />
<ClCompile Include="src\Base32Decoder.cpp" />
<ClCompile Include="src\Base32Encoder.cpp" />
@@ -859,6 +873,7 @@
<ClCompile Include="src\inflate.c" />
<ClCompile Include="src\InflatingStream.cpp" />
<ClCompile Include="src\inftrees.c" />
<ClCompile Include="src\JSONFormatter.cpp" />
<ClCompile Include="src\JSONString.cpp" />
<ClCompile Include="src\Latin1Encoding.cpp" />
<ClCompile Include="src\Latin2Encoding.cpp" />
@@ -961,6 +976,38 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\BufferedBidirectionalStreamBuf.cpp" />
<ClCompile Include="src\BufferedStreamBuf.cpp" />
<ClCompile Include="src\UnbufferedStreamBuf.cpp" />
<ClCompile Include="src\FileStreamRWLock.cpp" />
<ClCompile Include="src\FileStreamRWLock_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\FileStreamRWLock_WIN32.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\NamedMutex.cpp" />
<ClCompile Include="src\NamedMutex_UNIX.cpp">
@@ -1032,6 +1079,7 @@
<ClCompile Include="src\PatternFormatter.cpp" />
<ClCompile Include="src\pcre2_auto_possess.c" />
<ClCompile Include="src\pcre2_chartables.c" />
<ClCompile Include="src\pcre2_chkdint.c" />
<ClCompile Include="src\pcre2_compile.c" />
<ClCompile Include="src\pcre2_config.c" />
<ClCompile Include="src\pcre2_context.c" />
@@ -1099,6 +1147,7 @@
</ClCompile>
<ClCompile Include="src\pcre2_valid_utf.c" />
<ClCompile Include="src\pcre2_xclass.c" />
<ClCompile Include="src\PIDFile.cpp" />
<ClCompile Include="src\Pipe.cpp" />
<ClCompile Include="src\PipeImpl.cpp" />
<ClCompile Include="src\PipeImpl_DUMMY.cpp">
@@ -1174,6 +1223,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\ProcessRunner.cpp" />
<ClCompile Include="src\PurgeStrategy.cpp" />
<ClCompile Include="src\Random.cpp" />
<ClCompile Include="src\RandomStream.cpp" />
@@ -1391,6 +1441,7 @@
<ClCompile Include="src\Thread.cpp" />
<ClCompile Include="src\ThreadLocal.cpp" />
<ClCompile Include="src\ThreadPool.cpp" />
<ClCompile Include="src\ActiveThreadPool.cpp" />
<ClCompile Include="src\ThreadTarget.cpp" />
<ClCompile Include="src\Thread_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
@@ -1463,12 +1514,28 @@
<ClCompile Include="src\UTF16Encoding.cpp" />
<ClCompile Include="src\UTF32Encoding.cpp" />
<ClCompile Include="src\UTF8Encoding.cpp" />
<ClCompile Include="src\utf8proc.c" />
<ClCompile Include="src\utf8proc_data.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\UTF8String.cpp" />
<ClCompile Include="src\UUID.cpp" />
<ClCompile Include="src\UUIDGenerator.cpp" />
<ClCompile Include="src\Var.cpp" />
<ClCompile Include="src\VarHolder.cpp" />
<ClCompile Include="src\VarIterator.cpp" />
<ClCompile Include="src\VarVisitor.cpp" />
<ClCompile Include="src\Void.cpp" />
<ClCompile Include="src\Windows1250Encoding.cpp" />
<ClCompile Include="src\Windows1251Encoding.cpp" />
@@ -1492,12 +1559,15 @@
<ClInclude Include="include\Poco\ActiveResult.h" />
<ClInclude Include="include\Poco\ActiveRunnable.h" />
<ClInclude Include="include\Poco\ActiveStarter.h" />
<ClInclude Include="include\Poco\ActiveThreadPool.h" />
<ClInclude Include="include\Poco\Activity.h" />
<ClInclude Include="include\Poco\Any.h" />
<ClInclude Include="include\Poco\ArchiveStrategy.h" />
<ClInclude Include="include\Poco\Ascii.h" />
<ClInclude Include="include\Poco\ASCIIEncoding.h" />
<ClInclude Include="include\Poco\AsyncChannel.h" />
<ClInclude Include="include\Poco\AsyncObserver.h" />
<ClInclude Include="include\Poco\AsyncNotificationCenter.h" />
<ClInclude Include="include\Poco\AtomicCounter.h" />
<ClInclude Include="include\Poco\AutoPtr.h" />
<ClInclude Include="include\Poco\AutoReleasePool.h" />
@@ -1575,6 +1645,9 @@
<ClInclude Include="include\Poco\FileStreamFactory.h" />
<ClInclude Include="include\Poco\FileStream_POSIX.h" />
<ClInclude Include="include\Poco\FileStream_WIN32.h" />
<ClInclude Include="include\Poco\FileStreamRWLock.h" />
<ClInclude Include="include\Poco\FileStreamRWLock_POSIX.h" />
<ClInclude Include="include\Poco\FileStreamRWLock_WIN32.h" />
<ClInclude Include="include\Poco\File_UNIX.h" />
<ClInclude Include="include\Poco\File_WIN32U.h" />
<ClInclude Include="include\Poco\Format.h" />
@@ -1601,6 +1674,7 @@
<ClInclude Include="include\Poco\HMACEngine.h" />
<ClInclude Include="include\Poco\InflatingStream.h" />
<ClInclude Include="include\Poco\Instantiator.h" />
<ClInclude Include="include\Poco\JSONFormatter.h" />
<ClInclude Include="include\Poco\JSONString.h" />
<ClInclude Include="include\Poco\KeyValueArgs.h" />
<ClInclude Include="include\Poco\Latin1Encoding.h" />
@@ -1659,6 +1733,7 @@
<ClInclude Include="include\Poco\Path_WIN32U.h" />
<ClInclude Include="include\Poco\PatternFormatter.h" />
<ClInclude Include="include\Poco\PBKDF2Engine.h" />
<ClInclude Include="include\Poco\PIDFile.h" />
<ClInclude Include="include\Poco\Pipe.h" />
<ClInclude Include="include\Poco\PipeImpl.h" />
<ClInclude Include="include\Poco\PipeImpl_DUMMY.h" />
@@ -1677,6 +1752,7 @@
<ClInclude Include="include\Poco\Process.h" />
<ClInclude Include="include\Poco\Process_UNIX.h" />
<ClInclude Include="include\Poco\Process_WIN32U.h" />
<ClInclude Include="include\Poco\ProcessRunner.h" />
<ClInclude Include="include\Poco\PurgeStrategy.h" />
<ClInclude Include="include\Poco\Random.h" />
<ClInclude Include="include\Poco\RandomStream.h" />
@@ -1786,6 +1862,7 @@
<ClInclude Include="src\pcre2_ucp.h" />
<ClInclude Include="src\pocomsg.h" />
<ClInclude Include="src\trees.h" />
<ClInclude Include="src\utf8proc.h" />
<ClInclude Include="src\zconf.h" />
<ClInclude Include="src\zlib.h" />
<ClInclude Include="src\zutil.h" />
@@ -1849,4 +1926,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>

View File

@@ -187,6 +187,12 @@
<Filter Include="RegularExpression\PCRE2 Source Files">
<UniqueIdentifier>{f19826b3-7a4b-4d64-aaa3-eb1e084a71b2}</UniqueIdentifier>
</Filter>
<Filter Include="Text\Utf8Proc Header Files">
<UniqueIdentifier>{a0832c5f-920b-4c5c-ae84-fe3d533f192d}</UniqueIdentifier>
</Filter>
<Filter Include="Text\Utf8Proc Source Files">
<UniqueIdentifier>{36ebb653-2b87-45e5-b47f-047a406c698a}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Ascii.cpp">
@@ -573,6 +579,9 @@
<ClCompile Include="src\AbstractObserver.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\AsyncNotificationCenter.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Notification.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
@@ -642,6 +651,9 @@
<ClCompile Include="src\NamedMutex_WIN32U.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\PIDFile.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Pipe.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
@@ -669,6 +681,9 @@
<ClCompile Include="src\Process_WIN32U.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\ProcessRunner.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SharedMemory.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
@@ -831,6 +846,9 @@
<ClCompile Include="src\pcre2_chartables.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_chkdint.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_compile.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
@@ -915,6 +933,19 @@
<ClCompile Include="src\pcre2_xclass.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\VarVisitor.cpp" />
<ClCompile Include="src\ActiveThreadPool.cpp">
<Filter>Threading\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utf8proc.c">
<Filter>Text\Utf8Proc Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utf8proc_data.c">
<Filter>Text\Utf8Proc Source Files</Filter>
</ClCompile>
<ClCompile Include="src\JSONFormatter.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\Poco\Any.h">
@@ -1442,6 +1473,12 @@
<ClInclude Include="include\Poco\NObserver.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\AsyncObserver.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\AsyncNotificationCenter.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\Notification.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
@@ -1514,6 +1551,9 @@
<ClInclude Include="include\Poco\NamedMutex_WIN32U.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\PIDFile.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\Pipe.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
@@ -1541,6 +1581,9 @@
<ClInclude Include="include\Poco\Process_WIN32U.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\ProcessRunner.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\SharedMemory.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
@@ -1853,6 +1896,15 @@
<ClInclude Include="src\pcre2_ucp.h">
<Filter>RegularExpression\PCRE2 Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\ActiveThreadPool.h">
<Filter>Threading\Header Files</Filter>
</ClInclude>
<ClInclude Include="src\utf8proc.h">
<Filter>Text\Utf8Proc Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\JSONFormatter.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\pocomsg.rc">

View File

@@ -79,6 +79,7 @@
<ProjectGuid>{B01196CC-B693-4548-8464-2FF60499E73F}</ProjectGuid>
<RootNamespace>Foundation</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'" Label="Configuration">
@@ -261,6 +262,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\binA64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">
<OutDir>..\bin\</OutDir>
@@ -274,6 +276,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\libA64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">
<OutDir>..\lib\</OutDir>
@@ -307,11 +310,23 @@
<OutDir>..\lib64\</OutDir>
<IntDir>obj64\Foundation\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'">
<OutDir>..\libA64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'">
<OutDir>..\libA64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'">
<OutDir>..\libA64\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">
<OutDir>..\libA64\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.\include;..\Trace\include;..\Trace\include\Poco\Trace;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -325,6 +340,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -341,8 +359,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.\include;..\Trace\include;..\Trace\include\Poco\Trace;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -356,6 +374,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -371,8 +392,8 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>.\include;..\Trace\include;..\Trace\include\Poco\Trace;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -386,13 +407,17 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>..\binA64\PocoFoundation64d.dll</OutputFile>
<OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>..\binA64\PocoFoundation64d.pdb</ProgramDatabaseFile>
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
<AdditionalLibraryDirectories>..\libA64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Console</SubSystem>
<ImportLibrary>..\libA64\PocoFoundationd.lib</ImportLibrary>
@@ -406,7 +431,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -418,6 +443,9 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -440,7 +468,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -454,6 +482,9 @@
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
@@ -475,7 +506,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;Foundation_EXPORTS;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -489,10 +520,14 @@
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>..\binA64\PocoFoundation64.dll</OutputFile>
<OutputFile>..\binA64\$(TargetName).dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>false</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\libA64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@@ -506,7 +541,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -521,6 +556,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmtd.lib</OutputFile>
@@ -531,7 +569,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -546,6 +584,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmtd.lib</OutputFile>
@@ -555,7 +596,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -565,14 +606,17 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<ProgramDataBaseFileName>..\libA64\PocoFoundationmtd.pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\libA64\PocoFoundationmtd.lib</OutputFile>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">
@@ -583,7 +627,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -595,6 +639,9 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmt.lib</OutputFile>
@@ -609,7 +656,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -623,6 +670,9 @@
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmt.lib</OutputFile>
@@ -636,7 +686,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -650,16 +700,19 @@
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\libA64\PocoFoundationmt.lib</OutputFile>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -674,6 +727,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib\PocoFoundationmdd.lib</OutputFile>
@@ -684,7 +740,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -699,6 +755,9 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\lib64\PocoFoundationmdd.lib</OutputFile>
@@ -708,7 +767,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -718,14 +777,17 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<ProgramDataBaseFileName>..\libA64\PocoFoundationmdd.pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<OutputFile>..\libA64\PocoFoundationmdd.lib</OutputFile>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">
@@ -736,7 +798,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -749,6 +811,9 @@
<DebugInformationFormat />
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<AdditionalDependencies>
@@ -765,7 +830,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -780,6 +845,9 @@
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<AdditionalDependencies>
@@ -795,7 +863,7 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<OmitFramePointers>true</OmitFramePointers>
<AdditionalIncludeDirectories>.\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;POCO_STATIC;UTF8PROC_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
@@ -804,17 +872,20 @@
<RuntimeTypeInfo>true</RuntimeTypeInfo>
<PrecompiledHeader>
</PrecompiledHeader>
<ProgramDataBaseFileName>$(IntDir)$(ProjectName).pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>$(OutDir)$(TargetName).pdb</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>
</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Lib>
<AdditionalDependencies>
</AdditionalDependencies>
<OutputFile>..\libA64\PocoFoundationmd.lib</OutputFile>
<OutputFile>$(OutDir)$(TargetName).lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
@@ -825,6 +896,7 @@
<ClCompile Include="src\Ascii.cpp" />
<ClCompile Include="src\ASCIIEncoding.cpp" />
<ClCompile Include="src\AsyncChannel.cpp" />
<ClCompile Include="src\AsyncNotificationCenter.cpp" />
<ClCompile Include="src\AtomicCounter.cpp" />
<ClCompile Include="src\Base32Decoder.cpp" />
<ClCompile Include="src\Base32Encoder.cpp" />
@@ -1203,6 +1275,7 @@
<ClCompile Include="src\inflate.c" />
<ClCompile Include="src\InflatingStream.cpp" />
<ClCompile Include="src\inftrees.c" />
<ClCompile Include="src\JSONFormatter.cpp" />
<ClCompile Include="src\JSONString.cpp" />
<ClCompile Include="src\Latin1Encoding.cpp" />
<ClCompile Include="src\Latin2Encoding.cpp" />
@@ -1341,6 +1414,50 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\BufferedBidirectionalStreamBuf.cpp" />
<ClCompile Include="src\BufferedStreamBuf.cpp" />
<ClCompile Include="src\UnbufferedStreamBuf.cpp" />
<ClCompile Include="src\FileStreamRWLock.cpp" />
<ClCompile Include="src\FileStreamRWLock_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\FileStreamRWLock_WIN32.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\NamedMutex.cpp" />
<ClCompile Include="src\NamedMutex_UNIX.cpp">
@@ -1436,6 +1553,7 @@
<ClCompile Include="src\PatternFormatter.cpp" />
<ClCompile Include="src\pcre2_auto_possess.c" />
<ClCompile Include="src\pcre2_chartables.c" />
<ClCompile Include="src\pcre2_chkdint.c" />
<ClCompile Include="src\pcre2_compile.c" />
<ClCompile Include="src\pcre2_config.c" />
<ClCompile Include="src\pcre2_context.c" />
@@ -1521,6 +1639,7 @@
</ClCompile>
<ClCompile Include="src\pcre2_valid_utf.c" />
<ClCompile Include="src\pcre2_xclass.c" />
<ClCompile Include="src\PIDFile.cpp" />
<ClCompile Include="src\Pipe.cpp" />
<ClCompile Include="src\PipeImpl.cpp" />
<ClCompile Include="src\PipeImpl_DUMMY.cpp">
@@ -1626,6 +1745,7 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\ProcessRunner.cpp" />
<ClCompile Include="src\PurgeStrategy.cpp" />
<ClCompile Include="src\Random.cpp" />
<ClCompile Include="src\RandomStream.cpp" />
@@ -1921,6 +2041,7 @@
<ClCompile Include="src\Thread.cpp" />
<ClCompile Include="src\ThreadLocal.cpp" />
<ClCompile Include="src\ThreadPool.cpp" />
<ClCompile Include="src\ActiveThreadPool.cpp" />
<ClCompile Include="src\ThreadTarget.cpp" />
<ClCompile Include="src\Thread_POSIX.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
@@ -2017,12 +2138,34 @@
<ClCompile Include="src\UTF16Encoding.cpp" />
<ClCompile Include="src\UTF32Encoding.cpp" />
<ClCompile Include="src\UTF8Encoding.cpp" />
<ClCompile Include="src\utf8proc.c" />
<ClCompile Include="src\utf8proc_data.c">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|ARM64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_shared|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release_static_md|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_mt|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug_static_md|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="src\UTF8String.cpp" />
<ClCompile Include="src\UUID.cpp" />
<ClCompile Include="src\UUIDGenerator.cpp" />
<ClCompile Include="src\Var.cpp" />
<ClCompile Include="src\VarHolder.cpp" />
<ClCompile Include="src\VarIterator.cpp" />
<ClCompile Include="src\VarVisitor.cpp" />
<ClCompile Include="src\Void.cpp" />
<ClCompile Include="src\Windows1250Encoding.cpp" />
<ClCompile Include="src\Windows1251Encoding.cpp" />
@@ -2046,12 +2189,15 @@
<ClInclude Include="include\Poco\ActiveResult.h" />
<ClInclude Include="include\Poco\ActiveRunnable.h" />
<ClInclude Include="include\Poco\ActiveStarter.h" />
<ClInclude Include="include\Poco\ActiveThreadPool.h" />
<ClInclude Include="include\Poco\Activity.h" />
<ClInclude Include="include\Poco\Any.h" />
<ClInclude Include="include\Poco\ArchiveStrategy.h" />
<ClInclude Include="include\Poco\Ascii.h" />
<ClInclude Include="include\Poco\ASCIIEncoding.h" />
<ClInclude Include="include\Poco\AsyncChannel.h" />
<ClInclude Include="include\Poco\AsyncObserver.h" />
<ClInclude Include="include\Poco\AsyncNotificationCenter.h" />
<ClInclude Include="include\Poco\AtomicCounter.h" />
<ClInclude Include="include\Poco\AutoPtr.h" />
<ClInclude Include="include\Poco\AutoReleasePool.h" />
@@ -2129,6 +2275,9 @@
<ClInclude Include="include\Poco\FileStreamFactory.h" />
<ClInclude Include="include\Poco\FileStream_POSIX.h" />
<ClInclude Include="include\Poco\FileStream_WIN32.h" />
<ClInclude Include="include\Poco\FileStreamRWLock.h" />
<ClInclude Include="include\Poco\FileStreamRWLock_POSIX.h" />
<ClInclude Include="include\Poco\FileStreamRWLock_WIN32.h" />
<ClInclude Include="include\Poco\File_UNIX.h" />
<ClInclude Include="include\Poco\File_WIN32U.h" />
<ClInclude Include="include\Poco\Format.h" />
@@ -2155,6 +2304,7 @@
<ClInclude Include="include\Poco\HMACEngine.h" />
<ClInclude Include="include\Poco\InflatingStream.h" />
<ClInclude Include="include\Poco\Instantiator.h" />
<ClInclude Include="include\Poco\JSONFormatter.h" />
<ClInclude Include="include\Poco\JSONString.h" />
<ClInclude Include="include\Poco\KeyValueArgs.h" />
<ClInclude Include="include\Poco\Latin1Encoding.h" />
@@ -2213,6 +2363,7 @@
<ClInclude Include="include\Poco\Path_WIN32U.h" />
<ClInclude Include="include\Poco\PatternFormatter.h" />
<ClInclude Include="include\Poco\PBKDF2Engine.h" />
<ClInclude Include="include\Poco\PIDFile.h" />
<ClInclude Include="include\Poco\Pipe.h" />
<ClInclude Include="include\Poco\PipeImpl.h" />
<ClInclude Include="include\Poco\PipeImpl_DUMMY.h" />
@@ -2231,6 +2382,7 @@
<ClInclude Include="include\Poco\Process.h" />
<ClInclude Include="include\Poco\Process_UNIX.h" />
<ClInclude Include="include\Poco\Process_WIN32U.h" />
<ClInclude Include="include\Poco\ProcessRunner.h" />
<ClInclude Include="include\Poco\PurgeStrategy.h" />
<ClInclude Include="include\Poco\Random.h" />
<ClInclude Include="include\Poco\RandomStream.h" />
@@ -2340,6 +2492,7 @@
<ClInclude Include="src\pcre2_ucp.h" />
<ClInclude Include="src\pocomsg.h" />
<ClInclude Include="src\trees.h" />
<ClInclude Include="src\utf8proc.h" />
<ClInclude Include="src\zconf.h" />
<ClInclude Include="src\zlib.h" />
<ClInclude Include="src\zutil.h" />
@@ -2427,4 +2580,4 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>
</Project>

View File

@@ -187,6 +187,12 @@
<Filter Include="RegularExpression\PCRE2 Source Files">
<UniqueIdentifier>{f19826b3-7a4b-4d64-aaa3-eb1e084a71b2}</UniqueIdentifier>
</Filter>
<Filter Include="Text\Utf8Proc Header Files">
<UniqueIdentifier>{8f30689e-ed76-4b8b-a9c1-5d3e41522741}</UniqueIdentifier>
</Filter>
<Filter Include="Text\Utf8Proc Source Files">
<UniqueIdentifier>{090b933c-3b18-41dc-8485-8e83f96ee2ad}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Ascii.cpp">
@@ -579,6 +585,9 @@
<ClCompile Include="src\NotificationCenter.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\AsyncNotificationCenter.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\NotificationQueue.cpp">
<Filter>Notifications\Source Files</Filter>
</ClCompile>
@@ -642,6 +651,9 @@
<ClCompile Include="src\NamedMutex_WIN32U.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\PIDFile.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Pipe.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
@@ -669,6 +681,9 @@
<ClCompile Include="src\Process_WIN32U.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\ProcessRunner.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SharedMemory.cpp">
<Filter>Processes\Source Files</Filter>
</ClCompile>
@@ -831,6 +846,9 @@
<ClCompile Include="src\pcre2_chartables.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_chkdint.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_compile.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
@@ -915,6 +933,19 @@
<ClCompile Include="src\pcre2_xclass.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\VarVisitor.cpp" />
<ClCompile Include="src\ActiveThreadPool.cpp">
<Filter>Threading\Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utf8proc.c">
<Filter>Text\Utf8Proc Source Files</Filter>
</ClCompile>
<ClCompile Include="src\utf8proc_data.c">
<Filter>Text\Utf8Proc Source Files</Filter>
</ClCompile>
<ClCompile Include="src\JSONFormatter.cpp">
<Filter>Logging\Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\Poco\Any.h">
@@ -1439,6 +1470,12 @@
<ClInclude Include="include\Poco\AbstractObserver.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\AsyncObserver.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\AsyncNotificationCenter.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\NObserver.h">
<Filter>Notifications\Header Files</Filter>
</ClInclude>
@@ -1514,6 +1551,9 @@
<ClInclude Include="include\Poco\NamedMutex_WIN32U.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\PIDFile.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\Pipe.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
@@ -1541,6 +1581,9 @@
<ClInclude Include="include\Poco\Process_WIN32U.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\ProcessRunner.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\SharedMemory.h">
<Filter>Processes\Header Files</Filter>
</ClInclude>
@@ -1853,6 +1896,15 @@
<ClInclude Include="src\pcre2_intmodedep.h">
<Filter>RegularExpression\PCRE2 Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\ActiveThreadPool.h">
<Filter>Threading\Header Files</Filter>
</ClInclude>
<ClInclude Include="src\utf8proc.h">
<Filter>Text\Utf8Proc Header Files</Filter>
</ClInclude>
<ClInclude Include="include\Poco\JSONFormatter.h">
<Filter>Logging\Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\pocomsg.rc">

View File

@@ -6,7 +6,11 @@
include $(POCO_BASE)/build/rules/global
objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \
ifdef POCO_ENABLE_TRACE
INCLUDE += -I $(POCO_BASE)/Trace/include/Poco/Trace
endif
objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel AsyncNotificationCenter ActiveThreadPool\
Base32Decoder Base32Encoder Base64Decoder Base64Encoder \
BinaryReader BinaryWriter Bugcheck ByteOrder Channel Checksum Clock Configurable ConsoleChannel \
Condition CountingStream DateTime LocalDateTime DateTimeFormat DateTimeFormatter DateTimeParser \
@@ -19,7 +23,7 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \
NestedDiagnosticContext Notification NotificationCenter \
NotificationQueue PriorityNotificationQueue TimedNotificationQueue \
NullStream NumberFormatter NumberParser NumericString AbstractObserver \
Path PatternFormatter Process PurgeStrategy RWLock Random RandomStream \
Path PatternFormatter JSONFormatter PIDFile Process ProcessRunner PurgeStrategy RWLock Random RandomStream \
DirectoryIteratorStrategy RegularExpression RefCountedObject Runnable RotateStrategy \
SHA1Engine SHA2Engine Semaphore SharedLibrary SimpleFileChannel \
SignalHandler SplitterChannel SortedDirectoryIterator Stopwatch StreamChannel \
@@ -29,13 +33,14 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel \
ThreadPool ThreadTarget ActiveDispatcher Timer Timespan Timestamp Timezone Token URI \
FileStreamFactory URIStreamFactory URIStreamOpener UTF32Encoding UTF16Encoding UTF8Encoding UTF8String \
Unicode UnicodeConverter Windows1250Encoding Windows1251Encoding Windows1252Encoding \
UUID UUIDGenerator Void Var VarHolder VarIterator Format Pipe PipeImpl PipeStream SharedMemory \
MemoryStream FileStream AtomicCounter DataURIStream DataURIStreamFactory
UUID UUIDGenerator Void Var VarHolder VarIterator VarVisitor Format Pipe PipeImpl PipeStream SharedMemory \
MemoryStream FileStream AtomicCounter DataURIStream DataURIStreamFactory FileStreamRWLock \
BufferedBidirectionalStreamBuf BufferedStreamBuf UnbufferedStreamBuf
zlib_objects = adler32 compress crc32 deflate \
infback inffast inflate inftrees trees zutil
pcre_objects = pcre2_auto_possess pcre2_chartables pcre2_compile pcre2_config \
pcre_objects = pcre2_auto_possess pcre2_chartables pcre2_chkdint pcre2_compile pcre2_config \
pcre2_context pcre2_convert pcre2_dfa_match pcre2_error pcre2_extuni \
pcre2_find_bracket pcre2_jit_compile pcre2_maketables pcre2_match \
pcre2_match_data pcre2_newline pcre2_ord2utf pcre2_pattern_info \
@@ -44,11 +49,14 @@ pcre_objects = pcre2_auto_possess pcre2_chartables pcre2_compile pcre2_config \
pcre_utf8_objects = pcre2_ucd pcre2_tables
utf8proc_objects = utf8proc
ifdef POCO_UNBUNDLED
SYSLIBS += -lpcre2-8 -lz
SYSLIBS += -lpcre2-8 -lutf8proc -lz
objects += $(pcre_utf8_objects)
else
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects)
COMMONFLAGS += -DUTF8PROC_STATIC
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects) $(utf8proc_objects)
endif
ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW)
@@ -60,6 +68,9 @@ endif
target = PocoFoundation
target_version = $(LIBVERSION)
target_libs =
ifdef POCO_ENABLE_TRACE
target_libs += PocoTrace
endif
ifeq ($(findstring MinGW, $(POCO_CONFIG)), MinGW)
$(shell cd src; $(WINDMC) pocomsg.mc)

View File

@@ -1,8 +1 @@
if(@POCO_UNBUNDLED@)
include(CMakeFindDependencyMacro)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
find_dependency(ZLIB REQUIRED)
find_dependency(PCRE2 REQUIRED)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/PocoFoundationTargets.cmake")

View File

@@ -1 +0,0 @@
wcelibcex-1.0

View File

@@ -0,0 +1,7 @@
add_executable(Foundation-datetime-fuzzer DateTimeParse.cpp)
target_link_libraries(Foundation-datetime-fuzzer PUBLIC Poco::Foundation)
set_target_properties(Foundation-datetime-fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})
add_executable(Foundation-misc-fuzzer MiscFuzzing.cpp)
target_link_libraries(Foundation-misc-fuzzer PUBLIC Poco::Foundation)
set_target_properties(Foundation-misc-fuzzer PROPERTIES LINK_FLAGS $ENV{LIB_FUZZING_ENGINE})

View File

@@ -0,0 +1,46 @@
#include "Poco/DateTimeParser.h"
#include "Poco/DateTimeFormat.h"
#include "Poco/DateTimeFormatter.h"
using namespace Poco;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
const std::string input(reinterpret_cast<const char*>(data), size);
const std::string formats[] = {
DateTimeFormat::ISO8601_FORMAT,
DateTimeFormat::ISO8601_FRAC_FORMAT,
DateTimeFormat::RFC822_FORMAT,
DateTimeFormat::RFC1123_FORMAT,
DateTimeFormat::HTTP_FORMAT,
DateTimeFormat::RFC850_FORMAT,
DateTimeFormat::RFC1036_FORMAT,
DateTimeFormat::ASCTIME_FORMAT,
DateTimeFormat::SORTABLE_FORMAT,
"%m/%d/%y %h:%M %a",
"T%H:%M:%F",
};
int tzd = 0;
DateTime dt;
for (const auto& format : formats)
{
DateTimeParser::tryParse(format, input, dt, tzd);
DateTimeFormatter::format(dt.timestamp(), format, tzd);
}
dt.makeLocal(tzd);
dt.makeUTC(tzd);
try
{
dt = DateTimeParser::parse(input, tzd);
}
catch (const std::exception&)
{
}
return 0;
}

View File

@@ -0,0 +1,95 @@
#include "Poco/URI.h"
#include "Poco/Path.h"
#include "Poco/UUID.h"
#include "Poco/UTF8String.h"
#include <fuzzer/FuzzedDataProvider.h>
using namespace Poco;
static void fuzzURI(FuzzedDataProvider& dataProvider)
{
try
{
URI uri1(dataProvider.ConsumeRandomLengthString());
URI uri2(uri1, dataProvider.ConsumeRandomLengthString());
URI uri3(uri2);
uri3.normalize();
uri3.setQueryParameters(uri1.getQueryParameters());
uri2 = uri3.toString();
}
catch (const std::exception&)
{
}
}
static void fuzzPath(FuzzedDataProvider& dataProvider)
{
try
{
Path path1;
path1.tryParse(dataProvider.ConsumeRandomLengthString());
Path path2(path1, Path(dataProvider.ConsumeRandomLengthString()));
Path path3 = path1.absolute();
Path path4 = Path::expand(dataProvider.ConsumeRandomLengthString());
const auto style1 = dataProvider.ConsumeIntegralInRange<char>(Path::PATH_UNIX, Path::PATH_GUESS);
const auto style2 = dataProvider.ConsumeIntegralInRange<char>(Path::PATH_UNIX, Path::PATH_GUESS);
path3.assign(path4.toString(static_cast<Path::Style>(style1)), static_cast<Path::Style>(style2));
}
catch (const std::exception&)
{
}
}
static void fuzzUUID(FuzzedDataProvider& dataProvider)
{
try
{
UUID uuid1(dataProvider.ConsumeRandomLengthString());
UUID uuid2(uuid1.toString());
uuid2.tryParse(dataProvider.ConsumeRandomLengthString());
}
catch (const std::exception&)
{
}
}
static void fuzzUTF8String(FuzzedDataProvider& dataProvider)
{
try
{
auto str1 = UTF8::unescape(dataProvider.ConsumeRandomLengthString());
auto str2 = UTF8::escape(str1);
UTF8::toUpperInPlace(str1);
UTF8::toLowerInPlace(str2);
}
catch (const std::exception&)
{
}
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
{
FuzzedDataProvider dataProvider(data, size);
switch (dataProvider.ConsumeIntegral<char>())
{
case 0:
fuzzURI(dataProvider);
break;
case 1:
fuzzPath(dataProvider);
break;
case 2:
fuzzUUID(dataProvider);
break;
case 3:
fuzzUTF8String(dataProvider);
break;
}
return 0;
}

View File

@@ -21,8 +21,7 @@
#include "Poco/KeyValueArgs.h"
#include "Poco/ValidArgs.h"
#include "Poco/Mutex.h"
#include "Poco/Exception.h"
#include "Poco/FIFOEvent.h"
#include "Poco/BasicEvent.h"
#include "Poco/EventArgs.h"
#include "Poco/Delegate.h"
#include "Poco/SharedPtr.h"
@@ -39,16 +38,16 @@ class AbstractCache
/// An AbstractCache is the interface of all caches.
{
public:
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Add;
FIFOEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Update;
FIFOEvent<const TKey, TEventMutex> Remove;
FIFOEvent<const TKey, TEventMutex> Get;
FIFOEvent<const EventArgs, TEventMutex> Clear;
BasicEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Add;
BasicEvent<const KeyValueArgs<TKey, TValue>, TEventMutex> Update;
BasicEvent<const TKey, TEventMutex> Remove;
BasicEvent<const TKey, TEventMutex> Get;
BasicEvent<const EventArgs, TEventMutex> Clear;
typedef std::map<TKey, SharedPtr<TValue>> DataHolder;
typedef typename DataHolder::iterator Iterator;
typedef typename DataHolder::const_iterator ConstIterator;
typedef std::set<TKey> KeySet;
using DataHolder = std::map<TKey, SharedPtr<TValue>>;
using Iterator = typename DataHolder::iterator;
using ConstIterator = typename DataHolder::const_iterator;
using KeySet = std::set<TKey>;
AbstractCache()
{
@@ -72,6 +71,9 @@ public:
}
}
AbstractCache(const AbstractCache& aCache) = delete;
AbstractCache& operator = (const AbstractCache& aCache) = delete;
void add(const TKey& key, const TValue& val)
/// Adds the key value pair to the cache.
/// If for the key already an entry exists, it will be overwritten.
@@ -194,8 +196,8 @@ public:
}
protected:
mutable FIFOEvent<ValidArgs<TKey>> IsValid;
mutable FIFOEvent<KeySet> Replace;
mutable BasicEvent<ValidArgs<TKey>> IsValid;
mutable BasicEvent<KeySet> Replace;
void initialize()
/// Sets up event registration.
@@ -371,9 +373,6 @@ protected:
mutable DataHolder _data;
mutable TMutex _mutex;
private:
AbstractCache(const AbstractCache& aCache);
AbstractCache& operator = (const AbstractCache& aCache);
};

View File

@@ -339,9 +339,8 @@ protected:
}
NotifyAsyncParams params = par;
TArgs retArgs(params.args);
params.ptrStrat->notify(params.pSender, retArgs);
return retArgs;
params.ptrStrat->notify(params.pSender, params.args);
return params.args;
}
TStrategy _strategy; /// The strategy used to notify observers.

View File

@@ -37,12 +37,42 @@ public:
AbstractObserver& operator = (const AbstractObserver& observer);
virtual void notify(Notification* pNf) const = 0;
virtual bool equals(const AbstractObserver& observer) const = 0;
virtual bool accepts(Notification* pNf, const char* pName = 0) const = 0;
POCO_DEPRECATED("use `Poco::Any accepts(Notification*)` instead")
virtual bool accepts(Notification* pNf, const char* pName) const = 0;
virtual bool accepts(const Notification::Ptr& pNf) const = 0;
virtual AbstractObserver* clone() const = 0;
virtual void start();
/// No-op.
/// This method can be implemented by inheriting classes which require
/// explicit start in order to begin processing notifications.
virtual void disable() = 0;
virtual int backlog() const;
/// Returns number of queued messages that this Observer has.
/// For non-active (synchronous) observers, always returns zero.
};
//
// inlines
//
inline void AbstractObserver::start()
{
}
inline int AbstractObserver::backlog() const
{
return 0;
}
} // namespace Poco

View File

@@ -19,7 +19,7 @@
#include "Poco/Foundation.h"
#include "Poco/ThreadPool.h"
#include "Poco/ActiveThreadPool.h"
#include "Poco/ActiveRunnable.h"
@@ -36,7 +36,7 @@ class ActiveStarter
public:
static void start(OwnerType* /*pOwner*/, ActiveRunnableBase::Ptr pRunnable)
{
ThreadPool::defaultPool().start(*pRunnable);
ActiveThreadPool::defaultPool().start(*pRunnable);
pRunnable->duplicate(); // The runnable will release itself.
}
};

View File

@@ -0,0 +1,98 @@
//
// ActiveThreadPool.h
//
// Library: Foundation
// Package: Threading
// Module: ActiveThreadPool
//
// Definition of the ActiveThreadPool class.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_ActiveThreadPool_INCLUDED
#define Foundation_ActiveThreadPool_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Thread.h"
#include "Poco/Environment.h"
#include <memory>
namespace Poco {
class Runnable;
class ActiveThreadPoolPrivate;
class Foundation_API ActiveThreadPool
/// A thread pool manages and recycles individual Poco::Thread objects
/// to help reduce thread creation costs in programs that use threads.
///
/// The thread pool supports a task queue.
/// When there are no idle threads, tasks are placed in the task queue to wait for execution.
/// Use case for this pool is running many (more than os-max-thread-count) short live tasks
{
public:
ActiveThreadPool(int capacity = static_cast<int>(Environment::processorCount()) + 1,
int stackSize = POCO_THREAD_STACK_SIZE);
/// Creates a thread pool with a maximum thread count of capacity.
/// Threads are created with given stack size.
ActiveThreadPool(const std::string& name,
int capacity = static_cast<int>(Environment::processorCount()) + 1,
int stackSize = POCO_THREAD_STACK_SIZE);
/// Creates a thread pool with the given name and a maximum thread count of capacity.
/// Threads are created with given stack size.
~ActiveThreadPool();
/// Currently running threads will remain active
/// until they complete.
int capacity() const;
/// Returns the capacity of threads.
int getStackSize() const;
/// Returns the stack size used to create new threads.
int expiryTimeout() const;
/// Returns the thread expiry timeout value in milliseconds.
/// The default expiryTimeout is 30000 milliseconds (30 seconds).
void setExpiryTimeout(int expiryTimeout);
/// Set the thread expiry timeout value in milliseconds.
/// The default expiryTimeout is 30000 milliseconds (30 seconds).
void start(Runnable& target, int priority = 0);
/// Obtains a thread and starts the target.
void joinAll();
/// Waits for all threads to exit and removes all threads from the thread pool.
const std::string& name() const;
/// Returns the name of the thread pool,
/// or an empty string if no name has been
/// specified in the constructor.
static ActiveThreadPool& defaultPool();
/// Returns a reference to the default
/// thread pool.
private:
ActiveThreadPool(const ActiveThreadPool& pool);
ActiveThreadPool& operator = (const ActiveThreadPool& pool);
private:
std::unique_ptr<ActiveThreadPoolPrivate> _impl;
};
} // namespace Poco
#endif // Foundation_ActiveThreadPool_INCLUDED

View File

@@ -180,9 +180,11 @@ protected:
}
catch (...)
{
_running = false;
_done.set();
throw;
}
_running = false;
_done.set();
}

View File

@@ -18,18 +18,18 @@
#include "Poco/Exception.h"
#include "Poco/MetaProgramming.h"
#include "Poco/Bugcheck.h"
#include <algorithm>
#include <typeinfo>
#include <cstring>
#define poco_any_assert(cond) do { if (!(cond)) std::abort(); } while (0)
#include <cstddef>
namespace Poco {
class Any;
using namespace std::string_literals;
namespace Dynamic {
class Var;
@@ -39,6 +39,7 @@ template <class T> class VarHolderImpl;
}
#ifndef POCO_DOC
template <class T, std::size_t S>
struct TypeSizeLE:
std::integral_constant<bool, (sizeof(T) <= S)>{};
@@ -47,6 +48,7 @@ struct TypeSizeLE:
template <class T, std::size_t S>
struct TypeSizeGT:
std::integral_constant<bool, (sizeof(T) > S)>{};
#endif
template <typename PlaceholderT, unsigned int SizeV = POCO_SMALL_OBJECT_SIZE>
@@ -58,7 +60,7 @@ union Placeholder
/// it will be placement-new-allocated into the local buffer
/// (i.e. there will be no heap-allocation). The local buffer size is one byte
/// larger - [POCO_SMALL_OBJECT_SIZE + 1], additional byte value indicating
/// where the object was allocated (0 => heap, 1 => local).
/// where the object was allocated. See enum Allocation.
///
/// Important: for SOO builds, only same-type (or trivial both-empty no-op)
/// swap operation is allowed.
@@ -76,9 +78,12 @@ public:
#ifndef POCO_NO_SOO
Placeholder(): pHolder(0)
Placeholder(): pHolder(nullptr)
{
std::memset(holder, 0, sizeof(Placeholder));
// Forces to use optimised memset internally
// https://travisdowns.github.io/blog/2020/01/20/zero.html
std::fill(std::begin(holder), std::end(holder), static_cast<char>(0));
setAllocation(Allocation::POCO_ANY_EMPTY);
}
~Placeholder()
@@ -99,32 +104,31 @@ public:
bool isEmpty() const
{
static char buf[SizeV+1] = {};
return 0 == std::memcmp(holder, buf, SizeV+1);
return holder[SizeV] == Allocation::POCO_ANY_EMPTY;
}
bool isLocal() const
{
return holder[SizeV] != 0;
return holder[SizeV] == Allocation::POCO_ANY_LOCAL;
}
template<typename T, typename V,
typename std::enable_if<TypeSizeLE<T, Placeholder::Size::value>::value>::type* = nullptr>
typename std::enable_if_t<TypeSizeLE<T, Placeholder::Size::value>::value>* = nullptr>
PlaceholderT* assign(const V& value)
{
erase();
new (reinterpret_cast<PlaceholderT*>(holder)) T(value);
setLocal(true);
setAllocation(Allocation::POCO_ANY_LOCAL);
return reinterpret_cast<PlaceholderT*>(holder);
}
template<typename T, typename V,
typename std::enable_if<TypeSizeGT<T, Placeholder::Size::value>::value>::type* = nullptr>
typename std::enable_if_t<TypeSizeGT<T, Placeholder::Size::value>::value>* = nullptr>
PlaceholderT* assign(const V& value)
{
erase();
pHolder = new T(value);
setLocal(false);
setAllocation(Allocation::POCO_ANY_EXTERNAL);
return pHolder;
}
@@ -137,23 +141,56 @@ public:
}
private:
typedef typename std::aligned_storage<SizeV+1>::type AlignerType;
using AlignerType = std::max_align_t;
#ifndef POCO_DOC
static_assert(
sizeof(AlignerType) < SizeV,
"Aligner type is bigger than the actual storage, so SizeV should be made bigger otherwise you simply waste unused memory."
);
#endif
void setLocal(bool local) const
enum Allocation : unsigned char
{
holder[SizeV] = local ? 1 : 0;
POCO_ANY_EMPTY = 0,
POCO_ANY_LOCAL = 1,
POCO_ANY_EXTERNAL = 2
};
void setAllocation(Allocation alloc) const
{
holder[SizeV] = alloc;
}
void destruct(bool clear)
{
if (!isEmpty())
const auto allocation {holder[SizeV]};
switch (allocation)
{
if (!isLocal())
delete pHolder;
else
reinterpret_cast<PlaceholderT*>(holder)->~PlaceholderT();
if (clear) std::memset(holder, 0, sizeof(Placeholder));
case Allocation::POCO_ANY_EMPTY:
break;
case Allocation::POCO_ANY_LOCAL:
{
// Do not deallocate, just explicitly call destructor
auto* h { reinterpret_cast<PlaceholderT*>(holder) };
h->~PlaceholderT();
}
break;
case Allocation::POCO_ANY_EXTERNAL:
{
auto* h { pHolder };
pHolder = nullptr;
delete h;
}
break;
default:
poco_bugcheck();
break;
}
setAllocation(Allocation::POCO_ANY_EMPTY);
if (clear)
{
// Force to use optimised memset internally
std::fill(std::begin(holder), std::end(holder), static_cast<char>(0));
}
}
@@ -162,7 +199,7 @@ private:
#else // POCO_NO_SOO
Placeholder(): pHolder(0)
Placeholder(): pHolder(nullptr)
{
}
@@ -179,12 +216,12 @@ private:
void erase()
{
delete pHolder;
pHolder = 0;
pHolder = nullptr;
}
bool isEmpty() const
{
return 0 == pHolder;
return nullptr == pHolder;
}
bool isLocal() const
@@ -222,10 +259,8 @@ class Any
{
public:
Any()
Any() = default;
/// Creates an empty any type.
{
}
template<typename ValueType>
Any(const ValueType & value)
@@ -245,12 +280,19 @@ public:
construct(other);
}
~Any()
/// Destructor. If Any is locally held, calls ValueHolder destructor;
/// otherwise, deletes the placeholder from the heap.
Any(Any&& other)
/// Move constructor, works with both empty and initialized Any values.
{
construct(other);
}
~Any() = default;
/// Destructor.
/// Small Object Optimization mode behavior:
/// Invokes the Placeholder destructor, which calls the
/// ValueHolder destructor explicitly (locally held Any), or
/// deletes the ValueHolder heap memory (heap-allocated Any).
Any& swap(Any& other) noexcept
/// Swaps the content of the two Anys.
///
@@ -295,11 +337,23 @@ public:
Any& operator = (const Any& rhs)
/// Assignment operator for Any.
{
if ((this != &rhs) && !rhs.empty())
construct(rhs);
else if ((this != &rhs) && rhs.empty())
_valueHolder.erase();
if (this != &rhs)
{
if (!rhs.empty())
construct(rhs);
else
_valueHolder.erase();
}
return *this;
}
Any& operator = (Any&& rhs)
/// Move operator for Any.
{
if (!rhs.empty())
construct(rhs);
else
_valueHolder.erase();
return *this;
}
@@ -344,21 +398,19 @@ private:
{
}
virtual const std::type_info& type() const
Holder & operator = (const Holder &) = delete;
const std::type_info& type() const override
{
return typeid(ValueType);
}
virtual void clone(Placeholder<ValueHolder>* pPlaceholder) const
void clone(Placeholder<ValueHolder>* pPlaceholder) const override
{
pPlaceholder->assign<Holder<ValueType>, ValueType>(_held);
}
ValueType _held;
private:
Holder & operator = (const Holder &);
};
ValueHolder* content() const
@@ -385,6 +437,9 @@ private:
template <typename ValueType>
friend ValueType* AnyCast(Any*);
template <typename ValueType>
friend const ValueType* AnyCast(const Any*);
template <typename ValueType>
friend ValueType* UnsafeAnyCast(Any*);
@@ -405,12 +460,12 @@ ValueType* AnyCast(Any* operand)
/// to the stored value.
///
/// Example Usage:
/// MyType* pTmp = AnyCast<MyType*>(pAny).
/// Will return NULL if the cast fails, i.e. types don't match.
/// MyType* pTmp = AnyCast<MyType>(pAny).
/// Returns nullptr if the types don't match.
{
return operand && operand->type() == typeid(ValueType)
? &static_cast<Any::Holder<ValueType>*>(operand->content())->_held
: 0;
: nullptr;
}
@@ -420,10 +475,12 @@ const ValueType* AnyCast(const Any* operand)
/// to the stored value.
///
/// Example Usage:
/// const MyType* pTmp = AnyCast<MyType*>(pAny).
/// Will return NULL if the cast fails, i.e. types don't match.
/// const MyType* pTmp = AnyCast<MyType>(pAny).
/// Returns nullptr if the types don't match.
{
return AnyCast<ValueType>(const_cast<Any*>(operand));
return operand && operand->type() == typeid(ValueType)
? &static_cast<const Any::Holder<ValueType>*>(operand->content())->_held
: nullptr;
}
@@ -438,18 +495,19 @@ ValueType AnyCast(Any& operand)
/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
/// these cases.
{
typedef typename TypeWrapper<ValueType>::TYPE NonRef;
using NonRef = typename TypeWrapper<ValueType>::TYPE;
NonRef* result = AnyCast<NonRef>(&operand);
if (!result)
{
std::string s = "RefAnyCast: Failed to convert between Any types ";
std::string s(__func__);
s.append(": Failed to convert between Any types "s);
if (operand.content())
{
s.append(1, '(');
s.append(operand.content()->type().name());
s.append(Poco::demangle(operand.content()->type().name()));
s.append(" => ");
s.append(typeid(ValueType).name());
s.append(Poco::demangle<ValueType>());
s.append(1, ')');
}
throw BadCastException(s);
@@ -469,7 +527,7 @@ ValueType AnyCast(const Any& operand)
/// Some compilers will accept this code although a copy is returned. Use the RefAnyCast in
/// these cases.
{
typedef typename TypeWrapper<ValueType>::TYPE NonRef;
using NonRef = typename TypeWrapper<ValueType>::TYPE;
return AnyCast<NonRef&>(const_cast<Any&>(operand));
}
@@ -485,13 +543,14 @@ const ValueType& RefAnyCast(const Any & operand)
ValueType* result = AnyCast<ValueType>(const_cast<Any*>(&operand));
if (!result)
{
std::string s = "RefAnyCast: Failed to convert between Any types ";
std::string s(__func__);
s.append(": Failed to convert between Any types "s);
if (operand.content())
{
s.append(1, '(');
s.append(operand.content()->type().name());
s.append(Poco::demangle(operand.content()->type().name()));
s.append(" => ");
s.append(typeid(ValueType).name());
s.append(Poco::demangle<ValueType>());
s.append(1, ')');
}
throw BadCastException(s);
@@ -510,13 +569,14 @@ ValueType& RefAnyCast(Any& operand)
ValueType* result = AnyCast<ValueType>(&operand);
if (!result)
{
std::string s = "RefAnyCast: Failed to convert between Any types ";
std::string s(__func__);
s.append(": Failed to convert between Any types "s);
if (operand.content())
{
s.append(1, '(');
s.append(operand.content()->type().name());
s.append(Poco::demangle(operand.content()->type().name()));
s.append(" => ");
s.append(typeid(ValueType).name());
s.append(Poco::demangle<ValueType>());
s.append(1, ')');
}
throw BadCastException(s);
@@ -549,6 +609,26 @@ const ValueType* UnsafeAnyCast(const Any* operand)
}
template <typename ValueType>
bool AnyHoldsNullPtr(const Any& any)
/// Returns true if any holds a null pointer.
/// Fails to compile if `ValueType` is not a pointer.
{
poco_static_assert_ptr(ValueType);
return (AnyCast<ValueType>(any) == nullptr);
}
template <typename ValueType>
bool AnyHoldsNullPtr(const Any* pAny)
/// Returns true if the Any pointed to holds a null pointer.
/// Returns false if `pAny` is a null pointer.
{
if (!pAny) return false;
return (AnyHoldsNullPtr<ValueType>(*pAny));
}
} // namespace Poco

View File

@@ -23,6 +23,9 @@
#include "Poco/File.h"
#include "Poco/DateTimeFormatter.h"
#include "Poco/NumberFormatter.h"
#include "Poco/Mutex.h"
#include "Poco/Condition.h"
#include <atomic>
namespace Poco {
@@ -44,12 +47,14 @@ public:
virtual LogFile* open(LogFile* pFile) = 0;
/// Open a new log file and return it.
virtual LogFile* archive(LogFile* pFile) = 0;
/// Renames the given log file for archiving
/// and creates and returns a new log file.
/// The given LogFile object is deleted.
void close();
void compress(bool flag = true);
/// Enables or disables compression of archived files.
@@ -57,12 +62,23 @@ protected:
void moveFile(const std::string& oldName, const std::string& newName);
bool exists(const std::string& name);
Poco::FastMutex _rotateMutex;
// Log rotation must wait until all of the compression tasks complete
int _compressingCount;
Poco::Condition _compressingComplete;
private:
friend class ArchiveCompressor;
ArchiveStrategy(const ArchiveStrategy&);
ArchiveStrategy& operator = (const ArchiveStrategy&);
bool _compress;
ArchiveCompressor* _pCompressor;
void compressFile(const std::string& path);
std::atomic<bool> _compress;
std::atomic<ArchiveCompressor*> _pCompressor;
};

View File

@@ -208,7 +208,7 @@ inline bool Ascii::isPrintable(int ch)
inline int Ascii::toLower(int ch)
{
if (isUpper(ch))
return ch + 32;
return ch | 0x20;
else
return ch;
}
@@ -217,7 +217,7 @@ inline int Ascii::toLower(int ch)
inline int Ascii::toUpper(int ch)
{
if (isLower(ch))
return ch - 32;
return ch & ~0x20;
else
return ch;
}

View File

@@ -0,0 +1,77 @@
//
// AsyncNotificationCenter.h
//
// Library: Foundation
// Package: Notifications
// Module: AsyncNotificationCenter
//
// Definition of the AsyncNotificationCenter class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// Aleph ONE Software Engineering d.o.o.,
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_AsyncNotificationCenter_INCLUDED
#define Foundation_AsyncNotificationCenter_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/NotificationCenter.h"
#include "Poco/Thread.h"
#include "Poco/Stopwatch.h"
#include "Poco/Debugger.h"
#include "Poco/ErrorHandler.h"
#include "Poco/Format.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/NotificationQueue.h"
namespace Poco {
class Foundation_API AsyncNotificationCenter: public NotificationCenter
/// AsyncNotificationCenter decouples posting of notifications
/// from notifying subscribers by calling observers' notification
/// handler in a dedicated thread.
{
public:
AsyncNotificationCenter();
/// Creates the AsyncNotificationCenter and starts the notifying thread.
~AsyncNotificationCenter();
/// Stops the notifying thread and destroys the AsyncNotificationCenter.
AsyncNotificationCenter& operator = (const AsyncNotificationCenter&) = delete;
AsyncNotificationCenter(const AsyncNotificationCenter&) = delete;
AsyncNotificationCenter& operator = (AsyncNotificationCenter&&) = delete;
AsyncNotificationCenter(AsyncNotificationCenter&&) = delete;
virtual void postNotification(Notification::Ptr pNotification);
/// Enqueues notification into the notification queue.
virtual int backlog() const;
/// Returns the numbner of notifications in the notification queue.
private:
void start();
void stop();
void dequeue();
using Adapter = RunnableAdapter<AsyncNotificationCenter>;
Thread _thread;
NotificationQueue _nq;
Adapter _ra;
std::atomic<bool> _started;
std::atomic<bool> _done;
};
} // namespace Poco
#endif // Foundation_AsyncNotificationCenter_INCLUDED

View File

@@ -0,0 +1,177 @@
//
// AsyncObserver.h
//
// Library: Foundation
// Package: Notifications
// Module: AsyncObserver
//
// Definition of the AsyncObserver class template.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// Aleph ONE Software Engineering d.o.o.,
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_AsyncObserver_INCLUDED
#define Foundation_AsyncObserver_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/NObserver.h"
#include "Poco/Thread.h"
#include "Poco/Stopwatch.h"
#include "Poco/Debugger.h"
#include "Poco/ErrorHandler.h"
#include "Poco/Format.h"
#include "Poco/RunnableAdapter.h"
#include "Poco/NotificationQueue.h"
namespace Poco {
template <class C, class N>
class AsyncObserver: public NObserver<C, N>
/// AsyncObserver notifies subscribers in a dedicated thread (as opposed
/// to (N)Observer classes, which notify subscribers synchronously).
/// In order to become active and process notifications, the start()
/// method must be called.
///
/// This class is meant to be used with the NotificationCenter only.
/// Notification processing thread can be started only once, and copying
/// should be done before `start()` is called.
{
public:
using Type = AsyncObserver<C, N>;
using Matcher = typename NObserver<C, N>::Matcher;
using Handler = typename NObserver<C, N>::Handler;
using NotificationPtr = typename NObserver<C, N>::NotificationPtr;
AsyncObserver() = delete;
AsyncObserver(C& object, Handler handler, Matcher matcher = nullptr):
NObserver<C, N>(object, handler, matcher),
_ra(*this, &AsyncObserver::dequeue),
_started(false),
_done(false)
{
}
AsyncObserver(const AsyncObserver& observer):
NObserver<C, N>(observer),
_ra(*this, &AsyncObserver::dequeue),
_started(false),
_done(false)
{
poco_assert(observer._nq.size() == 0);
}
~AsyncObserver()
{
disable();
}
AsyncObserver& operator = (const AsyncObserver& observer)
{
if (&observer != this)
{
poco_assert(observer._nq.size() == 0);
setObject(observer._pObject);
setHandler(observer._handler);
setMatcher(observer._matcher);
_started = false;
_done =false;
}
return *this;
}
virtual void notify(Notification* pNf) const
{
_nq.enqueueNotification(NotificationPtr(static_cast<N*>(pNf), true));
}
virtual AbstractObserver* clone() const
{
return new AsyncObserver(*this);
}
virtual void start()
{
Poco::ScopedLock l(this->mutex());
if (_started)
{
throw Poco::InvalidAccessException(
Poco::format("thread already started %s", poco_src_loc));
}
_thread.start(_ra);
Poco::Stopwatch sw;
sw.start();
while (!_started)
{
if (sw.elapsedSeconds() > 5)
throw Poco::TimeoutException(poco_src_loc);
Thread::sleep(100);
}
}
virtual void disable()
{
if (!_started.exchange(false)) return;
_nq.wakeUpAll();
while (!_done) Thread::sleep(100);
_thread.join();
NObserver<C, N>::disable();
}
virtual int backlog() const
{
return _nq.size();
}
private:
void dequeue()
{
Notification::Ptr pNf;
_started = true;
_done = false;
while ((pNf = _nq.waitDequeueNotification()))
{
try
{
this->handle(pNf.unsafeCast<N>());
}
catch (Poco::Exception& ex)
{
Poco::ErrorHandler::handle(ex);
}
catch (std::exception& ex)
{
Poco::ErrorHandler::handle(ex);
}
catch (...)
{
Poco::ErrorHandler::handle();
}
}
_done = true;
_started = false;
}
using Adapter = RunnableAdapter<AsyncObserver<C, N>>;
Thread _thread;
mutable NotificationQueue _nq;
Adapter _ra;
std::atomic<bool> _started;
std::atomic<bool> _done;
};
} // namespace Poco
#endif // Foundation_AsyncObserver_INCLUDED

View File

@@ -110,34 +110,23 @@ public:
{
if (_ptr != ptr)
{
if (_ptr) _ptr->release();
_ptr = ptr;
if (shared && _ptr) _ptr->duplicate();
if (shared && ptr) ptr->duplicate();
std::swap(_ptr, ptr);
if (ptr) ptr->release();
}
return *this;
}
AutoPtr& assign(const AutoPtr& ptr)
{
if (&ptr != this)
{
if (_ptr) _ptr->release();
_ptr = ptr._ptr;
if (_ptr) _ptr->duplicate();
}
return *this;
return assign(ptr._ptr, true);
}
template <class Other>
AutoPtr& assign(const AutoPtr<Other>& ptr)
{
if (ptr.get() != _ptr)
{
if (_ptr) _ptr->release();
_ptr = const_cast<Other*>(ptr.get());
if (_ptr) _ptr->duplicate();
}
return *this;
C* nptr = const_cast<Other*>(ptr.get());
return assign(nptr, true);
}
void reset()

View File

@@ -117,6 +117,9 @@ public:
void readRaw(char* buffer, std::streamsize length);
/// Reads length bytes of raw data into buffer.
void readCString(std::string& value);
/// Reads zero-terminated C-string into value.
void readBOM();
/// Reads a byte-order mark from the stream and configures
/// the reader for the encountered byte order.

View File

@@ -55,6 +55,8 @@ public:
LITTLE_ENDIAN_BYTE_ORDER = 3 /// little-endian byte-order
};
static const std::streamsize DEFAULT_MAX_CSTR_LENGTH { 1024 };
BinaryWriter(std::ostream& ostr, StreamByteOrder byteOrder = NATIVE_BYTE_ORDER);
/// Creates the BinaryWriter.
@@ -132,6 +134,9 @@ public:
void writeRaw(const char* buffer, std::streamsize length);
/// Writes length raw bytes from the given buffer to the stream.
void writeCString(const char* cString, std::streamsize maxLength = DEFAULT_MAX_CSTR_LENGTH);
/// Writes zero-terminated C-string.
void writeBOM();
/// Writes a byte-order mark to the stream. A byte order mark is
/// a 16-bit integer with a value of 0xFEFF, written in host byte-order.

View File

@@ -43,15 +43,15 @@ class BasicBufferedBidirectionalStreamBuf: public std::basic_streambuf<ch, tr>
/// for implementing an iostream.
{
protected:
typedef std::basic_streambuf<ch, tr> Base;
typedef std::basic_ios<ch, tr> IOS;
typedef ch char_type;
typedef tr char_traits;
typedef ba Allocator;
typedef typename Base::int_type int_type;
typedef typename Base::pos_type pos_type;
typedef typename Base::off_type off_type;
typedef typename IOS::openmode openmode;
using Base = std::basic_streambuf<ch, tr>;
using IOS = std::basic_ios<ch, tr>;
using char_type = ch;
using char_traits = tr;
using Allocator = ba;
using int_type = typename Base::int_type;
using pos_type = typename Base::pos_type;
using off_type = typename Base::off_type;
using openmode = typename IOS::openmode;
public:
BasicBufferedBidirectionalStreamBuf(std::streamsize bufferSize, openmode mode):
@@ -69,6 +69,9 @@ public:
Allocator::deallocate(_pWriteBuffer, _bufsize);
}
BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&) = delete;
BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&) = delete;
virtual int_type overflow(int_type c)
{
if (!(_mode & IOS::out)) return char_traits::eof();
@@ -130,6 +133,22 @@ protected:
this->setp(_pWriteBuffer, _pWriteBuffer + _bufsize);
}
virtual bool resizeBuffer(std::streamsize bufferSize)
{
if (_bufsize != bufferSize)
{
Allocator::deallocate(_pReadBuffer, _bufsize);
Allocator::deallocate(_pWriteBuffer, _bufsize);
_bufsize = bufferSize;
_pReadBuffer = Allocator::allocate(_bufsize);
_pWriteBuffer = Allocator::allocate(_bufsize);
}
resetBuffers();
return true;
}
private:
virtual int readFromDevice(char_type* /*buffer*/, std::streamsize /*length*/)
{
@@ -152,28 +171,24 @@ private:
return -1;
}
std::streamsize _bufsize;
char_type* _pReadBuffer;
char_type* _pWriteBuffer;
openmode _mode;
BasicBufferedBidirectionalStreamBuf(const BasicBufferedBidirectionalStreamBuf&);
BasicBufferedBidirectionalStreamBuf& operator = (const BasicBufferedBidirectionalStreamBuf&);
std::streamsize _bufsize {0};
char_type* _pReadBuffer {nullptr};
char_type* _pWriteBuffer {nullptr};
openmode _mode {0};
};
//
// We provide an instantiation for char.
//
// Visual C++ needs a workaround - explicitly importing the template
// instantiation - to avoid duplicate symbols due to multiple
// instantiations in different libraries.
//
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
#endif
typedef BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>> BufferedBidirectionalStreamBuf;
#if defined(POCO_OS_FAMILY_WINDOWS)
extern template class BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
#else
extern template class Foundation_API BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
#endif
using BufferedBidirectionalStreamBuf = BasicBufferedBidirectionalStreamBuf<char, std::char_traits<char>>;
} // namespace Poco

View File

@@ -160,18 +160,17 @@ private:
BasicBufferedStreamBuf& operator = (const BasicBufferedStreamBuf&);
};
//
// We provide an instantiation for char.
//
// Visual C++ needs a workaround - explicitly importing the template
// instantiation - to avoid duplicate symbols due to multiple
// instantiations in different libraries.
//
#if defined(_MSC_VER) && defined(POCO_DLL) && !defined(Foundation_EXPORTS)
template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char>>;
#if defined(POCO_OS_FAMILY_WINDOWS)
extern template class BasicBufferedStreamBuf<char, std::char_traits<char>>;
#else
extern template class Foundation_API BasicBufferedStreamBuf<char, std::char_traits<char>>;
#endif
typedef BasicBufferedStreamBuf<char, std::char_traits<char>> BufferedStreamBuf;
using BufferedStreamBuf = BasicBufferedStreamBuf<char, std::char_traits<char>>;
} // namespace Poco

View File

@@ -39,38 +39,38 @@ class Foundation_API Bugcheck
/// automatically provide useful context information.
{
public:
[[noreturn]] static void assertion(const char* cond, const char* file, int line, const char* text = 0);
[[noreturn]] static void assertion(const char* cond, const char* file, LineNumber line, const char* text = 0);
/// An assertion failed. Break into the debugger, if
/// possible, then throw an AssertionViolationException.
[[noreturn]] static void nullPointer(const char* ptr, const char* file, int line);
[[noreturn]] static void nullPointer(const char* ptr, const char* file, LineNumber line);
/// An null pointer was encountered. Break into the debugger, if
/// possible, then throw an NullPointerException.
[[noreturn]] static void bugcheck(const char* file, int line);
[[noreturn]] static void bugcheck(const char* file, LineNumber line);
/// An internal error was encountered. Break into the debugger, if
/// possible, then throw an BugcheckException.
[[noreturn]] static void bugcheck(const char* msg, const char* file, int line);
[[noreturn]] static void bugcheck(const char* msg, const char* file, LineNumber line);
/// An internal error was encountered. Break into the debugger, if
/// possible, then throw an BugcheckException.
static void unexpected(const char* file, int line);
static void unexpected(const char* file, LineNumber line);
/// An exception was caught in a destructor. Break into debugger,
/// if possible and report exception. Must only be called from
/// within a catch () block as it rethrows the exception to
/// determine its class.
static void debugger(const char* file, int line);
static void debugger(const char* file, LineNumber line);
/// An internal error was encountered. Break into the debugger, if
/// possible.
static void debugger(const char* msg, const char* file, int line);
static void debugger(const char* msg, const char* file, LineNumber line);
/// An internal error was encountered. Break into the debugger, if
/// possible.
protected:
static std::string what(const char* msg, const char* file, int line, const char* text = 0);
static std::string what(const char* msg, const char* file, LineNumber line, const char* text = 0);
};
@@ -165,42 +165,16 @@ protected:
#endif
//
// poco_static_assert
//
// The following was ported from <boost/static_assert.hpp>
//
#define poco_static_assert(B) static_assert(B)
template <bool x>
struct POCO_STATIC_ASSERTION_FAILURE;
template <>
struct POCO_STATIC_ASSERTION_FAILURE<true>
{
enum
{
value = 1
};
};
template <int x>
struct poco_static_assert_test
{
};
#if defined(__GNUC__) && (__GNUC__ == 3) && ((__GNUC_MINOR__ == 3) || (__GNUC_MINOR__ == 4))
#define poco_static_assert(B) \
typedef char POCO_JOIN(poco_static_assert_typedef_, __LINE__) \
[POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>::value]
#else
#define poco_static_assert(B) \
typedef poco_static_assert_test<sizeof(POCO_STATIC_ASSERTION_FAILURE<(bool) (B)>)> \
POCO_JOIN(poco_static_assert_typedef_, __LINE__) POCO_UNUSED
#endif
#define poco_static_assert_ptr(T) \
static_assert(std::is_pointer_v<T> || \
std::is_same_v<T, std::nullptr_t> || \
std::is_member_pointer_v<T> || \
std::is_member_function_pointer_v<T> || \
std::is_member_object_pointer_v<T>, \
"not a pointer")
#endif // Foundation_Bugcheck_INCLUDED

View File

@@ -32,6 +32,8 @@ class Foundation_API ByteOrder
/// integers of various sizes.
{
public:
static Int8 flipBytes(Int8 value);
static UInt8 flipBytes(UInt8 value);
static Int16 flipBytes(Int16 value);
static UInt16 flipBytes(UInt16 value);
static Int32 flipBytes(Int32 value);
@@ -43,6 +45,8 @@ public:
static UInt64 flipBytes(UInt64 value);
#endif
static Int8 toBigEndian(Int8 value);
static UInt8 toBigEndian(UInt8 value);
static Int16 toBigEndian(Int16 value);
static UInt16 toBigEndian (UInt16 value);
static Int32 toBigEndian(Int32 value);
@@ -52,6 +56,8 @@ public:
static UInt64 toBigEndian (UInt64 value);
#endif
static Int8 fromBigEndian(Int8 value);
static UInt8 fromBigEndian(UInt8 value);
static Int16 fromBigEndian(Int16 value);
static UInt16 fromBigEndian (UInt16 value);
static Int32 fromBigEndian(Int32 value);
@@ -61,6 +67,8 @@ public:
static UInt64 fromBigEndian (UInt64 value);
#endif
static Int8 toLittleEndian(Int8 value);
static UInt8 toLittleEndian(UInt8 value);
static Int16 toLittleEndian(Int16 value);
static UInt16 toLittleEndian (UInt16 value);
static Int32 toLittleEndian(Int32 value);
@@ -70,6 +78,8 @@ public:
static UInt64 toLittleEndian (UInt64 value);
#endif
static Int8 fromLittleEndian(Int8 value);
static UInt8 fromLittleEndian(UInt8 value);
static Int16 fromLittleEndian(Int16 value);
static UInt16 fromLittleEndian (UInt16 value);
static Int32 fromLittleEndian(Int32 value);
@@ -79,6 +89,8 @@ public:
static UInt64 fromLittleEndian (UInt64 value);
#endif
static Int8 toNetwork(Int8 value);
static UInt8 toNetwork(UInt8 value);
static Int16 toNetwork(Int16 value);
static UInt16 toNetwork (UInt16 value);
static Int32 toNetwork(Int32 value);
@@ -88,6 +100,8 @@ public:
static UInt64 toNetwork (UInt64 value);
#endif
static Int8 fromNetwork(Int8 value);
static UInt8 fromNetwork(UInt8 value);
static Int16 fromNetwork(Int16 value);
static UInt16 fromNetwork (UInt16 value);
static Int32 fromNetwork(Int32 value);
@@ -132,6 +146,18 @@ private:
//
// inlines
//
inline UInt8 ByteOrder::flipBytes(UInt8 value)
{
return value;
}
inline Int8 ByteOrder::flipBytes(Int8 value)
{
return value;
}
inline UInt16 ByteOrder::flipBytes(UInt16 value)
{
#if defined(POCO_HAVE_MSC_BYTESWAP)
@@ -218,6 +244,8 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
#if defined(POCO_HAVE_INT64)
#define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int8) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt8) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \
@@ -225,6 +253,8 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int64) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt64)
#define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int8) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt8) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \
@@ -233,11 +263,15 @@ inline Int64 ByteOrder::flipBytes(Int64 value)
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt64)
#else
#define POCO_IMPLEMENT_BYTEORDER_NOOP(op) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int8) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt8) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int16) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt16) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, Int32) \
POCO_IMPLEMENT_BYTEORDER_NOOP_(op, UInt32)
#define POCO_IMPLEMENT_BYTEORDER_FLIP(op) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int8) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt8) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int16) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, UInt16) \
POCO_IMPLEMENT_BYTEORDER_FLIP_(op, Int32) \

View File

@@ -67,13 +67,13 @@ extern "C" \
#define POCO_BEGIN_MANIFEST_IMPL(fnName, base) \
bool fnName(Poco::ManifestBase* pManifest_) \
{ \
typedef base _Base; \
typedef Poco::Manifest<_Base> _Manifest; \
std::string requiredType(typeid(_Manifest).name()); \
std::string actualType(pManifest_->className()); \
using BaseType = base; \
using ManifestType = Poco::Manifest<BaseType>; \
const std::string requiredType(typeid(ManifestType).name()); \
const std::string actualType(pManifest_->className()); \
if (requiredType == actualType) \
{ \
Poco::Manifest<_Base>* pManifest = static_cast<_Manifest*>(pManifest_);
Poco::Manifest<BaseType>* pManifest = static_cast<ManifestType*>(pManifest_);
#define POCO_BEGIN_MANIFEST(base) \
@@ -93,15 +93,15 @@ extern "C" \
#define POCO_EXPORT_CLASS(cls) \
pManifest->insert(new Poco::MetaObject<cls, _Base>(#cls));
pManifest->insert(new Poco::MetaObject<cls, BaseType>(#cls));
#define POCO_EXPORT_INTERFACE(cls, itf) \
pManifest->insert(new Poco::MetaObject<cls, _Base>(itf));
pManifest->insert(new Poco::MetaObject<cls, BaseType>(itf));
#define POCO_EXPORT_SINGLETON(cls) \
pManifest->insert(new Poco::MetaSingleton<cls, _Base>(#cls));
pManifest->insert(new Poco::MetaSingleton<cls, BaseType>(#cls));
#endif // Foundation_ClassLibrary_INCLUDED

View File

@@ -254,7 +254,7 @@ public:
if (itm != pManif->end())
return *itm;
}
return 0;
return nullptr;
}
const Meta& classFor(const std::string& className) const

View File

@@ -42,7 +42,7 @@
// #define POCO_NO_SHAREDMEMORY
// Define if no <locale> header is available (such as on WinCE)
// Define if no <locale> header is available
// #define POCO_NO_LOCALE
@@ -149,6 +149,10 @@
// No UNIX socket support
// Define to disable unix sockets
// UNIX local sockets are default-enabled on
// all UNIX systems, on Windows if available
// See Net/SocketDefs.h
// See https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
// #define POCO_NET_NO_UNIX_SOCKET
@@ -161,52 +165,39 @@
#endif
// Windows CE has no locale support
#if defined(_WIN32_WCE)
#define POCO_NO_LOCALE
#endif
// Enable the poco_debug_* and poco_trace_* macros
// even if the _DEBUG variable is not set.
// This allows the use of these macros in a release version.
// #define POCO_LOG_DEBUG
// OpenSSL on Windows
//
// Poco has its own OpenSSL build system.
// See <https://github.com/pocoproject/openssl/blob/master/README.md>
// for details.
//
// These options are Windows only.
//
// To disable the use of Poco-provided OpenSSL binaries,
// define POCO_EXTERNAL_OPENSSL.
//
// Possible values:
// POCO_EXTERNAL_OPENSSL_SLPRO:
// Automatically link OpenSSL libraries from OpenSSL Windows installer provided
// by Shining Light Productions <http://slproweb.com/products/Win32OpenSSL.html>
// The (global) library search path must be set accordingly.
// POCO_EXTERNAL_OPENSSL_DEFAULT:
// Automatically link OpenSSL libraries from standard OpenSSL Windows build.
// The (global) library search path must be set accordingly.
// empty or other value:
// Do not link any OpenSSL libraries automatically. You will have to edit the
// Visual C++ project files for Crypto and NetSSL_OpenSSL.
#if !defined(POCO_EXTERNAL_OPENSSL) && defined(POCO_EXTERNAL_OPENSSL_SLPRO)
#define POCO_EXTERNAL_OPENSSL POCO_EXTERNAL_OPENSSL_SLPRO
#endif
// Define to prevent changing the suffix for shared libraries
// to "d.so", "d.dll", etc. for _DEBUG builds in Poco::SharedLibrary.
// #define POCO_NO_SHARED_LIBRARY_DEBUG_SUFFIX
// Enable usage of Poco::Mutex and Poco::FastMutex
// as wrappers for std::recursive_mutex and std::mutex
#ifndef POCO_ENABLE_STD_MUTEX
// #define POCO_ENABLE_STD_MUTEX
#endif
// Disarm POCO_DEPRECATED macro.
// #define POCO_NO_DEPRECATED
#ifndef POCO_HAVE_SENDFILE
// #define POCO_HAVE_SENDFILE
#endif
#define POCO_HAVE_CPP17_COMPILER (__cplusplus >= 201703L)
// Option to silence deprecation warnings.
#ifndef POCO_SILENCE_DEPRECATED
#define POCO_DEPRECATED(reason) [[deprecated(reason)]]
#else
#define POCO_DEPRECATED(reason)
#endif
// Uncomment to explicitly disable SQLParser
// #define POCO_DATA_NO_SQL_PARSER
// Uncomment to enable stack trace autogeneration in Exception
//#define POCO_ENABLE_TRACE 1
#endif // Foundation_Config_INCLUDED

View File

@@ -52,7 +52,8 @@ class Foundation_API DateTime
/// Notes:
/// * Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
/// * Year zero (0) is a leap year
/// * Negative years (years preceding 1 BC) are not supported
/// * Minimum date/time that can be represented is 12:00:00 UTC Monday, 1 January 4713 BC
/// (Julian Day 0, Gregorian -4713-11-24 12:00:00)
///
/// For more information, please see:
/// * http://en.wikipedia.org/wiki/Gregorian_Calendar
@@ -254,6 +255,12 @@ public:
/// Returns true if all arguments are valid, false otherwise.
protected:
void checkValid();
/// Checks if the given date and time is valid (all arguments are within a proper range).
/// Expects all members to be set.
///
/// Throws Poco::InvalidArgumentException if any of the arguments is not valid.
static double toJulianDay(Timestamp::UtcTimeVal utcTime);
/// Computes the Julian day for an UTC time.

View File

@@ -19,16 +19,21 @@
#include "Poco/Foundation.h"
#include <unordered_set>
namespace Poco {
class RegularExpression;
class Foundation_API DateTimeFormat
/// Definition of date/time formats and various
/// constants used by DateTimeFormatter and DateTimeParser.
{
public:
// predefined date formats
static const std::string ISO8601_FORMAT;
/// The date/time format defined in the ISO 8601 standard.
@@ -37,6 +42,8 @@ public:
/// 2005-01-01T12:00:00+01:00
/// 2005-01-01T11:00:00Z
static const std::string ISO8601_REGEX;
static const std::string ISO8601_FRAC_FORMAT;
/// The date/time format defined in the ISO 8601 standard,
/// with fractional seconds.
@@ -52,6 +59,8 @@ public:
/// Sat, 1 Jan 05 12:00:00 +0100
/// Sat, 1 Jan 05 11:00:00 GMT
static const std::string RFC822_REGEX;
static const std::string RFC1123_FORMAT;
/// The date/time format defined in RFC 1123 (obsoletes RFC 822).
///
@@ -59,6 +68,8 @@ public:
/// Sat, 1 Jan 2005 12:00:00 +0100
/// Sat, 1 Jan 2005 11:00:00 GMT
static const std::string RFC1123_REGEX;
static const std::string HTTP_FORMAT;
/// The date/time format defined in the HTTP specification (RFC 2616),
/// which is basically a variant of RFC 1036 with a zero-padded day field.
@@ -67,6 +78,8 @@ public:
/// Sat, 01 Jan 2005 12:00:00 +0100
/// Sat, 01 Jan 2005 11:00:00 GMT
static const std::string HTTP_REGEX;
static const std::string RFC850_FORMAT;
/// The date/time format defined in RFC 850 (obsoleted by RFC 1036).
///
@@ -74,6 +87,8 @@ public:
/// Saturday, 1-Jan-05 12:00:00 +0100
/// Saturday, 1-Jan-05 11:00:00 GMT
static const std::string RFC850_REGEX;
static const std::string RFC1036_FORMAT;
/// The date/time format defined in RFC 1036 (obsoletes RFC 850).
///
@@ -81,18 +96,24 @@ public:
/// Saturday, 1 Jan 05 12:00:00 +0100
/// Saturday, 1 Jan 05 11:00:00 GMT
static const std::string RFC1036_REGEX;
static const std::string ASCTIME_FORMAT;
/// The date/time format produced by the ANSI C asctime() function.
///
/// Example:
/// Sat Jan 1 12:00:00 2005
static const std::string ASCTIME_REGEX;
static const std::string SORTABLE_FORMAT;
/// A simple, sortable date/time format.
///
/// Example:
/// 2005-01-01 12:00:00
static const std::string SORTABLE_REGEX;
// ^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)$
// names used by formatter and parser
static const std::string WEEKDAY_NAMES[7];
@@ -100,6 +121,16 @@ public:
static const std::string MONTH_NAMES[12];
/// English names of months (January, February, ...).
static bool hasFormat(const std::string& fmt);
/// Returns true if fmt is a known standard format.
static bool isValid(const std::string& dateTime);
/// Returns true if dateTime validates against at least one supported format.
private:
typedef std::unordered_set<std::string> Formatlist;
static Formatlist FORMAT_LIST;
};

View File

@@ -53,28 +53,34 @@ class Foundation_API DateTimeParser
/// If more strict format validation of date/time strings is required, a regular
/// expression could be used for initial validation, before passing the string
/// to DateTimeParser.
/// TODO: Correct description
{
public:
static void parse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Performs cleanup of the input string (trims spaces).
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static DateTime parse(const std::string& fmt, const std::string& str, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Performs cleanup of the input string (trims spaces).
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static bool tryParse(const std::string& fmt, const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time in the given format from the given string.
/// Performs cleanup of the input string (trims spaces).
/// Returns true if the string has been successfully parsed, false otherwise.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static void parse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// performs cleanup of the input string (trims spaces) when cleanup is true and
/// examines the dateTime string for a known date/time format.
/// Throws a SyntaxException if the string cannot be successfully parsed.
/// Please see DateTimeFormatter::format() for a description of the format string.
@@ -82,12 +88,14 @@ public:
static DateTime parse(const std::string& str, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// performs cleanup of the input string (trims spaces) and
/// examines the dateTime string for a known date/time format.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.
static bool tryParse(const std::string& str, DateTime& dateTime, int& timeZoneDifferential);
/// Parses a date and time from the given dateTime string. Before parsing, the method
/// performs cleanup of the input string (trims spaces) and
/// examines the dateTime string for a known date/time format.
/// Please see DateTimeFormatter::format() for a description of the format string.
/// Class DateTimeFormat defines format strings for various standard date/time formats.

View File

@@ -19,6 +19,7 @@
#include "Poco/Foundation.h"
#include <string_view>
namespace Poco {
@@ -44,7 +45,7 @@ public:
/// Writes a message to the debugger log, if available, otherwise to
/// standard error output.
static void message(const std::string& msg, const char* file, int line);
static void message(const std::string& msg, const char* file, LineNumber line);
/// Writes a message to the debugger log, if available, otherwise to
/// standard error output.
@@ -56,15 +57,33 @@ public:
static void enter(const std::string& msg);
/// Writes a debug message to the debugger log and breaks into it.
static void enter(const std::string& msg, const char* file, int line);
static void enter(const std::string& msg, const char* file, LineNumber line);
/// Writes a debug message to the debugger log and breaks into it.
static void enter(const char* file, int line);
static void enter(const char* file, LineNumber line);
/// Writes a debug message to the debugger log and breaks into it.
static constexpr std::string_view sourceFile(const std::string_view& fileName)
/// Utility function for reporting the source file name. The file path is
/// truncated and only the source file name (with extension) is returned.
///
/// For full location reporting (including function name and line number),
/// see `poco_src_loc` macro.
{
std::size_t pos = fileName.find_last_of("/\\");
if (pos == std::string_view::npos) pos = 0;
else if (fileName.length() > 1) ++pos;
return std::string_view(fileName.substr(pos));
}
};
} // namespace Poco
#define poco_src_loc std::string(Poco::Debugger::sourceFile(__FILE__)) \
.append("::").append(__func__) \
.append("():").append(std::to_string(__LINE__))
#endif // Foundation_Debugger_INCLUDED

View File

@@ -147,6 +147,11 @@ public:
{
}
DefaultStrategy(DefaultStrategy&& s):
_delegates(std::move(s._delegates))
{
}
~DefaultStrategy()
{
}
@@ -201,6 +206,15 @@ public:
return *this;
}
DefaultStrategy& operator = (DefaultStrategy&& s)
{
if (this != &s)
{
_delegates = std::move(s._delegates);
}
return *this;
}
void clear()
{
for (Iterator it = _delegates.begin(); it != _delegates.end(); ++it)

View File

@@ -22,11 +22,8 @@
#include "Poco/BufferedStreamBuf.h"
#include <istream>
#include <ostream>
#if defined(POCO_UNBUNDLED)
#include <zlib.h>
#else
#include "Poco/zlib.h"
#endif
struct z_stream_s;
namespace Poco {
@@ -47,6 +44,17 @@ public:
STREAM_GZIP /// Create a gzip header, use CRC-32 checksum.
};
enum CompressionLevel
/// Constants for compression levels.
/// Note to maintainers: These must be kept in sync with the constants
/// defined by zlib.
{
DEFAULT_COMPRESSION = -1,
NO_COMPRESSION = 0,
BEST_SPEED = 1,
BEST_COMPRESSION = 9
};
DeflatingStreamBuf(std::istream& istr, StreamType type, int level);
/// Creates a DeflatingStreamBuf for compressing data read
/// from the given input stream.
@@ -89,11 +97,11 @@ private:
DEFLATE_BUFFER_SIZE = 32768
};
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream _zstr;
bool _eof;
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream_s* _pZstr;
bool _eof;
};
@@ -104,7 +112,7 @@ class Foundation_API DeflatingIOS: public virtual std::ios
/// order of the stream buffer and base classes.
{
public:
DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data passed
/// through and forwarding it to the given output stream.
@@ -115,7 +123,7 @@ public:
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.
DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data read
/// from the given input stream.
@@ -150,7 +158,7 @@ class Foundation_API DeflatingOutputStream: public std::ostream, public Deflatin
/// ostr.close();
{
public:
DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingOutputStream for compressing data passed
/// through and forwarding it to the given output stream.
@@ -179,7 +187,7 @@ class Foundation_API DeflatingInputStream: public std::istream, public Deflating
/// using zlib's deflate algorithm.
{
public:
DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data read
/// from the given input stream.

View File

@@ -75,7 +75,7 @@ public:
virtual DirectoryIterator& operator ++ (); // prefix
//@ deprecated
POCO_DEPRECATED("")
DirectoryIterator operator ++ (int); // postfix
/// Please use the prefix increment operator instead.

View File

@@ -47,7 +47,7 @@ private:
//
// inlines
//
const std::string& DirectoryIteratorImpl::get() const
inline const std::string& DirectoryIteratorImpl::get() const
{
return _current;
}

View File

@@ -62,10 +62,8 @@ public:
{
}
virtual ~Pair()
virtual ~Pair() = default;
/// Destroys the Pair.
{
}
Pair& swap(Pair& other) noexcept
/// Swaps the content of the two Pairs.
@@ -122,62 +120,62 @@ public:
return typeid(Pair<std::string>);
}
void convert(Int8& val) const
void convert(Int8&) const
{
throw BadCastException("Cannot cast Pair type to Int8");
}
void convert(Int16& val) const
void convert(Int16&) const
{
throw BadCastException("Cannot cast Pair type to Int16");
}
void convert(Int32& val) const
void convert(Int32&) const
{
throw BadCastException("Cannot cast Pair type to Int32");
}
void convert(Int64& val) const
void convert(Int64&) const
{
throw BadCastException("Cannot cast Pair type to Int64");
}
void convert(UInt8& val) const
void convert(UInt8&) const
{
throw BadCastException("Cannot cast Pair type to UInt8");
}
void convert(UInt16& val) const
void convert(UInt16&) const
{
throw BadCastException("Cannot cast Pair type to UInt16");
}
void convert(UInt32& val) const
void convert(UInt32&) const
{
throw BadCastException("Cannot cast Pair type to UInt32");
}
void convert(UInt64& val) const
void convert(UInt64&) const
{
throw BadCastException("Cannot cast Pair type to UInt64");
}
void convert(bool& val) const
void convert(bool&) const
{
throw BadCastException("Cannot cast Pair type to bool");
}
void convert(float& val) const
void convert(float&) const
{
throw BadCastException("Cannot cast Pair type to float");
}
void convert(double& val) const
void convert(double&) const
{
throw BadCastException("Cannot cast Pair type to double");
}
void convert(char& val) const
void convert(char&) const
{
throw BadCastException("Cannot cast Pair type to char");
}
@@ -271,62 +269,62 @@ public:
return typeid(Pair<int>);
}
void convert(Int8& val) const
void convert(Int8&) const
{
throw BadCastException("Cannot cast Pair type to Int8");
}
void convert(Int16& val) const
void convert(Int16&) const
{
throw BadCastException("Cannot cast Pair type to Int16");
}
void convert(Int32& val) const
void convert(Int32&) const
{
throw BadCastException("Cannot cast Pair type to Int32");
}
void convert(Int64& val) const
void convert(Int64&) const
{
throw BadCastException("Cannot cast Pair type to Int64");
}
void convert(UInt8& val) const
void convert(UInt8&) const
{
throw BadCastException("Cannot cast Pair type to UInt8");
}
void convert(UInt16& val) const
void convert(UInt16&) const
{
throw BadCastException("Cannot cast Pair type to UInt16");
}
void convert(UInt32& val) const
void convert(UInt32&) const
{
throw BadCastException("Cannot cast Pair type to UInt32");
}
void convert(UInt64& val) const
void convert(UInt64&) const
{
throw BadCastException("Cannot cast Pair type to UInt64");
}
void convert(bool& val) const
void convert(bool&) const
{
throw BadCastException("Cannot cast Pair type to bool");
}
void convert(float& val) const
void convert(float&) const
{
throw BadCastException("Cannot cast Pair type to float");
}
void convert(double& val) const
void convert(double&) const
{
throw BadCastException("Cannot cast Pair type to double");
}
void convert(char& val) const
void convert(char&) const
{
throw BadCastException("Cannot cast Pair type to char");
}

View File

@@ -288,6 +288,25 @@ private:
};
#if defined(POCO_OS_FAMILY_WINDOWS)
extern template class Struct<std::string>;
extern template class Struct<int>;
extern template class Struct<std::string, Poco::OrderedMap<std::string, Var>, Poco::OrderedSet<std::string>>;
extern template class Struct<int, OrderedMap<int, Var>, OrderedSet<int>>;
#else
extern template class Foundation_API Struct<std::string>;
extern template class Foundation_API Struct<int>;
extern template class Foundation_API Struct<std::string, Poco::OrderedMap<std::string, Var>, Poco::OrderedSet<std::string>>;
extern template class Foundation_API Struct<int, OrderedMap<int, Var>, OrderedSet<int>>;
#endif
template <>
class VarHolderImpl<Struct<std::string, std::map<std::string, Var>, std::set<std::string>>>: public VarHolder
{
@@ -959,8 +978,8 @@ private:
} // namespace Dynamic
typedef Dynamic::Struct<std::string> DynamicStruct;
typedef Dynamic::Struct<std::string, Poco::OrderedMap<std::string, Dynamic::Var>, Poco::OrderedSet<std::string>> OrderedDynamicStruct;
using DynamicStruct = Dynamic::Struct<std::string>;
using OrderedDynamicStruct = Dynamic::Struct<std::string, Poco::OrderedMap<std::string, Dynamic::Var>, Poco::OrderedSet<std::string>>;
} // namespace Poco

View File

@@ -210,7 +210,7 @@ public:
if (pHolder && pHolder->type() == typeid(T))
{
VarHolderImpl<T>* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder);
auto* pHolderImpl = static_cast<VarHolderImpl<T>*>(pHolder);
return pHolderImpl->value();
}
else if (!pHolder)
@@ -475,7 +475,12 @@ public:
const std::type_info& type() const;
/// Returns the type information of the stored content.
//@ deprecated
std::string typeName(bool demangle = true) const;
/// Returns the type name of the stored content.
/// If demangling is available and emangle is true,
/// the returnsed string will be demangled.
POCO_DEPRECATED("Use clear() instead")
void empty();
/// Empties Var.
/// This function is deprecated and will be removed.
@@ -521,23 +526,8 @@ public:
/// This function returns 0 when Var is empty, 1 for POD or the size (i.e. length)
/// for held container.
std::string toString() const
std::string toString() const;
/// Returns the stored value as string.
{
VarHolder* pHolder = content();
if (!pHolder)
throw InvalidAccessException("Can not convert empty value.");
if (typeid(std::string) == pHolder->type())
return extract<std::string>();
else
{
std::string result;
pHolder->convert(result);
return result;
}
}
static Var parse(const std::string& val);
/// Parses the string which must be in JSON format
@@ -617,17 +607,8 @@ private:
_placeholder.assign<VarHolderImpl<ValueType>, ValueType>(value);
}
void construct(const char* value)
{
std::string val(value);
_placeholder.assign<VarHolderImpl<std::string>, std::string>(val);
}
void construct(const Var& other)
{
if (!other.isEmpty())
other.content()->clone(&_placeholder);
}
void construct(const char* value);
void construct(const Var& other);
Placeholder<VarHolder> _placeholder;
};
@@ -642,6 +623,20 @@ private:
/// Var members
///
inline void Var::construct(const char* value)
{
std::string val(value);
_placeholder.assign<VarHolderImpl<std::string>, std::string>(val);
}
inline void Var::construct(const Var& other)
{
if (!other.isEmpty())
other.content()->clone(&_placeholder);
}
inline void Var::swap(Var& other)
{
if (this == &other) return;
@@ -674,6 +669,13 @@ inline const std::type_info& Var::type() const
}
inline std::string Var::typeName(bool demangle) const
{
VarHolder* pHolder = content();
return pHolder ? demangle ? Poco::demangle(pHolder->type().name()) : pHolder->type().name() : std::string();
}
inline Var::ConstIterator Var::begin() const
{
if (size() == 0) return ConstIterator(const_cast<Var*>(this), true);
@@ -731,7 +733,7 @@ inline bool Var::operator ! () const
inline bool Var::isEmpty() const
{
return 0 == content();
return nullptr == content();
}
@@ -2286,8 +2288,7 @@ inline bool operator >= (const unsigned long& other, const Var& da)
} // namespace Dynamic
//@ deprecated
typedef Dynamic::Var DynamicAny;
using DynamicAny POCO_DEPRECATED("") = Dynamic::Var;
} // namespace Poco

View File

@@ -33,16 +33,27 @@
#include "Poco/UTF8String.h"
#include "Poco/UUID.h"
#include "Poco/Any.h"
#include "Poco/Format.h"
#include "Poco/Debugger.h"
#include "Poco/Exception.h"
#include <vector>
#include <list>
#include <deque>
#include <typeinfo>
#include <type_traits>
#include <string_view>
#undef min
#undef max
#include <limits>
#define POCO_VAR_RANGE_EXCEPTION(str, from) \
throw RangeException(Poco::format("%v ((%s/%d) %s > (%s/%d) %s) @ %s.", \
std::string_view(#str), Poco::demangle<F>(), numValDigits(from), std::to_string(from), \
Poco::demangle<T>(), numTypeDigits<T>(), std::to_string(static_cast<T>(from)), \
poco_src_loc))
namespace Poco {
namespace Dynamic {
@@ -120,12 +131,12 @@ class Foundation_API VarHolder
/// throw BadCastException.
{
public:
typedef Var ArrayValueType;
using ArrayValueType = Var;
virtual ~VarHolder();
/// Destroys the VarHolder.
virtual VarHolder* clone(Placeholder<VarHolder>* pHolder = 0) const = 0;
virtual VarHolder* clone(Placeholder<VarHolder>* pHolder = nullptr) const = 0;
/// Implementation must implement this function to
/// deep-copy the VarHolder.
/// If small object optimization is enabled (i.e. if
@@ -311,148 +322,241 @@ protected:
return pVarHolder->assign<VarHolderImpl<T>, T>(val);
}
template <typename F, typename T>
void convertToSmaller(const F& from, T& to) const
/// This function is meant to convert signed numeric values from
template <typename F, typename T,
std::enable_if_t<(std::is_integral_v<F> && std::is_signed_v<F>) ||
std::is_floating_point_v<F>, F>* = nullptr,
std::enable_if_t<(std::is_integral_v<T> && std::is_signed_v<T>) ||
std::is_floating_point_v<F>, T>* = nullptr>
static void convertToSmaller(const F& from, T& to)
/// Converts signed integral, as well as floating-point, values from
/// larger to smaller type. It checks the upper and lower bound and
/// if from value is within limits of type T (i.e. check calls do not throw),
/// it is converted.
{
poco_static_assert (std::numeric_limits<F>::is_specialized);
poco_static_assert (std::numeric_limits<T>::is_specialized);
poco_static_assert (std::numeric_limits<F>::is_signed);
poco_static_assert (std::numeric_limits<T>::is_signed);
if (std::numeric_limits<F>::is_integer)
if constexpr((std::is_integral_v<F>) && (std::is_floating_point_v<T>))
{
checkUpperLimit<F,T>(from);
checkLowerLimit<F,T>(from);
if (isPrecisionLost<F, T>(from))
POCO_VAR_RANGE_EXCEPTION ("Lost precision", from);
}
else
{
checkUpperLimitFloat<F,T>(from);
checkLowerLimitFloat<F,T>(from);
}
checkUpperLimit<F,T>(from);
checkLowerLimit<F,T>(from);
to = static_cast<T>(from);
}
template <typename F, typename T>
void convertToSmallerUnsigned(const F& from, T& to) const
/// This function is meant for converting unsigned integral data types,
/// from larger to smaller type. Since lower limit is always 0 for unsigned types,
/// only the upper limit is checked, thus saving some cycles compared to the signed
/// version of the function. If the value to be converted is smaller than
/// the maximum value for the target type, the conversion is performed.
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F> && std::is_signed_v<T>, F>* = nullptr,
std::enable_if_t<std::is_floating_point_v<T>, T>* = nullptr>
static void convertToSmaller(const F& from, T& to)
/// Converts signed integral values from integral to floating-point type. Checks for
/// the loss of precision and if from value is within limits of type T (i.e. check calls do not throw),
/// it is converted.
{
poco_static_assert (std::numeric_limits<F>::is_specialized);
poco_static_assert (std::numeric_limits<T>::is_specialized);
poco_static_assert (!std::numeric_limits<F>::is_signed);
poco_static_assert (!std::numeric_limits<T>::is_signed);
if (isPrecisionLost<F, T>(from))
POCO_VAR_RANGE_EXCEPTION ("Lost precision", from);
to = static_cast<T>(from);
}
template <typename F, typename T,
std::enable_if_t<std::is_same_v<F, bool>>* = nullptr,
std::enable_if_t<std::is_floating_point_v<T>, T>* = nullptr>
static void convertToSmaller(const F& from, T& to)
/// Converts boolean values to floating-point type.
{
to = static_cast<T>(from);
}
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F> && !std::is_signed_v<F>, F>* = nullptr,
std::enable_if_t<(std::is_integral_v<T> && !std::is_signed<T>::value) || std::is_floating_point<T>::value, T>* = nullptr>
static void convertToSmallerUnsigned(const F& from, T& to)
/// Converts unsigned integral data types from larger to smaller, as well as to floating-point, types.
/// Since lower limit is always 0 for unsigned types, only the upper limit is checked, thus
/// saving some cycles compared to the signed version of the function. If the
/// value to be converted is smaller than the maximum value for the target type,
/// the conversion is performed.
{
checkUpperLimit<F,T>(from);
to = static_cast<T>(from);
}
template <typename F, typename T>
void convertSignedToUnsigned(const F& from, T& to) const
/// This function is meant for converting signed integral data types to
/// unsigned data types. Negative values can not be converted and if one
/// is encountered, RangeException is thrown.
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F> && std::is_signed_v<F>, F>* = nullptr,
std::enable_if_t<std::is_integral_v<T> && !std::is_signed_v<T>, T>* = nullptr>
static void convertSignedToUnsigned(const F& from, T& to)
/// Converts signed integral data types to unsigned data types.
/// Negative values can not be converted and if one is encountered, RangeException is thrown.
/// If upper limit is within the target data type limits, the conversion is performed.
{
poco_static_assert (std::numeric_limits<F>::is_specialized);
poco_static_assert (std::numeric_limits<T>::is_specialized);
poco_static_assert (std::numeric_limits<F>::is_signed);
poco_static_assert (!std::numeric_limits<T>::is_signed);
if (from < 0)
throw RangeException("Value too small.");
checkUpperLimit<F,T>(from);
POCO_VAR_RANGE_EXCEPTION ("Value too small", from);
checkUpperLimit<std::make_unsigned_t<F>,T>(from);
to = static_cast<T>(from);
}
template <typename F, typename T>
void convertSignedFloatToUnsigned(const F& from, T& to) const
/// This function is meant for converting floating point data types to
/// unsigned integral data types. Negative values can not be converted and if one
/// is encountered, RangeException is thrown.
template <typename F, typename T, std::enable_if_t<std::is_floating_point_v<F>, bool> = true,
std::enable_if_t<std::is_integral_v<T> && !std::is_signed_v<T>, T>* = nullptr>
static void convertSignedFloatToUnsigned(const F& from, T& to)
/// Converts floating point data types to unsigned integral data types. Negative values
/// can not be converted and if one is encountered, RangeException is thrown.
/// If upper limit is within the target data type limits, the conversion is performed.
{
poco_static_assert (std::numeric_limits<F>::is_specialized);
poco_static_assert (std::numeric_limits<T>::is_specialized);
poco_static_assert (!std::numeric_limits<F>::is_integer);
poco_static_assert (std::numeric_limits<T>::is_integer);
poco_static_assert (!std::numeric_limits<T>::is_signed);
if (from < 0)
throw RangeException("Value too small.");
checkUpperLimitFloat<F,T>(from);
POCO_VAR_RANGE_EXCEPTION ("Value too small", from);
checkUpperLimit<F,T>(from);
to = static_cast<T>(from);
}
template <typename F, typename T>
void convertUnsignedToSigned(const F& from, T& to) const
/// This function is meant for converting unsigned integral data types to
/// signed integral data types. Negative values can not be converted and if one
/// is encountered, RangeException is thrown.
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F> && !std::is_signed_v<F>, F>* = nullptr,
std::enable_if_t<std::is_integral_v<T> && std::is_signed_v<T>, T>* = nullptr>
static void convertUnsignedToSigned(const F& from, T& to)
/// Converts unsigned integral data types to signed integral data types.
/// If upper limit is within the target data type limits, the conversion is performed.
{
poco_static_assert (std::numeric_limits<F>::is_specialized);
poco_static_assert (std::numeric_limits<T>::is_specialized);
poco_static_assert (!std::numeric_limits<F>::is_signed);
poco_static_assert (std::numeric_limits<T>::is_signed);
checkUpperLimit<F,T>(from);
to = static_cast<T>(from);
}
template <typename F, typename T, std::enable_if_t<std::is_signed_v<F> && std::is_signed_v<T> && (sizeof(F) <= sizeof(T))>* = nullptr>
void convertToSigned(const F& from, T& to) const
{
to = static_cast<T>(from);
}
template <typename F, typename T, std::enable_if_t<std::is_signed_v<F> && std::is_signed_v<T> && (sizeof(F) > sizeof(T))>* = nullptr>
void convertToSigned(const F& from, T& to) const
{
convertToSmaller(from, to);
}
template <typename F, typename T, std::enable_if_t<!std::is_signed_v<F> && std::is_signed_v<T>>* = nullptr>
void convertToSigned(const F& from, T& to) const
{
convertUnsignedToSigned(from, to);
}
template <typename F, typename T, std::enable_if_t<!std::is_signed_v<F> && !std::is_signed_v<T> && (sizeof(F) <= sizeof(T))>* = nullptr>
void convertToUnsigned(const F& from, T& to) const
{
to = static_cast<T>(from);
}
template <typename F, typename T, std::enable_if_t<!std::is_signed_v<F> && !std::is_signed_v<T> && (sizeof(F) > sizeof(T))>* = nullptr>
void convertToUnsigned(const F& from, T& to) const
{
convertToSmallerUnsigned(from, to);
}
template <typename F, typename T, std::enable_if_t<std::is_signed_v<F> && !std::is_signed_v<T>>* = nullptr>
void convertToUnsigned(const F& from, T& to) const
{
convertSignedToUnsigned(from, to);
}
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F>, bool> = true,
std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
static void convertToFP(F& from, T& to)
/// Converts unsigned integral data types to floating-point data types.
/// If the number of significant digits used for the integer vaue exceeds the number
/// of available digits in the floatinng-point destination (ie. if precision would be lost
/// by casting the value), RangeException is thrown.
{
if (isPrecisionLost<F, T>(from))
POCO_VAR_RANGE_EXCEPTION ("Lost precision", from);
to = static_cast<T>(from);
}
private:
template <typename F, typename T>
void checkUpperLimit(const F& from) const
template <typename T>
static constexpr T unpreserveSign(const T& value)
{
if (from > std::numeric_limits<T>::max())
throw RangeException("Value too large.");
}
template <typename F, typename T>
void checkLowerLimit(const F& from) const
{
if (from < std::numeric_limits<T>::min())
throw RangeException("Value too small.");
}
template <typename F, typename T>
void checkUpperLimitFloat(const F& from) const
{
if (std::is_floating_point<T>::value)
if constexpr (std::is_signed_v<T>)
{
if (from > std::numeric_limits<T>::max())
throw RangeException("Value too large.");
return (value < 0) ? -value : value;
}
else
{
// Avoid clang -Wimplicit-int-float-conversion warning with an explicit cast.
if (from > static_cast<F>(std::numeric_limits<T>::max()))
throw RangeException("Value too large.");
return value;
}
}
template <typename F, typename T>
void checkLowerLimitFloat(const F& from) const
template <typename T, std::enable_if_t<std::is_same_v<T, bool>, bool> = true>
static constexpr int numValDigits(const T& value)
{
if (std::is_floating_point<T>::value)
return 1;
}
template <typename T, std::enable_if_t<std::is_integral_v<T> && !std::is_same_v<T, bool>, bool> = true>
static constexpr int numValDigits(const T& value)
{
using U = std::make_unsigned_t<T>;
if (value == 0) return 0;
int digitCount = 0;
U locVal = static_cast<U>(unpreserveSign(value)); // to prevent sign preservation
while (locVal >>= 1) ++digitCount;
return digitCount;
}
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
static constexpr int numValDigits(T value)
{
return numValDigits<int64_t>(static_cast<int64_t>(value));
}
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
static constexpr int numTypeDigits()
{
return std::numeric_limits<T>::digits;
}
template <typename T, std::enable_if_t<std::is_integral_v<T>, bool> = true>
static constexpr int numTypeDigits()
{
return numValDigits(std::numeric_limits<T>::max());
}
template <typename F, typename T,
std::enable_if_t<std::is_integral_v<F>, bool> = true,
std::enable_if_t<std::is_floating_point_v<T>, bool> = true>
static bool isPrecisionLost(const F& from)
// Checks for loss of precision in integral -> floating point conversion.
{
return numValDigits(from) > numTypeDigits<T>();
}
template <typename F, typename T, std::enable_if_t<std::is_integral_v<F>, bool> = true>
static void checkUpperLimit(const F& from)
{
if (from > static_cast<F>(std::numeric_limits<T>::max()))
POCO_VAR_RANGE_EXCEPTION ("Value too big", from);
}
template <typename F, typename T, std::enable_if_t<std::is_integral_v<F>, bool> = true>
static void checkLowerLimit(const F& from)
{
if (from < static_cast<F>(std::numeric_limits<T>::min()))
POCO_VAR_RANGE_EXCEPTION ("Value too small", from);
}
template <typename F, typename T, std::enable_if_t<std::is_floating_point_v<F>, bool> = true>
static void checkUpperLimit(const F& from)
{
if ((from > static_cast<F>(std::numeric_limits<T>::max())))
POCO_VAR_RANGE_EXCEPTION ("Value too big", from);
}
template <typename F, typename T, std::enable_if_t<std::is_floating_point_v<F>, bool> = true>
static void checkLowerLimit(const F& from)
{
if constexpr(std::is_floating_point_v<T>)
{
if (from < -std::numeric_limits<T>::max())
throw RangeException("Value too small.");
}
else
{
// Avoid clang -Wimplicit-int-float-conversion warning with an explicit cast.
if (from < static_cast<F>(std::numeric_limits<T>::min()))
throw RangeException("Value too small.");
if (static_cast<F>(-std::numeric_limits<T>::max()) > from)
POCO_VAR_RANGE_EXCEPTION ("Value too small", from);
}
else if (from < static_cast<F>(std::numeric_limits<T>::min()))
POCO_VAR_RANGE_EXCEPTION ("Value too small", from);
}
};
@@ -738,6 +842,287 @@ public:
return typeid(T);
}
void convert(Int8& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToSigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(Int16& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToSigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(Int32& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToSigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(Int64& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToSigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(UInt8& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToUnsigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(UInt16& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToUnsigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(UInt32& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToUnsigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(UInt64& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToUnsigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
#ifdef POCO_INT64_IS_LONG
void convert(long long& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToSigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
void convert(unsigned long long& val) const
{
if constexpr (std::is_enum_v<T>)
{
convertToUnsigned(std::underlying_type_t<T>(_val), val);
}
else
{
VarHolder::convert(val);
}
}
#endif
void convert(bool& val) const
{
if constexpr (std::is_enum_v<T>)
{
val = (std::underlying_type_t<T>(_val) != 0);
}
else
{
VarHolder::convert(val);
}
}
void convert(float& val) const
{
if constexpr (std::is_enum_v<T>)
{
val = static_cast<float>(_val);
}
else
{
VarHolder::convert(val);
}
}
void convert(double& val) const
{
if constexpr (std::is_enum_v<T>)
{
val = static_cast<double>(_val);
}
else
{
VarHolder::convert(val);
}
}
void convert(char& val) const
{
if constexpr (std::is_enum_v<T>)
{
val = static_cast<char>(_val);
}
else
{
VarHolder::convert(val);
}
}
void convert(std::string& val) const
{
if constexpr (std::is_enum_v<T>)
{
val = NumberFormatter::format(std::underlying_type_t<T>(_val));
}
else
{
VarHolder::convert(val);
}
}
void convert(Poco::UTF16String& val) const
{
if constexpr (std::is_enum_v<T>)
{
std::string str = NumberFormatter::format(std::underlying_type_t<T>(_val));
Poco::UnicodeConverter::convert(str, val);
}
else
{
VarHolder::convert(val);
}
}
bool isArray() const
{
if constexpr (std::is_enum_v<T>)
{
return false;
}
else
{
return VarHolder::isArray();
}
}
bool isStruct() const
{
if constexpr (std::is_enum_v<T>)
{
return false;
}
else
{
return VarHolder::isStruct();
}
}
bool isInteger() const
{
if constexpr (std::is_enum_v<T>)
{
return std::numeric_limits<std::underlying_type_t<T>>::is_integer;
}
else
{
return VarHolder::isInteger();
}
}
bool isSigned() const
{
if constexpr (std::is_enum_v<T>)
{
return std::numeric_limits<std::underlying_type_t<T>>::is_signed;
}
else
{
return VarHolder::isSigned();
}
}
bool isNumeric() const
{
if constexpr (std::is_enum_v<T>)
{
return std::numeric_limits<std::underlying_type_t<T>>::is_specialized;
}
else
{
return VarHolder::isNumeric();
}
}
bool isBoolean() const
{
if constexpr (std::is_enum_v<T>)
{
return false;
}
else
{
return VarHolder::isBoolean();
}
}
bool isString() const
{
if constexpr (std::is_enum_v<T>)
{
return false;
}
else
{
return VarHolder::isString();
}
}
VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
{
return cloneHolder(pVarHolder, _val);
@@ -835,12 +1220,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -991,12 +1376,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1144,12 +1529,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1296,12 +1681,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1463,12 +1848,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1615,12 +2000,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1767,12 +2152,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -1919,12 +2304,12 @@ public:
void convert(float& val) const
{
val = static_cast<float>(_val);
convertToFP(_val, val);
}
void convert(double& val) const
{
val = static_cast<double>(_val);
convertToFP(_val, val);
}
void convert(char& val) const
@@ -4327,10 +4712,10 @@ private:
};
typedef std::vector<Var> Vector;
typedef std::deque<Var> Deque;
typedef std::list<Var> List;
typedef Vector Array;
using Vector = std::vector<Var>;
using Deque = std::deque<Var>;
using List = std::list<Var>;
using Array = Vector;
} } // namespace Poco::Dynamic

View File

@@ -69,6 +69,18 @@ public:
bool operator != (const VarIterator& other) const;
/// Inequality operator.
bool operator < (const VarIterator& other) const;
/// Less than operator.
bool operator > (const VarIterator& other) const;
/// Greater than operator.
bool operator <= (const VarIterator& other) const;
/// Less than or equal to operator.
bool operator >= (const VarIterator& other) const;
/// Greater than or equal to operator.
Var& operator * () const;
/// Returns value at the current position.
@@ -138,6 +150,30 @@ inline bool VarIterator::operator != (const VarIterator& other) const
}
inline bool VarIterator::operator < (const VarIterator& other) const
{
return _position < other._position;
}
inline bool VarIterator::operator > (const VarIterator& other) const
{
return _position > other._position;
}
inline bool VarIterator::operator <= (const VarIterator& other) const
{
return _position <= other._position;
}
inline bool VarIterator::operator >= (const VarIterator& other) const
{
return _position >= other._position;
}
} } // namespace Poco::Dynamic

View File

@@ -0,0 +1,116 @@
//
// VarVisitor.h
//
// Library: Foundation
// Package: Dynamic
// Module: VarVisitor
//
// Definition of the VarVisitor class.
//
// Copyright (c) 2023, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_VarVisitor_INCLUDED
#define Foundation_VarVisitor_INCLUDED
#include "Poco/Dynamic/Var.h"
#include <unordered_map>
#include <functional>
namespace Poco {
namespace Details {
#ifndef POCO_DOC
struct TypeInfoHash
{
inline std::size_t operator()(std::type_info const& t) const { return t.hash_code(); }
};
struct EqualRef
{
template <typename T>
bool operator()(std::reference_wrapper<T> a, std::reference_wrapper<T> b) const
{
return a.get() == b.get();
}
};
using TypeInfoRef = std::reference_wrapper<std::type_info const>;
using HandlerCaller = std::function<void(const Poco::Dynamic::Var&)>;
template <typename T>
using HandlerPointer = void (*)(const T&);
template <typename T>
using Handler = std::function<void(const T&)>;
#endif // POCO_DOC
} // Details
namespace Dynamic {
class Foundation_API Visitor
/// VarVisitor class.
{
std::unordered_map<Details::TypeInfoRef,
Details::HandlerCaller,
Details::TypeInfoHash,
Details::EqualRef> _handlers;
public:
template <typename T>
bool addHandler(const Details::Handler<T>& f)
/// Add handler for specific type T which holds in Var.
/// This method is more safe, because it saves copy of handler : lambda or std::function.
/// Returns true if handler was added.
{
auto result = _handlers.emplace(std::ref(typeid(T)),
Details::HandlerCaller([handler = f](const Poco::Dynamic::Var& x)
{
handler(x.extract<T>());
}));
return result.second;
}
template <typename T>
bool addHandler(Details::HandlerPointer<T> f)
/// Add handler for specific type T which holds in Var.
/// This method is less safe, because it saves only copy of function pointer.
/// Returns true if handler was added.
{
auto result = _handlers.emplace(std::ref(typeid(T)),
Details::HandlerCaller([handlerPointer = f](const Poco::Dynamic::Var& x)
{
handlerPointer(x.extract<T>());
}));
return result.second;
}
bool visit(const Poco::Dynamic::Var& x) const;
/// Find handler for held type and if it exists call handler.
/// Returns true if hanlder was found othrewise returns false.
};
} } // namespace Poco::Dynamic
#endif // Foundation_VarVisitor_INCLUDED

View File

@@ -1,59 +0,0 @@
//
// Environment_WINCE.h
//
// Library: Foundation
// Package: Core
// Module: Environment
//
// Definition of the EnvironmentImpl class for WINCE.
//
// Copyright (c) 2009-2010, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_Environment_WINCE_INCLUDED
#define Foundation_Environment_WINCE_INCLUDED
#include "Poco/Foundation.h"
namespace Poco {
class Foundation_API EnvironmentImpl
{
public:
typedef UInt8 NodeId[6]; /// Ethernet address.
static std::string getImpl(const std::string& name);
static bool hasImpl(const std::string& name);
static void setImpl(const std::string& name, const std::string& value);
static std::string osNameImpl();
static std::string osDisplayNameImpl();
static std::string osVersionImpl();
static std::string osArchitectureImpl();
static std::string nodeNameImpl();
static void nodeIdImpl(NodeId& id);
static unsigned processorCountImpl();
private:
static bool envVar(const std::string& name, std::string* value);
static const std::string TEMP;
static const std::string TMP;
static const std::string HOMEPATH;
static const std::string COMPUTERNAME;
static const std::string OS;
static const std::string NUMBER_OF_PROCESSORS;
static const std::string PROCESSOR_ARCHITECTURE;
};
} // namespace Poco
#endif // Foundation_Environment_WINCE_INCLUDED

View File

@@ -43,6 +43,9 @@ public:
static std::string getMessage(int errorCode);
/// Utility function translating numeric error code to string.
#endif
static std::string getLastMessage();
/// Utility function returning the last error message.
};

View File

@@ -55,7 +55,7 @@ public:
/// the event is automatically reset after
/// a wait() successfully returns.
//@ deprecated
POCO_DEPRECATED("")
explicit Event(bool autoReset);
/// Please use Event::Event(EventType) instead.

View File

@@ -39,8 +39,8 @@ protected:
void resetImpl();
private:
bool _auto;
bool _state;
std::atomic<bool> _auto;
std::atomic<bool> _state;
pthread_mutex_t _mutex;
pthread_cond_t _cond;
};

View File

@@ -103,6 +103,12 @@ private:
int _code;
};
#if defined(_HAS_EXCEPTIONS)
// Size of Poco::Exception depends on the exception settings (like _HAS_EXCEPTIONS)
// that might influence size of std::exception from which Poco::Exception is derived from.
// It is expected that Poco libraries and application using Poco have the same settings.
static_assert(_HAS_EXCEPTIONS != 0);
#endif
//
// inlines
@@ -228,6 +234,7 @@ POCO_DECLARE_EXCEPTION(Foundation_API, PropertyNotSupportedException, RuntimeExc
POCO_DECLARE_EXCEPTION(Foundation_API, PoolOverflowException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, NoPermissionException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, OutOfMemoryException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, ResourceLimitException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, DataException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, DataFormatException, DataException)
@@ -246,6 +253,8 @@ POCO_DECLARE_EXCEPTION(Foundation_API, CreateFileException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, OpenFileException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, WriteFileException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, ReadFileException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, ExecuteFileException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, FileNotReadyException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, DirectoryNotEmptyException, FileException)
POCO_DECLARE_EXCEPTION(Foundation_API, UnknownURISchemeException, RuntimeException)
POCO_DECLARE_EXCEPTION(Foundation_API, TooManyURIRedirectsException, RuntimeException)

View File

@@ -26,9 +26,8 @@
namespace Poco {
//@ deprecated
template <class TArgs, class TMutex = FastMutex>
class FIFOEvent: public AbstractEvent <
class POCO_DEPRECATED("use BasicEvent") FIFOEvent: public AbstractEvent <
TArgs,
FIFOStrategy<TArgs, AbstractDelegate<TArgs>>,
AbstractDelegate<TArgs>,

View File

@@ -24,9 +24,8 @@
namespace Poco {
//@ deprecated
template <class TArgs, class TDelegate>
class FIFOStrategy: public DefaultStrategy<TArgs, TDelegate>
class POCO_DEPRECATED("") FIFOStrategy: public DefaultStrategy<TArgs, TDelegate>
/// Note: As of release 1.4.2, DefaultStrategy already
/// implements FIFO behavior, so this class is provided
/// for backwards compatibility only.
@@ -41,6 +40,11 @@ public:
{
}
FIFOStrategy(FIFOStrategy&& s):
DefaultStrategy<TArgs, TDelegate>(std::move(s))
{
}
~FIFOStrategy()
{
}
@@ -50,6 +54,12 @@ public:
DefaultStrategy<TArgs, TDelegate>::operator = (s);
return *this;
}
FIFOStrategy& operator = (FIFOStrategy&& s)
{
DefaultStrategy<TArgs, TDelegate>::operator = (s);
return *this;
}
};

View File

@@ -26,7 +26,7 @@
namespace Poco {
class FPEnvironmentImpl
class Foundation_API FPEnvironmentImpl
{
protected:
enum RoundingModeImpl

View File

@@ -29,7 +29,7 @@
namespace Poco {
class FPEnvironmentImpl
class Foundation_API FPEnvironmentImpl
{
protected:
enum RoundingModeImpl

View File

@@ -26,7 +26,7 @@
namespace Poco {
class FPEnvironmentImpl
class Foundation_API FPEnvironmentImpl
{
protected:
enum RoundingModeImpl

View File

@@ -25,7 +25,7 @@
namespace Poco {
class FPEnvironmentImpl
class Foundation_API FPEnvironmentImpl
{
protected:
enum RoundingModeImpl

View File

@@ -24,11 +24,7 @@
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(_WIN32_WCE)
#include "File_WINCE.h"
#else
#include "Poco/File_WIN32U.h"
#endif
#elif defined(POCO_VXWORKS)
#include "Poco/File_VX.h"
#elif defined(POCO_OS_FAMILY_UNIX)
@@ -58,7 +54,7 @@ class Foundation_API File: private FileImpl
/// use the forward slash ("/") as directory separator.
{
public:
typedef FileSizeImpl FileSize;
using FileSize = FileSizeImpl;
enum LinkType
/// Type of link for linkTo().
@@ -88,7 +84,7 @@ public:
File(const File& file);
/// Copy constructor.
virtual ~File();
~File() override;
/// Destroys the file.
File& operator = (const File& file);
@@ -109,9 +105,24 @@ public:
const std::string& path() const;
/// Returns the path.
std::string absolutePath() const;
/// Returns absolute path.
/// Attempts to find the existing file
/// using curent work directory and the PATH
/// environment variable.
/// If the file doesn't exist, returns empty string.
bool exists() const;
/// Returns true iff the file exists.
bool existsAnywhere() const;
/// If the file path is relative, searches
/// for the file in the current working directory
/// and the environment paths.
/// If the file path is absolute, the
/// functionality is identical to the
/// exists() call.
bool canRead() const;
/// Returns true iff the file is readable.

View File

@@ -47,19 +47,25 @@ class Foundation_API FileIOS: public virtual std::ios
/// On Windows platforms, UTF-8 encoded Unicode paths are correctly handled.
{
public:
FileIOS(std::ios::openmode defaultMode);
using NativeHandle = FileStreamBuf::NativeHandle;
FileIOS();
/// Creates the basic stream.
~FileIOS();
~FileIOS() override;
/// Destroys the stream.
void open(const std::string& path, std::ios::openmode mode);
virtual void open(const std::string& path, std::ios::openmode mode);
/// Opens the file specified by path, using the given mode.
///
/// Throws a FileException (or a similar exception) if the file
/// Throws a FileException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons and
/// a new file cannot be created.
void openHandle(NativeHandle handle, std::ios::openmode mode);
/// Takes ownership of the handle.
void close();
/// Closes the file stream.
///
@@ -70,9 +76,17 @@ public:
FileStreamBuf* rdbuf();
/// Returns a pointer to the underlying streambuf.
NativeHandle nativeHandle() const;
/// Returns native file descriptor handle
UInt64 size() const;
/// Returns file size
void flushToDisk();
/// Forces buffered data to be written to the disk
protected:
FileStreamBuf _buf;
std::ios::openmode _defaultMode;
};
@@ -101,8 +115,16 @@ public:
/// Throws a FileNotFoundException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons.
~FileInputStream();
~FileInputStream() override;
/// Destroys the stream.
void open(const std::string& path, std::ios::openmode mode = std::ios::in) override;
/// Opens the file specified by path, using the given mode, which
/// will always include std::ios::in (even if not specified).
///
/// Throws a FileException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons and
/// a new file cannot be created.
};
@@ -131,9 +153,25 @@ public:
/// Throws a FileException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons and
/// a new file cannot be created.
///
/// NOTE: The default mode std::ios::out | std::ios::trunc is different from the default
/// for std::ofstream, which is std::ios::out only. This is for backwards compatibility
/// with earlier POCO versions.
~FileOutputStream();
~FileOutputStream() override;
/// Destroys the FileOutputStream.
void open(const std::string& path, std::ios::openmode mode = std::ios::out | std::ios::trunc) override;
/// Opens the file specified by path, using the given mode, which
/// always includes std::ios::out, even if not specified.
///
/// Throws a FileException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons and
/// a new file cannot be created.
///
/// NOTE: The default mode std::ios::out | std::ios::trunc is different from the default
/// for std::ostream, which is std::ios::out only. This is for backwards compatibility
/// with earlier POCO versions.
};
@@ -160,9 +198,20 @@ public:
FileStream(const std::string& path, std::ios::openmode mode = std::ios::out | std::ios::in);
/// Creates the FileStream for the file given by path, using
/// the given mode.
///
/// NOTE: The default mode std::ios::in | std::ios::out is different from the default
/// for std::fstream, which is std::ios::out only. This is for backwards compatibility
/// with earlier POCO versions.
~FileStream();
~FileStream() override;
/// Destroys the FileOutputStream.
void open(const std::string& path, std::ios::openmode mode = std::ios::out | std::ios::in) override;
/// Opens the file specified by path, using the given mode.
///
/// Throws a FileException (or a similar exception) if the file
/// does not exist or is not accessible for other reasons and
/// a new file cannot be created.
};

View File

@@ -0,0 +1,204 @@
//
// FileStreamRWLock.h
//
// Library: Foundation
// Package: Processes
// Module: FileStreamRWLock
//
// Definition of the FileStreamRWLock class.
//
// Copyright (c) 2004-2024, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_FileStreamRWLock_INCLUDED
#define Foundation_FileStreamRWLock_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/FileStream.h"
#include <atomic>
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/FileStreamRWLock_WIN32.h"
#else
#include "Poco/FileStreamRWLock_POSIX.h"
#endif
namespace Poco {
class ScopedFStreamRWLock;
class ScopedFStreamReadRWLock;
class ScopedFStreamWriteRWLock;
class Foundation_API FileStreamRWLock: private FileStreamRWLockImpl
/// A reader writer lock on the file region allows multiple concurrent
/// process-readers or one exclusive process-writer.
{
public:
using ScopedLock = ScopedFStreamRWLock;
using ScopedReadLock = ScopedFStreamReadRWLock;
using ScopedWriteLock = ScopedFStreamWriteRWLock;
FileStreamRWLock(const FileStream &fs, Poco::UInt64 offset, Poco::UInt64 size);
/// Creates the Reader/Writer lock on the file region.
/// offset - from start of the file
/// size - size of the locker region
~FileStreamRWLock();
/// Destroys the Reader/Writer lock on the file region.
void readLock();
/// Acquires a read lock. If another process currently holds a write lock,
/// waits until the write lock is released.
bool tryReadLock();
/// Tries to acquire a read lock. Immediately returns true if successful, or
/// false if another process currently holds a write lock.
void writeLock();
/// Acquires a write lock on the file region. If one or more other processes currently hold
/// locks, waits until all locks are released.
bool tryWriteLock();
/// Tries to acquire a write lock on the file region. Immediately returns true if successful,
/// or false if one or more other processes currently hold
/// locks.
void unlock();
/// Releases the read or write lock.
private:
std::atomic_bool _locked = false;
FileStreamRWLock(const FileStreamRWLock&);
FileStreamRWLock& operator = (const FileStreamRWLock&);
};
class Foundation_API ScopedFStreamRWLock
/// A variant of ScopedLock for reader/writer locks.
{
public:
ScopedFStreamRWLock(FileStreamRWLock& rwl, bool write = false);
~ScopedFStreamRWLock();
private:
FileStreamRWLock& _rwl;
ScopedFStreamRWLock();
ScopedFStreamRWLock(const ScopedFStreamRWLock&);
ScopedFStreamRWLock& operator = (const ScopedFStreamRWLock&);
};
class Foundation_API ScopedFStreamReadRWLock : public ScopedFStreamRWLock
/// A variant of ScopedLock for reader locks.
{
public:
ScopedFStreamReadRWLock(FileStreamRWLock& rwl);
~ScopedFStreamReadRWLock();
};
class Foundation_API ScopedFStreamWriteRWLock : public ScopedFStreamRWLock
/// A variant of ScopedLock for writer locks.
{
public:
ScopedFStreamWriteRWLock(FileStreamRWLock& rwl);
~ScopedFStreamWriteRWLock();
};
//
// inlines
//
inline void FileStreamRWLock::readLock()
{
readLockImpl();
_locked = true;
}
inline bool FileStreamRWLock::tryReadLock()
{
bool locked = tryReadLockImpl();
if (locked) _locked = true; // assign only if success lock
return locked;
}
inline void FileStreamRWLock::writeLock()
{
writeLockImpl();
_locked = true;
}
inline bool FileStreamRWLock::tryWriteLock()
{
bool locked = tryWriteLockImpl();
if (locked) _locked = true; // assign only if success lock
return locked;
}
inline void FileStreamRWLock::unlock()
{
unlockImpl();
_locked = false;
}
inline ScopedFStreamRWLock::ScopedFStreamRWLock(FileStreamRWLock& rwl, bool write): _rwl(rwl)
{
if (write)
_rwl.writeLock();
else
_rwl.readLock();
}
inline ScopedFStreamRWLock::~ScopedFStreamRWLock()
{
try
{
_rwl.unlock();
}
catch (...)
{
poco_unexpected();
}
}
inline ScopedFStreamReadRWLock::ScopedFStreamReadRWLock(FileStreamRWLock& rwl): ScopedFStreamRWLock(rwl, false)
{
}
inline ScopedFStreamReadRWLock::~ScopedFStreamReadRWLock()
{
}
inline ScopedFStreamWriteRWLock::ScopedFStreamWriteRWLock(FileStreamRWLock& rwl): ScopedFStreamRWLock(rwl, true)
{
}
inline ScopedFStreamWriteRWLock::~ScopedFStreamWriteRWLock()
{
}
} // namespace Poco
#endif // Foundation_FileStreamRWLock_INCLUDED

View File

@@ -0,0 +1,115 @@
//
// FileStreamRWLock_POSIX.h
//
// Library: Foundation
// Package: Processes
// Module: FileStreamRWLock
//
// Definition of the FileStreamRWLockImpl class for POSIX FileStream.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_FileStreamRWLock_POSIX_INCLUDED
#define Foundation_FileStreamRWLock_POSIX_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/FileStream.h"
#include <fcntl.h>
#include <cerrno>
namespace Poco {
class Foundation_API FileStreamRWLockImpl
{
protected:
FileStreamRWLockImpl(const FileStream::NativeHandle &fd, Poco::UInt64 offset, Poco::UInt64 size);
~FileStreamRWLockImpl();
void readLockImpl();
bool tryReadLockImpl();
void writeLockImpl();
bool tryWriteLockImpl();
void unlockImpl();
private:
FileStream::NativeHandle _fd;
struct flock _flock;
int _lockMode;
};
//
// inlines
//
inline void FileStreamRWLockImpl::readLockImpl()
{
_flock.l_type = F_RDLCK;
_lockMode = F_SETLKW;
int rc = fcntl(_fd, _lockMode, &_flock);
if (rc == -1)
throw SystemException("cannot lock reader lock", errno);
}
inline bool FileStreamRWLockImpl::tryReadLockImpl()
{
_flock.l_type = F_RDLCK;
_lockMode = F_SETLK;
int rc = fcntl(_fd, _lockMode, &_flock);
if (rc == 0)
return true;
else if (errno == EAGAIN || errno == EACCES)
return false;
else
throw SystemException("cannot lock try-reader lock", errno);
}
inline void FileStreamRWLockImpl::writeLockImpl()
{
_flock.l_type = F_WRLCK;
_lockMode = F_SETLKW;
int rc = fcntl(_fd, _lockMode, &_flock);
if (rc == -1)
throw SystemException("cannot lock writer lock", errno);
}
inline bool FileStreamRWLockImpl::tryWriteLockImpl()
{
_flock.l_type = F_WRLCK;
_lockMode = F_SETLK;
int rc = fcntl(_fd, _lockMode, &_flock);
if (rc != -1)
return true;
else if (errno == EAGAIN || errno == EACCES)
return false;
else
throw SystemException("cannot lock writer lock", errno);
}
inline void FileStreamRWLockImpl::unlockImpl()
{
_flock.l_type = F_UNLCK;
_lockMode = F_SETLKW;
int rc = fcntl(_fd, _lockMode, &_flock);
if (rc == -1)
throw SystemException("cannot unlock", errno);
}
} // namespace Poco
#endif // Foundation_FileStreamRWLock_POSIX_INCLUDED

View File

@@ -0,0 +1,134 @@
//
// FileStreamRWLock_WIN32.h
//
// Library: Foundation
// Package: Processes
// Module: FileStreamRWLock
//
// Definition of the FileStreamRWLockImpl class for WIN32 FileStream.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_FileStreamRWLock_WIN32_INCLUDED
#define Foundation_FileStreamRWLock_WIN32_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/FileStream.h"
#include <Windows.h>
namespace Poco {
struct LockMode
{
static constexpr DWORD READ = 0;
static constexpr DWORD WRITE = LOCKFILE_EXCLUSIVE_LOCK;
static constexpr DWORD TRY_READ = LOCKFILE_FAIL_IMMEDIATELY;
static constexpr DWORD TRY_WRITE = (LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY);
};
class Foundation_API FileStreamRWLockImpl
{
protected:
FileStreamRWLockImpl(const FileStream::NativeHandle &fd, Poco::UInt64 offset, Poco::UInt64 size);
~FileStreamRWLockImpl();
void readLockImpl();
bool tryReadLockImpl();
void writeLockImpl();
bool tryWriteLockImpl();
void unlockImpl();
private:
FileStream::NativeHandle _fd;
OVERLAPPED _overlapped;
LARGE_INTEGER _size;
};
//
// inlines
//
inline void FileStreamRWLockImpl::readLockImpl()
{
BOOL fSuccess = LockFileEx(_fd, LockMode::READ, 0, _size.LowPart, _size.HighPart, &_overlapped);
if (!fSuccess)
{
throw SystemException("cannot lock reader lock", GetLastError());
}
}
inline bool FileStreamRWLockImpl::tryReadLockImpl()
{
BOOL fSuccess = LockFileEx(_fd, LockMode::TRY_READ, 0, _size.LowPart, _size.HighPart, &_overlapped);
if (fSuccess)
{
return true;
}
else
{
auto lastError = GetLastError();
if (lastError == ERROR_IO_PENDING || lastError == ERROR_LOCK_VIOLATION)
{
return false;
}
else
{
throw SystemException("cannot lock try-reader lock", lastError);
}
}
}
inline void FileStreamRWLockImpl::writeLockImpl()
{
BOOL fSuccess = LockFileEx(_fd, LockMode::WRITE, 0, _size.LowPart, _size.HighPart, &_overlapped);
if (!fSuccess)
{
throw SystemException("cannot lock writer lock", GetLastError());
}
}
inline bool FileStreamRWLockImpl::tryWriteLockImpl()
{
BOOL fSuccess = LockFileEx(_fd, LockMode::TRY_WRITE, 0, _size.LowPart, _size.HighPart, &_overlapped);
if (fSuccess)
{
return true;
}
else
{
auto lastError = GetLastError();
if (lastError == ERROR_IO_PENDING || lastError == ERROR_LOCK_VIOLATION)
{
return false;
}
else
{
throw SystemException("cannot lock try-writer lock", lastError);
}
}
}
inline void FileStreamRWLockImpl::unlockImpl()
{
BOOL fSuccess = UnlockFileEx(_fd, 0, _size.LowPart, _size.HighPart, &_overlapped);
if (!fSuccess)
{
throw SystemException("cannot unlock ", GetLastError());
}
}
} // namespace Poco
#endif // Foundation_FileStreamRWLock_WIN32_INCLUDED

View File

@@ -31,38 +31,58 @@ class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
/// This stream buffer handles Fileio
{
public:
using NativeHandle = int;
FileStreamBuf();
/// Creates a FileStreamBuf.
~FileStreamBuf();
~FileStreamBuf() override;
/// Destroys the FileStream.
void open(const std::string& path, std::ios::openmode mode);
/// Opens the given file in the given mode.
void openHandle(NativeHandle fd, std::ios::openmode mode);
/// Take ownership of the given file descriptor.
bool close();
/// Closes the File stream buffer. Returns true if successful,
/// false otherwise.
std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out);
bool resizeBuffer(std::streamsize bufferSize) override;
/// Resizes internal buffer. Minimum size is BUFFER_SIZE.
/// Minimum is used when requested size is smaller.
/// Buffer can be resized only when the file is not open.
/// Returns true if resize succeeded.
std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out) override;
/// Change position by offset, according to way and mode.
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out) override;
/// Change to specified position, according to mode.
void flushToDisk();
/// Forces buffered data to be written to the disk
NativeHandle nativeHandle() const;
/// Returns native file descriptor handle
UInt64 size() const;
/// Returns file size
protected:
enum
{
BUFFER_SIZE = 4096
};
int readFromDevice(char* buffer, std::streamsize length);
int writeToDevice(const char* buffer, std::streamsize length);
int readFromDevice(char* buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length) override;
private:
std::string _path;
int _fd;
std::streamoff _pos;
NativeHandle _fd;
std::streamoff _pos {0};
};

View File

@@ -25,11 +25,12 @@
namespace Poco {
class Foundation_API FileStreamBuf: public BufferedBidirectionalStreamBuf
/// This stream buffer handles Fileio
{
public:
using NativeHandle = HANDLE;
FileStreamBuf();
/// Creates a FileStreamBuf.
@@ -39,29 +40,47 @@ public:
void open(const std::string& path, std::ios::openmode mode);
/// Opens the given file in the given mode.
void openHandle(NativeHandle handle, std::ios::openmode mode);
/// Take ownership of the given HANDLE.
bool close();
/// Closes the File stream buffer. Returns true if successful,
/// false otherwise.
std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out);
bool resizeBuffer(std::streamsize bufferSize) override;
/// Resizes internal buffer. Minimum size is BUFFER_SIZE.
/// Minimum is used when requested size is smaller.
/// Buffer can be resized only when the file is not open.
/// Returns true if resize succeeded.
std::streampos seekoff(std::streamoff off, std::ios::seekdir dir, std::ios::openmode mode = std::ios::in | std::ios::out) override;
/// change position by offset, according to way and mode
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out);
std::streampos seekpos(std::streampos pos, std::ios::openmode mode = std::ios::in | std::ios::out) override;
/// change to specified position, according to mode
void flushToDisk();
/// Forces buffered data to be written to the disk
NativeHandle nativeHandle() const;
/// Returns native file descriptor handle
Poco::UInt64 size() const;
/// Returns file size
protected:
enum
{
BUFFER_SIZE = 4096
};
int readFromDevice(char* buffer, std::streamsize length);
int writeToDevice(const char* buffer, std::streamsize length);
int readFromDevice(char* buffer, std::streamsize length) override;
int writeToDevice(const char* buffer, std::streamsize length) override;
private:
std::string _path;
HANDLE _handle;
UInt64 _pos;
NativeHandle _handle;
UInt64 _pos {0};
};

View File

@@ -19,6 +19,7 @@
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
namespace Poco {
@@ -32,7 +33,7 @@ protected:
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
};
typedef UInt64 FileSizeImpl;
using FileSizeImpl = UInt64;
FileImpl();
FileImpl(const std::string& path);
@@ -40,10 +41,11 @@ protected:
void swapImpl(FileImpl& file);
void setPathImpl(const std::string& path);
const std::string& getPathImpl() const;
std::string getExecutablePathImpl() const;
bool existsImpl() const;
bool canReadImpl() const;
bool canWriteImpl() const;
bool canExecuteImpl() const;
bool canExecuteImpl(const std::string& absolutePath) const;
bool isFileImpl() const;
bool isDirectoryImpl() const;
bool isLinkImpl() const;

View File

@@ -19,7 +19,7 @@
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
namespace Poco {
@@ -32,7 +32,7 @@ protected:
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
};
typedef UInt64 FileSizeImpl;
using FileSizeImpl = UInt64;
FileImpl();
FileImpl(const std::string& path);
@@ -40,10 +40,11 @@ protected:
void swapImpl(FileImpl& file);
void setPathImpl(const std::string& path);
const std::string& getPathImpl() const;
std::string getExecutablePathImpl() const;
bool existsImpl() const;
bool canReadImpl() const;
bool canWriteImpl() const;
bool canExecuteImpl() const;
bool canExecuteImpl(const std::string& absolutePath) const;
bool isFileImpl() const;
bool isDirectoryImpl() const;
bool isLinkImpl() const;

View File

@@ -33,7 +33,7 @@ protected:
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
};
typedef UInt64 FileSizeImpl;
using FileSizeImpl = UInt64;
FileImpl();
FileImpl(const std::string& path);
@@ -41,10 +41,11 @@ protected:
void swapImpl(FileImpl& file);
void setPathImpl(const std::string& path);
const std::string& getPathImpl() const;
std::string getExecutablePathImpl() const;
bool existsImpl() const;
bool canReadImpl() const;
bool canWriteImpl() const;
bool canExecuteImpl() const;
bool canExecuteImpl(const std::string& absolutePath) const;
bool isFileImpl() const;
bool isDirectoryImpl() const;
bool isLinkImpl() const;

View File

@@ -1,95 +0,0 @@
//
// File_WIN32U.h
//
// Library: Foundation
// Package: Filesystem
// Module: File
//
// Definition of the Unicode FileImpl class for WIN32.
//
// Copyright (c) 2006-2010, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_File_WINCE_INCLUDED
#define Foundation_File_WINCE_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
namespace Poco {
class Foundation_API FileImpl
{
protected:
enum Options {
OPT_FAIL_ON_OVERWRITE_IMPL = 0x01
};
typedef UInt64 FileSizeImpl;
FileImpl();
FileImpl(const std::string& path);
virtual ~FileImpl();
void swapImpl(FileImpl& file);
void setPathImpl(const std::string& path);
const std::string& getPathImpl() const;
bool existsImpl() const;
bool canReadImpl() const;
bool canWriteImpl() const;
bool canExecuteImpl() const;
bool isFileImpl() const;
bool isDirectoryImpl() const;
bool isLinkImpl() const;
bool isDeviceImpl() const;
bool isHiddenImpl() const;
Timestamp createdImpl() const;
Timestamp getLastModifiedImpl() const;
void setLastModifiedImpl(const Timestamp& ts);
FileSizeImpl getSizeImpl() const;
void setSizeImpl(FileSizeImpl size);
void setWriteableImpl(bool flag = true);
void setExecutableImpl(bool flag = true);
void copyToImpl(const std::string& path, int options = 0) const;
void renameToImpl(const std::string& path, int options = 0);
void linkToImpl(const std::string& path, int type) const;
void removeImpl();
bool createFileImpl();
bool createDirectoryImpl();
FileSizeImpl totalSpaceImpl() const;
FileSizeImpl usableSpaceImpl() const;
FileSizeImpl freeSpaceImpl() const;
static void handleLastErrorImpl(const std::string& path);
static void convertPath(const std::string& utf8Path, std::wstring& utf16Path);
private:
std::string _path;
std::wstring _upath;
friend class FileHandle;
friend class DirectoryIteratorImpl;
friend class FileStreamBuf;
friend class LogFileImpl;
};
//
// inlines
//
inline const std::string& FileImpl::getPathImpl() const
{
return _path;
}
} // namespace Poco
#endif // Foundation_File_WINCE_INCLUDED

View File

@@ -63,6 +63,7 @@ std::string Foundation_API format(const std::string& fmt, const Any& value);
/// * E signed floating-point value in the form [-]d.ddddE[<sign>]dd[d]
/// * f signed floating-point value in the form [-]dddd.dddd
/// * s std::string
/// * v std::string_view
/// * z std::size_t
///
/// The following flags are supported:
@@ -115,14 +116,14 @@ inline void formatAny(std::string& result, const std::string& fmt, const std::ve
/// Supports a variable number of arguments and is used by
/// all other variants of format().
{
format(result, fmt, values);
Poco::format(result, fmt, values);
}
inline void formatAny(std::string& result, const char *fmt, const std::vector<Any>& values)
/// Supports a variable number of arguments and is used by
/// all other variants of format().
{
format(result, fmt, values);
Poco::format(result, fmt, values);
}
template <typename T, typename... Args>

View File

@@ -44,7 +44,7 @@
// Foundation_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
//
#if (defined(_WIN32) || defined(_WIN32_WCE)) && defined(POCO_DLL)
#if defined(_WIN32) && defined(POCO_DLL)
#if defined(Foundation_EXPORTS)
#define Foundation_API __declspec(dllexport)
#else
@@ -91,6 +91,14 @@
#endif
#endif
#include <string>
namespace Poco {
using namespace std::literals;
} // namespace Poco
//
// Include platform-specific definitions
@@ -133,32 +141,22 @@
#define POCO_DO_JOIN(X, Y) POCO_DO_JOIN2(X, Y)
#define POCO_DO_JOIN2(X, Y) X##Y
//
// MS Visual Studio can use type long for __LINE__ macro
// when /ZI compilation flag is used - https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format?view=msvc-170#zi-1
// This breaks some poco interfaces, for ex. logger
// We should fix type for line number
namespace Poco {
//
// POCO_DEPRECATED
//
// A macro expanding to a compiler-specific clause to
// mark a class or function as deprecated.
//
#if defined(POCO_NO_DEPRECATED)
#define POCO_DEPRECATED
#elif defined(_GNUC_)
#define POCO_DEPRECATED __attribute__((deprecated))
#elif defined(__clang__)
#define POCO_DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define POCO_DEPRECATED __declspec(deprecated)
#else
#define POCO_DEPRECATED
#endif
using LineNumber = decltype(__LINE__);
}
//
// Pull in basic definitions
//
#include "Poco/Bugcheck.h"
#include "Poco/Types.h"
#include <string>
#endif // Foundation_Foundation_INCLUDED

View File

@@ -25,9 +25,8 @@
namespace Poco {
//@ deprecated
template <class T>
struct HashFunction
struct POCO_DEPRECATED("use Hash") HashFunction
/// A generic hash function.
{
UInt32 operator () (T key, UInt32 maxValue) const
@@ -38,9 +37,8 @@ struct HashFunction
};
//@ deprecated
template <>
struct HashFunction<std::string>
struct POCO_DEPRECATED("use Hash") HashFunction<std::string>
/// A generic hash function.
{
UInt32 operator () (const std::string& key, UInt32 maxValue) const

View File

@@ -85,26 +85,23 @@ class HashMap
/// A HashMap can be used just like a std::map.
{
public:
typedef Key KeyType;
typedef Mapped MappedType;
typedef Mapped& Reference;
typedef const Mapped& ConstReference;
typedef Mapped* Pointer;
typedef const Mapped* ConstPointer;
using KeyType = Key;
using MappedType = Mapped;
using Reference = Mapped &;
using ConstReference = const Mapped &;
using Pointer = Mapped *;
using ConstPointer = const Mapped *;
typedef HashMapEntry<Key, Mapped> ValueType;
typedef std::pair<KeyType, MappedType> PairType;
using ValueType = HashMapEntry<Key, Mapped>;
using PairType = std::pair<KeyType, MappedType>;
typedef HashMapEntryHash<ValueType, HashFunc> HashType;
typedef LinearHashTable<ValueType, HashType> HashTable;
using HashType = HashMapEntryHash<ValueType, HashFunc>;
using HashTable = LinearHashTable<ValueType, HashType>;
typedef typename HashTable::Iterator Iterator;
typedef typename HashTable::ConstIterator ConstIterator;
using Iterator = typename HashTable::Iterator;
using ConstIterator = typename HashTable::ConstIterator;
HashMap()
/// Creates an empty HashMap.
{
}
HashMap() = default;
HashMap(std::size_t initialReserve):
_table(initialReserve)

View File

@@ -24,8 +24,8 @@
namespace Poco {
class POCO_DEPRECATED("") HashStatistic;
//@ deprecated
class Foundation_API HashStatistic
/// HashStatistic class bundles statistical information on the current state of a HashTable
{

View File

@@ -31,9 +31,8 @@
namespace Poco {
//@ deprecated
template <class Key, class Value, class KeyHashFunction = HashFunction<Key>>
class HashTable
class POCO_DEPRECATED("use LinearHashTable") HashTable
/// A HashTable stores a key value pair that can be looked up via a hashed key.
///
/// Collision handling is done via overflow maps(!). With small hash tables performance of this

View File

@@ -22,11 +22,8 @@
#include "Poco/BufferedStreamBuf.h"
#include <istream>
#include <ostream>
#if defined(POCO_UNBUNDLED)
#include <zlib.h>
#else
#include "Poco/zlib.h"
#endif
struct z_stream_s;
namespace Poco {
@@ -92,12 +89,12 @@ private:
INFLATE_BUFFER_SIZE = 32768
};
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream _zstr;
bool _eof;
bool _check;
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream_s* _pZstr;
bool _eof;
bool _check;
};

View File

@@ -0,0 +1,109 @@
//
// JSONFormatter.h
//
// Library: Foundation
// Package: Logging
// Module: JSONFormatter
//
// Definition of the JSONFormatter class.
//
// Copyright (c) 2024, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_JSONFormatter_INCLUDED
#define Foundation_JSONFormatter_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Formatter.h"
#include "Poco/Message.h"
#include <vector>
namespace Poco {
class Foundation_API JSONFormatter: public Formatter
/// This formatter formats log messages as compact
/// (no unnecessary whitespace) single-line JSON strings.
///
/// The following JSON schema is used:
/// {
/// "timestamp": "2024-09-26T13:41:23.324461Z",
/// "source": "sample",
/// "level": "information",
/// "message": "This is a test message.",
/// "thread": 12,
/// "file": "source.cpp",
/// "line": 456,
/// "params": {
/// "prop1": "value1"
/// }
/// }
///
/// The "file" and "line" properties will only be included if the log
/// message contains a file name and line number.
///
/// The "params" object will only be included if custom parameters
/// have been added to the Message.
{
public:
using Ptr = AutoPtr<JSONFormatter>;
JSONFormatter() = default;
/// Creates a JSONFormatter.
~JSONFormatter() = default;
/// Destroys the JSONFormatter.
void format(const Message& msg, std::string& text);
/// Formats the message as a JSON string.
void setProperty(const std::string& name, const std::string& value);
/// Sets the property with the given name to the given value.
///
/// The following properties are supported:
///
/// * times: Specifies whether times are adjusted for local time
/// or taken as they are in UTC. Supported values are "local" and "UTC".
/// * thread: Specifies the value given for the thread. Can be
/// "none" (excluded), "name" (thread name), "id" (POCO thread ID) or "osid"
/// (operating system thread ID).
///
/// If any other property name is given, a PropertyNotSupported
/// exception is thrown.
std::string getProperty(const std::string& name) const;
/// Returns the value of the property with the given name or
/// throws a PropertyNotSupported exception if the given
/// name is not recognized.
static const std::string PROP_TIMES;
static const std::string PROP_THREAD;
protected:
std::string getThread(const Message& message) const;
static const std::string& getPriorityName(int prio);
enum ThreadFormat
{
JSONF_THREAD_NONE = 0,
JSONF_THREAD_NAME = 1,
JSONF_THREAD_ID = 2,
JSONF_THREAD_OS_ID = 3
};
private:
bool _localTime = false;
ThreadFormat _threadFormat = JSONF_THREAD_ID;
};
} // namespace Poco
#endif // Foundation_JSONFormatter_INCLUDED

View File

@@ -38,37 +38,18 @@ enum JSONOptions
/// unicode characters will be escaped in the resulting
/// string.
JSON_WRAP_STRINGS = 4
JSON_WRAP_STRINGS = 4,
/// If specified, the object will preserve the items
/// insertion order. Otherwise, items will be sorted
/// by keys.
JSON_LOWERCASE_HEX = 8
/// If specified, all encoding happens with lowercase
/// HEX characters instead of capitals
};
//@ deprecated
void Foundation_API toJSON(const std::string& value, std::ostream& out, bool wrap = true);
/// Formats string value into the supplied output stream by
/// escaping control and ALL Unicode characters.
/// If wrap is true, the resulting string is enclosed in double quotes.
///
/// This function is deprecated, please use
///
/// void Poco::toJSON(const std::string&, std::ostream&, int)
//@ deprecated
std::string Foundation_API toJSON(const std::string& value, bool wrap = true);
/// Formats string value by escaping control and ALL Unicode characters.
/// If wrap is true, the resulting string is enclosed in double quotes
///
/// Returns formatted string.
///
/// This function is deprecated, please use
///
/// std::string Poco::toJSON(const std::string&, int)
void Foundation_API toJSON(const std::string& value, std::ostream& out, int options);
void Foundation_API toJSON(const std::string& value, std::ostream& out, int options = Poco::JSON_WRAP_STRINGS);
/// Formats string value into the supplied output stream by
/// escaping control characters.
/// If JSON_WRAP_STRINGS is in options, the resulting strings is enclosed in double quotes
@@ -76,7 +57,7 @@ void Foundation_API toJSON(const std::string& value, std::ostream& out, int opti
/// only the compulsory ones.
std::string Foundation_API toJSON(const std::string& value, int options);
std::string Foundation_API toJSON(const std::string& value, int options = Poco::JSON_WRAP_STRINGS);
/// Formats string value by escaping control characters.
/// If JSON_WRAP_STRINGS is in options, the resulting string is enclosed in double quotes
/// If JSON_ESCAPE_UNICODE is in options, all unicode characters will be escaped, otherwise

View File

@@ -20,10 +20,8 @@
#include "Poco/Foundation.h"
#include "Poco/Hash.h"
#include <functional>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstddef>
@@ -56,20 +54,26 @@ class LinearHashTable
/// elements in a bucket should not exceed 3.
{
public:
typedef Value ValueType;
typedef Value& Reference;
typedef const Value& ConstReference;
typedef Value* Pointer;
typedef const Value* ConstPointer;
typedef HashFunc Hash;
typedef std::vector<Value> Bucket;
typedef std::vector<Bucket> BucketVec;
typedef typename Bucket::iterator BucketIterator;
typedef typename BucketVec::iterator BucketVecIterator;
using ValueType = Value;
using Reference = Value &;
using ConstReference = const Value &;
using Pointer = Value *;
using ConstPointer = const Value *;
using Hash = HashFunc;
using Bucket = std::vector<Value>;
using BucketVec = std::vector<Bucket>;
using BucketIterator = typename Bucket::iterator;
using BucketVecIterator = typename BucketVec::iterator;
class ConstIterator: public std::iterator<std::forward_iterator_tag, Value>
class ConstIterator
{
public:
using iterator_category = std::forward_iterator_tag;
using value_type = Value;
using difference_type = ptrdiff_t;
using pointer = Value*;
using reference = Value&;
ConstIterator(): _initialized(false)
{
}
@@ -171,9 +175,7 @@ public:
class Iterator: public ConstIterator
{
public:
Iterator()
{
}
Iterator() = default;
Iterator(const BucketVecIterator& vecIt, const BucketVecIterator& endIt, const BucketIterator& buckIt):
ConstIterator(vecIt, endIt, buckIt)
@@ -233,10 +235,7 @@ public:
friend class LinearHashTable;
};
LinearHashTable(std::size_t initialReserve = 64):
_split(0),
_front(1),
_size(0)
LinearHashTable(std::size_t initialReserve = 64)
/// Creates the LinearHashTable, using the given initialReserve.
{
_buckets.reserve(calcSize(initialReserve));
@@ -252,10 +251,8 @@ public:
{
}
~LinearHashTable()
~LinearHashTable() = default;
/// Destroys the LinearHashTable.
{
}
LinearHashTable& operator = (const LinearHashTable& table)
/// Assigns another LinearHashTable.
@@ -490,9 +487,9 @@ private:
// Evil hack: _buckets must be mutable because both ConstIterator and Iterator hold
// ordinary iterator's (not const_iterator's).
mutable BucketVec _buckets;
std::size_t _split;
std::size_t _front;
std::size_t _size;
std::size_t _split{0};
std::size_t _front{1};
std::size_t _size{0};
HashFunc _hash;
};

View File

@@ -67,7 +67,6 @@ public:
/// * millisecond is from 0 to 999.
/// * microsecond is from 0 to 999.
//@ deprecated
LocalDateTime(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond);
/// Creates a LocalDateTime for the given Gregorian date and time in the
/// time zone denoted by the time zone differential in tzd.
@@ -85,13 +84,11 @@ public:
/// Creates a LocalDateTime from the UTC time given in dateTime,
/// using the time zone differential of the current time zone.
//@ deprecated
LocalDateTime(int tzd, const DateTime& dateTime);
/// Creates a LocalDateTime from the UTC time given in dateTime,
/// using the given time zone differential. Adjusts dateTime
/// for the given time zone differential.
//@ deprecated
LocalDateTime(int tzd, const DateTime& dateTime, bool adjust);
/// Creates a LocalDateTime from the UTC time given in dateTime,
/// using the given time zone differential. If adjust is true,
@@ -100,7 +97,6 @@ public:
LocalDateTime(double julianDay);
/// Creates a LocalDateTime for the given Julian day in the local time zone.
//@ deprecated
LocalDateTime(int tzd, double julianDay);
/// Creates a LocalDateTime for the given Julian day in the time zone
/// denoted by the time zone differential in tzd.
@@ -131,7 +127,6 @@ public:
/// * millisecond is from 0 to 999.
/// * microsecond is from 0 to 999.
//@ deprecated
LocalDateTime& assign(int tzd, int year, int month, int day, int hour, int minute, int second, int millisecond, int microseconds);
/// Assigns a Gregorian local date and time in the time zone denoted by
/// the time zone differential in tzd.
@@ -145,7 +140,6 @@ public:
/// * millisecond is from 0 to 999.
/// * microsecond is from 0 to 999.
//@ deprecated
LocalDateTime& assign(int tzd, double julianDay);
/// Assigns a Julian day in the time zone denoted by the
/// time zone differential in tzd.

View File

@@ -17,21 +17,14 @@
#ifndef Foundation_LogFile_INCLUDED
#define Foundation_LogFile_INCLUDED
#include "Poco/Foundation.h"
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/LogFile_WIN32U.h"
#else
#include "Poco/LogFile_STD.h"
#endif
#include "Poco/Timestamp.h"
#include "Poco/FileStream.h"
namespace Poco {
class Foundation_API LogFile: public LogFileImpl
class Foundation_API LogFile
/// This class is used by FileChannel to work
/// with a log file.
{
@@ -55,36 +48,15 @@ public:
const std::string& path() const;
/// Returns the path given in the constructor.
private:
std::string _path;
mutable Poco::FileOutputStream _str;
Timestamp _creationDate;
UInt64 _size;
};
//
// inlines
//
inline void LogFile::write(const std::string& text, bool flush)
{
writeImpl(text, flush);
}
inline UInt64 LogFile::size() const
{
return sizeImpl();
}
inline Timestamp LogFile::creationDate() const
{
return creationDateImpl();
}
inline const std::string& LogFile::path() const
{
return pathImpl();
}
} // namespace Poco

View File

@@ -1,53 +0,0 @@
//
// LogFile_STD.h
//
// Library: Foundation
// Package: Logging
// Module: LogFile
//
// Definition of the LogFileImpl class using iostreams.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_LogFile_STD_INCLUDED
#define Foundation_LogFile_STD_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
#include "Poco/FileStream.h"
namespace Poco {
class Foundation_API LogFileImpl
/// The implementation of LogFile for non-Windows platforms.
/// The native filesystem APIs are used for
/// total control over locking behavior.
{
public:
LogFileImpl(const std::string& path);
~LogFileImpl();
void writeImpl(const std::string& text, bool flush);
UInt64 sizeImpl() const;
Timestamp creationDateImpl() const;
const std::string& pathImpl() const;
private:
std::string _path;
mutable Poco::FileOutputStream _str;
Timestamp _creationDate;
UInt64 _size;
};
} // namespace Poco
#endif // Foundation_LogFile_STD_INCLUDED

View File

@@ -1,54 +0,0 @@
//
// LogFile_WIN32U.h
//
// Library: Foundation
// Package: Logging
// Module: LogFile
//
// Definition of the LogFileImpl class using the Windows file APIs.
//
// Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_LogFile_WIN32U_INCLUDED
#define Foundation_LogFile_WIN32U_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Timestamp.h"
#include "Poco/UnWindows.h"
namespace Poco {
class Foundation_API LogFileImpl
/// The implementation of LogFile for Windows.
/// The native filesystem APIs are used for
/// total control over locking behavior.
{
public:
LogFileImpl(const std::string& path);
~LogFileImpl();
void writeImpl(const std::string& text, bool flush);
UInt64 sizeImpl() const;
Timestamp creationDateImpl() const;
const std::string& pathImpl() const;
private:
void createFile();
std::string _path;
HANDLE _hFile;
Timestamp _creationDate;
};
} // namespace Poco
#endif // Foundation_LogFile_WIN32U_INCLUDED

View File

@@ -130,7 +130,7 @@ public:
void log(const Exception& exc);
/// Logs the given exception with priority PRIO_ERROR.
void log(const Exception& exc, const char* file, int line);
void log(const Exception& exc, const char* file, LineNumber line);
/// Logs the given exception with priority PRIO_ERROR.
///
/// File must be a static string, such as the value of
@@ -142,8 +142,8 @@ public:
/// creates a Message with priority PRIO_FATAL
/// and the given message text and sends it
/// to the attached channel.
void fatal(const std::string& msg, const char* file, int line);
void fatal(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_FATAL,
/// creates a Message with priority PRIO_FATAL
/// and the given message text and sends it
@@ -166,7 +166,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void critical(const std::string& msg, const char* file, int line);
void critical(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_CRITICAL,
/// creates a Message with priority PRIO_CRITICAL
/// and the given message text and sends it
@@ -189,7 +189,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void error(const std::string& msg, const char* file, int line);
void error(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_ERROR,
/// creates a Message with priority PRIO_ERROR
/// and the given message text and sends it
@@ -212,7 +212,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void warning(const std::string& msg, const char* file, int line);
void warning(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_WARNING,
/// creates a Message with priority PRIO_WARNING
/// and the given message text and sends it
@@ -235,7 +235,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void notice(const std::string& msg, const char* file, int line);
void notice(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_NOTICE,
/// creates a Message with priority PRIO_NOTICE
/// and the given message text and sends it
@@ -258,7 +258,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void information(const std::string& msg, const char* file, int line);
void information(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_INFORMATION,
/// creates a Message with priority PRIO_INFORMATION
/// and the given message text and sends it
@@ -281,7 +281,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void debug(const std::string& msg, const char* file, int line);
void debug(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_DEBUG,
/// creates a Message with priority PRIO_DEBUG
/// and the given message text and sends it
@@ -304,7 +304,7 @@ public:
/// and the given message text and sends it
/// to the attached channel.
void trace(const std::string& msg, const char* file, int line);
void trace(const std::string& msg, const char* file, LineNumber line);
/// If the Logger's log level is at least PRIO_TRACE,
/// creates a Message with priority PRIO_TRACE
/// and the given message text and sends it
@@ -462,7 +462,8 @@ protected:
~Logger();
void log(const std::string& text, Message::Priority prio);
void log(const std::string& text, Message::Priority prio, const char* file, int line);
void logNPC(const std::string& text, Message::Priority prio);
void log(const std::string& text, Message::Priority prio, const char* file, LineNumber line);
static std::string format(const std::string& fmt, int argc, std::string argv[]);
static Logger& parent(const std::string& name);
@@ -789,7 +790,16 @@ inline void Logger::log(const std::string& text, Message::Priority prio)
}
inline void Logger::log(const std::string& text, Message::Priority prio, const char* file, int line)
inline void Logger::logNPC(const std::string& text, Message::Priority prio)
{
if (_pChannel)
{
_pChannel->log(Message(_name, text, prio));
}
}
inline void Logger::log(const std::string& text, Message::Priority prio, const char* file, LineNumber line)
{
if (_level >= prio && _pChannel)
{
@@ -813,7 +823,7 @@ inline void Logger::fatal(const std::string& msg)
}
inline void Logger::fatal(const std::string& msg, const char* file, int line)
inline void Logger::fatal(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_FATAL, file, line);
}
@@ -826,7 +836,7 @@ inline void Logger::critical(const std::string& msg)
}
inline void Logger::critical(const std::string& msg, const char* file, int line)
inline void Logger::critical(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_CRITICAL, file, line);
}
@@ -838,7 +848,7 @@ inline void Logger::error(const std::string& msg)
}
inline void Logger::error(const std::string& msg, const char* file, int line)
inline void Logger::error(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_ERROR, file, line);
}
@@ -850,7 +860,7 @@ inline void Logger::warning(const std::string& msg)
}
inline void Logger::warning(const std::string& msg, const char* file, int line)
inline void Logger::warning(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_WARNING, file, line);
}
@@ -862,7 +872,7 @@ inline void Logger::notice(const std::string& msg)
}
inline void Logger::notice(const std::string& msg, const char* file, int line)
inline void Logger::notice(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_NOTICE, file, line);
}
@@ -874,7 +884,7 @@ inline void Logger::information(const std::string& msg)
}
inline void Logger::information(const std::string& msg, const char* file, int line)
inline void Logger::information(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_INFORMATION, file, line);
}
@@ -886,7 +896,7 @@ inline void Logger::debug(const std::string& msg)
}
inline void Logger::debug(const std::string& msg, const char* file, int line)
inline void Logger::debug(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_DEBUG, file, line);
}
@@ -898,7 +908,7 @@ inline void Logger::trace(const std::string& msg)
}
inline void Logger::trace(const std::string& msg, const char* file, int line)
inline void Logger::trace(const std::string& msg, const char* file, LineNumber line)
{
log(msg, Message::PRIO_TRACE, file, line);
}

View File

@@ -229,6 +229,7 @@ private:
_memory.next = next;
}
#ifndef POCO_DOC
union
/// Memory block storage.
///
@@ -242,6 +243,7 @@ private:
char buffer[sizeof(T)];
Block* next;
} _memory;
#endif
private:
Block(const Block&);

View File

@@ -140,6 +140,12 @@ public:
return newoff;
}
virtual pos_type seekpos(pos_type pos, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
{
const off_type off = pos;
return seekoff(off, std::ios::beg, which);
}
virtual int sync()
{

View File

@@ -43,7 +43,7 @@ class Foundation_API Message
/// caused the message.
{
public:
typedef std::map<std::string, std::string> StringMap;
using StringMap = std::map<std::string, std::string>;
enum Priority
{
@@ -65,7 +65,7 @@ public:
/// Creates a Message with the given source, text and priority.
/// The thread and process ids are set.
Message(const std::string& source, const std::string& text, Priority prio, const char* file, int line);
Message(const std::string& source, const std::string& text, Priority prio, const char* file, LineNumber line);
/// Creates a Message with the given source, text, priority,
/// source file path and line.
///
@@ -155,14 +155,14 @@ public:
/// Returns the source file path of the code creating
/// the message. May be 0 if not set.
void setSourceLine(int line);
void setSourceLine(LineNumber line);
/// Sets the source file line of the statement
/// generating the log message.
///
/// This is usually the result of the __LINE__
/// macro.
int getSourceLine() const;
LineNumber getSourceLine() const;
/// Returns the source file line of the statement
/// generating the log message. May be 0
/// if not set.
@@ -211,7 +211,7 @@ private:
std::string _thread;
long _pid;
const char* _file;
int _line;
LineNumber _line;
StringMap* _pMap;
};
@@ -271,7 +271,7 @@ inline const char* Message::getSourceFile() const
}
inline int Message::getSourceLine() const
inline LineNumber Message::getSourceLine() const
{
return _line;
}

View File

@@ -24,18 +24,17 @@
#include "Poco/Timestamp.h"
#include <atomic>
#if defined(POCO_OS_FAMILY_WINDOWS)
#if defined(_WIN32_WCE)
#include "Poco/Mutex_WINCE.h"
#ifdef POCO_ENABLE_STD_MUTEX
#include "Poco/Mutex_STD.h"
#else
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/Mutex_WIN32.h"
#endif
#elif defined(POCO_VXWORKS)
#include "Poco/Mutex_VX.h"
#else
#include "Poco/Mutex_POSIX.h"
#endif
#endif
namespace Poco {
@@ -53,6 +52,7 @@ class Foundation_API Mutex: private MutexImpl
{
public:
using ScopedLock = Poco::ScopedLock<Mutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<Mutex>;
Mutex();
/// creates the Mutex.
@@ -108,6 +108,7 @@ class Foundation_API FastMutex: private FastMutexImpl
{
public:
using ScopedLock = Poco::ScopedLock<FastMutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<FastMutex>;
FastMutex();
/// creates the Mutex.
@@ -158,13 +159,15 @@ class Foundation_API SpinlockMutex
///
/// While in some cases (eg. locking small blocks of code)
/// busy-waiting may be an optimal solution, in many scenarios
/// spinlock may not be the right choice - it is up to the user to
/// choose the proper mutex type for their particular case.
/// spinlock may not be the right choice (especially on single-core
/// systems) - it is up to the user to choose the proper mutex type
/// for their particular case.
///
/// Works with the ScopedLock class.
{
public:
using ScopedLock = Poco::ScopedLock<SpinlockMutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<SpinlockMutex>;
SpinlockMutex();
/// Creates the SpinlockMutex.
@@ -209,6 +212,7 @@ class Foundation_API NullMutex
{
public:
using ScopedLock = Poco::ScopedLock<NullMutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<NullMutex>;
NullMutex()
/// Creates the NullMutex.

View File

@@ -20,8 +20,8 @@
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/Error.h"
#include <pthread.h>
#include <errno.h>
namespace Poco {
@@ -56,8 +56,9 @@ protected:
//
inline void MutexImpl::lockImpl()
{
if (pthread_mutex_lock(&_mutex))
throw SystemException("cannot lock mutex");
int rc;
if ((rc = pthread_mutex_lock(&_mutex)))
throw SystemException("cannot lock mutex", Error::getMessage(rc));
}
@@ -69,14 +70,15 @@ inline bool MutexImpl::tryLockImpl()
else if (rc == EBUSY)
return false;
else
throw SystemException("cannot lock mutex");
throw SystemException("cannot lock mutex", Error::getMessage(rc));
}
inline void MutexImpl::unlockImpl()
{
if (pthread_mutex_unlock(&_mutex))
throw SystemException("cannot unlock mutex");
int rc;
if ((rc = pthread_mutex_unlock(&_mutex)))
throw SystemException("cannot unlock mutex", Error::getMessage(rc));
}

View File

@@ -0,0 +1,135 @@
//
// Mutex_STD.h
//
// Library: Foundation
// Package: Threading
// Module: Mutex
//
// Definition of the MutexImpl and FastMutexImpl classes based on Standard library mutex and recursive mutes.
//
// Copyright (c) 2004-2023, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_Mutex_STD_INCLUDED
#define Foundation_Mutex_STD_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include <mutex>
namespace Poco {
class Foundation_API MutexImpl
{
protected:
MutexImpl();
~MutexImpl();
void lockImpl();
bool tryLockImpl();
bool tryLockImpl(long milliseconds);
void unlockImpl();
private:
std::recursive_mutex _mutex;
};
class Foundation_API FastMutexImpl
{
protected:
FastMutexImpl();
~FastMutexImpl();
void lockImpl();
bool tryLockImpl();
bool tryLockImpl(long milliseconds);
void unlockImpl();
private:
std::mutex _mutex;
};
//
// inlines
//
inline void MutexImpl::lockImpl()
{
try
{
_mutex.lock();
}
catch (std::exception &ex) {
throw SystemException("cannot lock mutex", ex.what());
}
}
inline bool MutexImpl::tryLockImpl()
{
try
{
return _mutex.try_lock();
}
catch (std::exception &ex)
{
throw SystemException("cannot lock mutex", ex.what());
}
}
inline void MutexImpl::unlockImpl()
{
try
{
_mutex.unlock();
}
catch (std::exception &ex) {
throw SystemException("cannot unlock mutex");
}
}
inline void FastMutexImpl::lockImpl()
{
try
{
_mutex.lock();
}
catch (std::exception &ex) {
throw SystemException("cannot lock mutex", ex.what());
}
}
inline bool FastMutexImpl::tryLockImpl()
{
try
{
return _mutex.try_lock();
}
catch (std::exception &ex)
{
throw SystemException("cannot lock mutex", ex.what());
}
}
inline void FastMutexImpl::unlockImpl()
{
try
{
_mutex.unlock();
}
catch (std::exception &ex) {
throw SystemException("cannot unlock mutex");
}
}
} // namespace Poco
#endif //Foundation_Mutex_STD_INCLUDED

View File

@@ -20,6 +20,7 @@
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/Error.h"
#include "Poco/UnWindows.h"
@@ -55,7 +56,7 @@ inline void MutexImpl::lockImpl()
}
catch (...)
{
throw SystemException("cannot lock mutex");
throw SystemException("cannot lock mutex", Error::getLastMessage());
}
}
@@ -69,7 +70,7 @@ inline bool MutexImpl::tryLockImpl()
catch (...)
{
}
throw SystemException("cannot lock mutex");
throw SystemException("cannot lock mutex", Error::getLastMessage());
}

View File

@@ -1,50 +0,0 @@
//
// Mutex_WIN32.h
//
// Library: Foundation
// Package: Threading
// Module: Mutex
//
// Definition of the MutexImpl and FastMutexImpl classes for WIN32.
//
// Copyright (c) 2004-2010, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef Foundation_Mutex_WINCE_INCLUDED
#define Foundation_Mutex_WINCE_INCLUDED
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include "Poco/UnWindows.h"
namespace Poco {
class Foundation_API MutexImpl
{
protected:
MutexImpl();
~MutexImpl();
void lockImpl();
bool tryLockImpl();
bool tryLockImpl(long milliseconds);
void unlockImpl();
private:
HANDLE _mutex;
};
typedef MutexImpl FastMutexImpl;
} // namespace Poco
#endif // Foundation_Mutex_WINCE_INCLUDED

View File

@@ -3,7 +3,7 @@
//
// Library: Foundation
// Package: Notifications
// Module: NotificationCenter
// Module: NObserver
//
// Definition of the NObserver class template.
//
@@ -37,25 +37,39 @@ class NObserver: public AbstractObserver
/// to use this template class.
///
/// This class template is quite similar to the Observer class
/// template. The only difference is that the NObserver
/// expects the callback function to accept a const AutoPtr&
/// instead of a plain pointer as argument, thus simplifying memory
/// management.
/// template. The differences are:
///
/// - NObserver expects the callback function to accept a const AutoPtr&
/// instead of a plain pointer as argument, thus simplifying memory
/// management.
///
/// - In addition to dispatching notifications based on the Notification runtime
/// type, NObserver can also notify subscribers based on the Notification name.
/// To enable this functionality, a matcher function must be provided.
/// Null matcher means no matching is performed and all notificiations
/// of the type subscribed to are dispatched.
{
public:
typedef AutoPtr<N> NotificationPtr;
typedef void (C::*Callback)(const NotificationPtr&);
using Type = NObserver<C, N>;
using NotificationPtr = AutoPtr<N>;
using Callback = void (C::*)(const NotificationPtr&);
using Handler = Callback;
using Matcher = bool (C::*)(const std::string&) const;
NObserver(C& object, Callback method):
NObserver() = delete;
NObserver(C& object, Handler method, Matcher matcher = nullptr):
_pObject(&object),
_method(method)
_handler(method),
_matcher(matcher)
{
}
NObserver(const NObserver& observer):
AbstractObserver(observer),
_pObject(observer._pObject),
_method(observer._method)
_handler(observer._handler),
_matcher(observer._matcher)
{
}
@@ -68,54 +82,72 @@ public:
if (&observer != this)
{
_pObject = observer._pObject;
_method = observer._method;
_handler = observer._handler;
_matcher = observer._matcher;
}
return *this;
}
void notify(Notification* pNf) const
virtual void notify(Notification* pNf) const
{
Poco::Mutex::ScopedLock lock(_mutex);
if (_pObject)
{
N* pCastNf = dynamic_cast<N*>(pNf);
if (pCastNf)
{
NotificationPtr ptr(pCastNf, true);
(_pObject->*_method)(ptr);
}
}
handle(NotificationPtr(static_cast<N*>(pNf), true));
}
bool equals(const AbstractObserver& abstractObserver) const
virtual bool equals(const AbstractObserver& abstractObserver) const
{
const NObserver* pObs = dynamic_cast<const NObserver*>(&abstractObserver);
return pObs && pObs->_pObject == _pObject && pObs->_method == _method;
return pObs && pObs->_pObject == _pObject && pObs->_handler == _handler && pObs->_matcher == _matcher;
}
bool accepts(Notification* pNf, const char* pName = 0) const
POCO_DEPRECATED("use `bool accepts(const Notification::Ptr&)` instead")
virtual bool accepts(Notification* pNf, const char* pName) const
{
return dynamic_cast<N*>(pNf) && (!pName || pNf->name() == pName);
return (!pName || pNf->name() == pName) && dynamic_cast<N*>(pNf) != nullptr;
}
AbstractObserver* clone() const
virtual bool accepts(const Notification::Ptr& pNf) const
{
return (match(pNf) && (pNf.template cast<N>() != nullptr));
}
virtual AbstractObserver* clone() const
{
return new NObserver(*this);
}
void disable()
virtual void disable()
{
Poco::Mutex::ScopedLock lock(_mutex);
_pObject = 0;
_pObject = nullptr;
}
protected:
void handle(const NotificationPtr& ptr) const
{
Mutex::ScopedLock lock(_mutex);
if (_pObject)
(_pObject->*_handler)(ptr);
}
bool match(const Notification::Ptr& ptr) const
{
Mutex::ScopedLock l(_mutex);
return _pObject && (!_matcher || (_pObject->*_matcher)(ptr->name()));
}
Mutex& mutex() const
{
return _mutex;
}
private:
NObserver();
C* _pObject;
Callback _method;
Callback _handler;
Matcher _matcher;
mutable Poco::Mutex _mutex;
};

View File

@@ -17,12 +17,21 @@
#ifndef Foundation_NamedEvent_UNIX_INCLUDED
#define Foundation_NamedEvent_UNIX_INCLUDED
#include "Poco/Foundation.h"
#include <Poco/Platform.h>
#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) || defined(__GNU__)
#include <semaphore.h>
#define POCO_NAMED_EVENT_USE_POSIX_SEMAPHORES 1
#define POCO_NAMED_EVENT_USE_SYS_V_SEMAPHORES 0
#else
#define POCO_NAMED_EVENT_USE_POSIX_SEMAPHORES 0
#define POCO_NAMED_EVENT_USE_SYS_V_SEMAPHORES 1
#endif
#if POCO_NAMED_EVENT_USE_POSIX_SEMAPHORES
#include <semaphore.h>
#endif
namespace Poco {
@@ -39,10 +48,11 @@ private:
std::string getFileName();
std::string _name;
#if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) || defined(__GNU__)
sem_t* _sem;
#if POCO_NAMED_EVENT_USE_POSIX_SEMAPHORES
::sem_t* _sem;
#else
int _semid; // semaphore id
bool _createdId; // semaphore id was created with this instance
#endif
};

View File

@@ -54,6 +54,7 @@ class Foundation_API NamedMutex: private NamedMutexImpl
{
public:
using ScopedLock = Poco::ScopedLock<NamedMutex>;
using ScopedLockWithUnlock = Poco::ScopedLockWithUnlock<NamedMutex>;
NamedMutex(const std::string& name);
/// creates the Mutex.

Some files were not shown because too many files have changed in this diff Show More