From dcb4259b5758d9ad6ba71851aa24b460a9d38f0b Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 6 Apr 2024 10:00:54 -0400 Subject: [PATCH 1/3] Replace PCRE with Boost.Regex --- CMakeLists.txt | 4 +- autobuild.xml | 74 --------------------------- make/dom.mk | 10 +--- make/domTest.mk | 9 ++-- make/readme | 6 +-- projects/vc142-1.4/dom-static.vcxproj | 18 +++---- projects/vc142-1.4/dom.vcxproj | 26 +++++----- projects/vc142-1.4/domTest.vcxproj | 2 +- src/1.4/CMakeLists.txt | 1 - src/1.5/CMakeLists.txt | 1 - src/dae/daeURI.cpp | 39 +++++++++++++- 11 files changed, 69 insertions(+), 121 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b218ae..b1c1993 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ file(GLOB stddatabase_files ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/STLDatabase/ file(GLOB stderrplugin_files ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/stdErrPlugin/*.cpp) set(COLLADA_BASE_SOURCES ${dae_files} ${libxmlplugin_files} ${stddatabase_files} ${stderrplugin_files}) -set(COLLADA_LIBS minizip ${libpcrecpp_LIBRARIES} ${ZLIB_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) -set(COLLADA_COMPILE_FLAGS "${libpcrecpp_CFLAGS_OTHERS} ${EXTRA_COMPILE_FLAGS} ${Boost_CFLAGS} -DDOM_INCLUDE_LIBXML") +set(COLLADA_LIBS minizip ${ZLIB_LIBRARIES} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +set(COLLADA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} ${Boost_CFLAGS} -DDOM_INCLUDE_LIBXML") if( OPT_COLLADA15 ) add_subdirectory(src/1.5) diff --git a/autobuild.xml b/autobuild.xml index 4bbe6c3..c7b6d16 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -226,80 +226,6 @@ version 3.0.2.3e9876e - pcre - - copyright - Copyright (c) 1997-2014 University of Cambridge; Copyright(c) 2009-2014 Zoltan Herczeg; Copyright (c) 2007-2012, Google Inc. - description - PCRE Perl-compatible regular expression library - license - bsd - license_file - LICENSES/pcre-license.txt - name - pcre - platforms - - darwin64 - - archive - - hash - b372d37596474043a62568e569b0ce155192f484 - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-darwin64-979fd86.tar.zst - - name - darwin64 - - linux64 - - archive - - hash - 3a722c508a9278a49317e3f749f3256768f1c50b - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-pcre/releases/download/v8.35-3c0eb51/pcre-8.35.3c0eb51-linux64-3c0eb51.tar.zst - - name - linux64 - - windows - - archive - - hash - 5e93602abcd5130c21a6d554dc088390326e68e7 - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-windows-979fd86.tar.zst - - name - linux - - windows64 - - archive - - hash - 166564afb60a7536a038fae80e2fc9a41d6dbccb - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-pcre/releases/download/v8.35.979fd86/pcre-8.35.979fd86-windows64-979fd86.tar.zst - - name - windows64 - - - version - 8.35.3c0eb51 - zlib-ng canonical_repo diff --git a/make/dom.mk b/make/dom.mk index 16b06bb..1da0f2b 100644 --- a/make/dom.mk +++ b/make/dom.mk @@ -10,7 +10,6 @@ src += $(wildcard src/$(colladaVersion)/dom/*.cpp) includeOpts := -Istage/packages/include \ -Istage/packages/include/zlib-ng \ - -Istage/packages/include/pcre \ -Istage/packages/include/libxml2 \ -Istage/packages/include/minizip-ng \ -Iinclude \ @@ -46,14 +45,6 @@ includeOpts += -Iexternal-libs/tinyxml/ libOpts += external-libs/tinyxml/lib/$(buildID)/libtinyxml.a endif -# On Mac, Windows and PS3 we need to be told where to find pcre -ifeq ($(os),windows) -ccFlags += -DPCRE_STATIC -else -includeOpts += -Istage/packages/include/pcre -libOpts += $(addprefix stage/packages/lib/release/,libpcrecpp.a libpcre.a ) -endif - # For mingw: add boost ifneq ($(findstring $(os),linux mac),) includeOpts += -Istage/packages/include @@ -66,6 +57,7 @@ endif # errors about missing libboost_[file]system-mt.a. Hence $(archsupport). libOpts += stage/packages/lib/$(conf)/libboost_system-mt$(archsupport)$(debug_suffix).a libOpts += stage/packages/lib/$(conf)/libboost_filesystem-mt$(archsupport)$(debug_suffix).a +libOpts += stage/packages/lib/$(conf)/libboost_regex-mt$(archsupport)$(debug_suffix).a endif # minizip diff --git a/make/domTest.mk b/make/domTest.mk index e5405dd..39fea1e 100644 --- a/make/domTest.mk +++ b/make/domTest.mk @@ -33,7 +33,6 @@ endif includeOpts += -Istage/packages/include \ -Istage/packages/include/zlib-ng \ - -Istage/packages/include/pcre \ -Istage/packages/include/libxml2 \ -Istage/packages/include/minizip-ng libOpts += -Lstage/packages/lib/$(conf)/ @@ -47,11 +46,6 @@ includeOpts += -I$(installPrefix)/$(domFramework)/Headers endif dependentLibs += $(domName) -# PCRE defs -ifeq ($(os),ps3) -libOpts += $(addprefix external-libs/pcre/lib/$(os)/,libpcrecpp.a libpcre.a) -endif - # TinyXml defs ifneq ($(findstring tinyxml,$(xmlparsers)),) # Notify domTest.cpp if we're supposed to do TinyXml tests @@ -66,12 +60,15 @@ endif ccFlags += -DBOOST_FILESYSTEM_DEPRECATED ifeq ($(os),linux) libOpts += -lboost_filesystem-mt$(archsupport)$(debugSuffix) +libOpts += -lboost_regex-mt$(archsupport)$(debugSuffix) else ifeq ($(os),mac) libOpts += -lboost_filesystem-mt$(archsupport)$(debugSuffix) +libOpts += -lboost_regex-mt$(archsupport)$(debugSuffix) else includeOpts += -Iexternal-libs/boost libOpts += external-libs/boost/lib/$(buildID)/libboost_system$(archsupport).a libOpts += external-libs/boost/lib/$(buildID)/libboost_filesystem$(archsupport).a +libOpts += external-libs/boost/lib/$(buildID)/libboost_regex$(archsupport).a endif ifeq ($(os),ps3) # PS3 doesn't support C++ locales, so tell boost not to use them diff --git a/make/readme b/make/readme index 91c41c9..e2b1bbf 100644 --- a/make/readme +++ b/make/readme @@ -101,12 +101,12 @@ Linux Notes ----------- The Linux build has been tested with Ubuntu Gutsy. You need to have libxml, -PCRE, and boost filesystem development files installed on your machine to build -the DOM. The Ubuntu packages are named libxml2-dev, libpcre3-dev, and +boost regex, and boost filesystem development files installed on your machine to build +the DOM. The Ubuntu packages are named libxml2-dev, libboost-regex-dev, and libboost-filesystem-dev. It should be easy to get the DOM building on other versions of Linux, but you'll -need to figure out what packages to install for libxml, PCRE, and boost filesystem. +need to figure out what packages to install for libxml, boost regex, and boost filesystem. Windows Notes diff --git a/projects/vc142-1.4/dom-static.vcxproj b/projects/vc142-1.4/dom-static.vcxproj index 74dc3c1..e306f73 100644 --- a/projects/vc142-1.4/dom-static.vcxproj +++ b/projects/vc142-1.4/dom-static.vcxproj @@ -77,8 +77,8 @@ Disabled - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -96,8 +96,8 @@ Disabled - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) false EnableFastChecks MultiThreadedDebugDLL @@ -115,8 +115,8 @@ false - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -134,8 +134,8 @@ false - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDLL false @@ -577,4 +577,4 @@ - + \ No newline at end of file diff --git a/projects/vc142-1.4/dom.vcxproj b/projects/vc142-1.4/dom.vcxproj index cecdc55..1dd292f 100644 --- a/projects/vc142-1.4/dom.vcxproj +++ b/projects/vc142-1.4/dom.vcxproj @@ -80,13 +80,13 @@ - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) EnableFastChecks OldStyle false false Disabled - WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -95,7 +95,7 @@ false - libxml2_a.lib;wsock32.lib;pcred.lib;pcrecppd.lib;libminizip.lib;libboost_filesystem-mt-x32-gd.lib;libboost_system-mt-x32-gd.lib;zlib.lib;%(AdditionalDependencies) + libxml2_a.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x32-gd.lib;libboost_filesystem-mt-x32-gd.lib;libboost_system-mt-x32-gd.lib;zlib.lib;%(AdditionalDependencies) ..\..\stage\packages\lib\debug;..\..\external-libs\tinyxml\lib\vc10;%(AdditionalLibraryDirectories) @@ -113,13 +113,13 @@ - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) EnableFastChecks OldStyle false false Disabled - WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDebugDLL @@ -128,7 +128,7 @@ false - libxml2_a.lib;wsock32.lib;pcred.lib;pcrecppd.lib;libminizip.lib;libboost_filesystem-mt-x64-gd.lib;libboost_system-mt-x64-gd.lib;zlib.lib;%(AdditionalDependencies) + libxml2_a.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x64-gd.lib;libboost_filesystem-mt-x64-gd.lib;libboost_system-mt-x64-gd.lib;zlib.lib;%(AdditionalDependencies) ..\..\stage\packages\lib\debug;..\..\external-libs\tinyxml\lib\vc10;%(AdditionalLibraryDirectories) @@ -145,11 +145,11 @@ - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) false - WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDLL @@ -158,7 +158,7 @@ false - libxml2_a.lib;zlib.lib;wsock32.lib;pcre.lib;pcrecpp.lib;libminizip.lib;libboost_filesystem-mt-x32.lib;libboost_system-mt-x32.lib;%(AdditionalDependencies) + libxml2_a.lib;zlib.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x32.lib;libboost_filesystem-mt-x32.lib;libboost_system-mt-x32.lib;%(AdditionalDependencies) ..\..\stage\packages\lib\release;..\..\external-libs\tinyxml\lib\vc10;%(AdditionalLibraryDirectories) @@ -176,11 +176,11 @@ - ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\pcre;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) + ..\..\include;..\..\include\1.4;..\..\stage\packages\include;..\..\stage\packages\include\libxml2;..\..\stage\packages\include\minizip-ng;..\..\stage\packages\include\zlib-ng;..\..\external-libs\tinyxml;%(AdditionalIncludeDirectories) false - WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;PCRE_STATIC;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;DOM_EXPORT;DOM_INCLUDE_LIBXML;%(PreprocessorDefinitions) MultiThreadedDLL @@ -189,7 +189,7 @@ false - libxml2_a.lib;zlib.lib;wsock32.lib;pcre.lib;pcrecpp.lib;libminizip.lib;libboost_filesystem-mt-x64.lib;libboost_system-mt-x64.lib;%(AdditionalDependencies) + libxml2_a.lib;zlib.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x64.lib;libboost_filesystem-mt-x64.lib;libboost_system-mt-x64.lib;%(AdditionalDependencies) ..\..\stage\packages\lib\release;..\..\external-libs\tinyxml\lib\vc10;%(AdditionalLibraryDirectories) @@ -633,4 +633,4 @@ - + \ No newline at end of file diff --git a/projects/vc142-1.4/domTest.vcxproj b/projects/vc142-1.4/domTest.vcxproj index 1585278..40b2d8a 100644 --- a/projects/vc142-1.4/domTest.vcxproj +++ b/projects/vc142-1.4/domTest.vcxproj @@ -193,4 +193,4 @@ - + \ No newline at end of file diff --git a/src/1.4/CMakeLists.txt b/src/1.4/CMakeLists.txt index e49a51a..17fbaea 100644 --- a/src/1.4/CMakeLists.txt +++ b/src/1.4/CMakeLists.txt @@ -4,7 +4,6 @@ add_library(collada14dom SHARED ${COLLADA_BASE_SOURCES} ${dom_files}) target_link_libraries(collada14dom ${COLLADA_LIBS}) set_target_properties(collada14dom PROPERTIES COMPILE_FLAGS "${COLLADA_COMPILE_FLAGS}" - LINK_FLAGS "${libpcrecpp_LDFLAGS_OTHERS}" CLEAN_DIRECT_OUTPUT 1 SOVERSION ${COLLADA_DOM_SOVERSION} VERSION ${COLLADA_DOM_VERSION}) diff --git a/src/1.5/CMakeLists.txt b/src/1.5/CMakeLists.txt index fe2d729..e061a01 100644 --- a/src/1.5/CMakeLists.txt +++ b/src/1.5/CMakeLists.txt @@ -4,7 +4,6 @@ add_library(collada15dom SHARED ${COLLADA_BASE_SOURCES} ${dom_files}) target_link_libraries(collada15dom ${COLLADA_LIBS}) set_target_properties(collada15dom PROPERTIES COMPILE_FLAGS "${COLLADA_COMPILE_FLAGS}" - LINK_FLAGS "${libpcrecpp_LDFLAGS_OTHERS}" CLEAN_DIRECT_OUTPUT 1 SOVERSION ${COLLADA_DOM_SOVERSION} VERSION ${COLLADA_DOM_VERSION}) diff --git a/src/dae/daeURI.cpp b/src/dae/daeURI.cpp index 5f0e034..b318bdb 100644 --- a/src/dae/daeURI.cpp +++ b/src/dae/daeURI.cpp @@ -13,7 +13,8 @@ #include #include #include -#include + +#include using namespace std; using namespace cdom; @@ -140,12 +141,31 @@ namespace { //dir = baseName = extension = ""; //re.FullMatch(path, &dir, &baseName, &extension); +#if 0 // Original Impl static pcrecpp::RE findDir("(.*/)?(.*)?"); static pcrecpp::RE findExt("([^.]*)?(\\..*)?"); string tmpFile; dir = baseName = extension = tmpFile = ""; findDir.PartialMatch(path, &dir, &tmpFile); findExt.PartialMatch(tmpFile, &baseName, &extension); +#else + static boost::regex findDir("(.*/)?(.*)?", boost::regex::perl | boost::regex::icase); + static boost::regex findExt("([^.]*)?(\\..*)?", boost::regex::perl | boost::regex::icase); + boost::smatch matches; + string tmpFile; + dir = tmpFile = baseName = extension = ""; + if (boost::regex_search(path, matches, findDir)) + { + dir.assign(matches[1].first, matches[1].second); + tmpFile.assign(matches[2].first, matches[2].second); + } + + if (boost::regex_search(tmpFile, matches, findExt)) + { + baseName.assign(matches[1].first, matches[1].second); + extension.assign(matches[2].first, matches[2].second); + } +#endif } } @@ -702,13 +722,28 @@ bool cdom::parseUriRef(const string& uriRef, string& path, string& query, string& fragment) { +#if 0 // This regular expression for parsing URI references comes from the URI spec: // http://tools.ietf.org/html/rfc3986#appendix-B static pcrecpp::RE re("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"); string s1, s3, s6, s8; if (re.FullMatch(uriRef, &s1, &scheme, &s3, &authority, &path, &s6, &query, &s8, &fragment)) return true; - +#else + // This regular expression for parsing URI references comes from the URI spec: + // http://tools.ietf.org/html/rfc3986#appendix-B + static boost::regex re("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?", boost::regex::perl | boost::regex::icase); + boost::smatch matches; + if (boost::regex_match(uriRef, matches, re)) + { + scheme.assign(matches[2].first, matches[2].second); + authority.assign(matches[4].first, matches[4].second); + path.assign(matches[5].first, matches[5].second); + query.assign(matches[7].first, matches[7].second); + fragment.assign(matches[9].first, matches[9].second); + return true; + } +#endif return false; } From 917c32a2397c9358106f94052e855b4cd39b3dc9 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 6 Apr 2024 10:01:37 -0400 Subject: [PATCH 2/3] Enable /MP for msvc to speed up build --- projects/vc142-1.4/dom-static.vcxproj | 4 ++++ projects/vc142-1.4/dom.vcxproj | 4 ++++ projects/vc142-1.4/domTest.vcxproj | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/projects/vc142-1.4/dom-static.vcxproj b/projects/vc142-1.4/dom-static.vcxproj index e306f73..2c7809b 100644 --- a/projects/vc142-1.4/dom-static.vcxproj +++ b/projects/vc142-1.4/dom-static.vcxproj @@ -88,6 +88,7 @@ Level3 OldStyle false + true $(OutDir)libcollada14dom23-sd.lib @@ -107,6 +108,7 @@ Level3 OldStyle false + true $(OutDir)libcollada14dom23-sd.lib @@ -124,6 +126,7 @@ Level3 OldStyle false + true $(OutDir)libcollada14dom23-s.lib @@ -143,6 +146,7 @@ Level3 OldStyle false + true $(OutDir)libcollada14dom23-s.lib diff --git a/projects/vc142-1.4/dom.vcxproj b/projects/vc142-1.4/dom.vcxproj index 1dd292f..06275ea 100644 --- a/projects/vc142-1.4/dom.vcxproj +++ b/projects/vc142-1.4/dom.vcxproj @@ -93,6 +93,7 @@ Level3 $(IntDir) false + true libxml2_a.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x32-gd.lib;libboost_filesystem-mt-x32-gd.lib;libboost_system-mt-x32-gd.lib;zlib.lib;%(AdditionalDependencies) @@ -126,6 +127,7 @@ Level3 $(IntDir) false + true libxml2_a.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x64-gd.lib;libboost_filesystem-mt-x64-gd.lib;libboost_system-mt-x64-gd.lib;zlib.lib;%(AdditionalDependencies) @@ -156,6 +158,7 @@ Level3 true false + true libxml2_a.lib;zlib.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x32.lib;libboost_filesystem-mt-x32.lib;libboost_system-mt-x32.lib;%(AdditionalDependencies) @@ -187,6 +190,7 @@ Level3 true false + true libxml2_a.lib;zlib.lib;wsock32.lib;libminizip.lib;libboost_regex-mt-x64.lib;libboost_filesystem-mt-x64.lib;libboost_system-mt-x64.lib;%(AdditionalDependencies) diff --git a/projects/vc142-1.4/domTest.vcxproj b/projects/vc142-1.4/domTest.vcxproj index 40b2d8a..1e30e84 100644 --- a/projects/vc142-1.4/domTest.vcxproj +++ b/projects/vc142-1.4/domTest.vcxproj @@ -89,6 +89,7 @@ Level3 $(IntDir) false + true libcollada14dom23-sd.lib;libboost_filesystem-mt-x32-gd.lib;libboost_system-mt-x32-gd.lib;%(AdditionalDependencies) @@ -116,6 +117,7 @@ Level3 $(IntDir) false + true libcollada14dom23-sd.lib;libboost_filesystem-mt-x64-gd.lib;libboost_system-mt-x64-gd.lib;%(AdditionalDependencies) @@ -140,6 +142,7 @@ Level3 true false + true libcollada14dom23.lib;libboost_filesystem-mt-x32.lib;libboost_system-mt-x32.lib;%(AdditionalDependencies) @@ -168,6 +171,7 @@ Level3 true false + true libcollada14dom23.lib;libboost_filesystem-mt-x64.lib;libboost_system-mt-x64.lib;%(AdditionalDependencies) From d538675ea2a4e72d6303279d46974ab9e981fe5c Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Sat, 6 Apr 2024 10:07:25 -0400 Subject: [PATCH 3/3] Fix Boost.Filesystem deprecation --- make/domTest.mk | 2 -- projects/vc142-1.4/domTest.vcxproj | 4 ++-- src/dae/daeUtils.cpp | 2 +- src/dae/daeZAEUncompressHandler.cpp | 2 +- test/1.4/domTest.cpp | 10 +++++----- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/make/domTest.mk b/make/domTest.mk index 39fea1e..2148a07 100644 --- a/make/domTest.mk +++ b/make/domTest.mk @@ -56,8 +56,6 @@ endif endif # Boost defs -# Test programs use some deprecated interfaces... -ccFlags += -DBOOST_FILESYSTEM_DEPRECATED ifeq ($(os),linux) libOpts += -lboost_filesystem-mt$(archsupport)$(debugSuffix) libOpts += -lboost_regex-mt$(archsupport)$(debugSuffix) diff --git a/projects/vc142-1.4/domTest.vcxproj b/projects/vc142-1.4/domTest.vcxproj index 1e30e84..86161b3 100644 --- a/projects/vc142-1.4/domTest.vcxproj +++ b/projects/vc142-1.4/domTest.vcxproj @@ -135,7 +135,7 @@ false - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;BOOST_FILESYSTEM_DEPRECATED;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;%(PreprocessorDefinitions) MultiThreadedDLL @@ -164,7 +164,7 @@ false - WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;BOOST_FILESYSTEM_DEPRECATED;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;DOM_DYNAMIC;%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/src/dae/daeUtils.cpp b/src/dae/daeUtils.cpp index 47598a9..682692c 100644 --- a/src/dae/daeUtils.cpp +++ b/src/dae/daeUtils.cpp @@ -18,7 +18,7 @@ #endif #ifndef NO_BOOST -#include // THIS WAS NOT COMMENTED. +#include // THIS WAS NOT COMMENTED. #endif #include // for tmpnam diff --git a/src/dae/daeZAEUncompressHandler.cpp b/src/dae/daeZAEUncompressHandler.cpp index e8c1755..21fdc9b 100644 --- a/src/dae/daeZAEUncompressHandler.cpp +++ b/src/dae/daeZAEUncompressHandler.cpp @@ -268,7 +268,7 @@ bool daeZAEUncompressHandler::checkAndExtractInternalArchive( const std::string& bool error = false; boost::filesystem::path archivePath(filePath); - std::string dir = archivePath.branch_path().string(); + std::string dir = archivePath.parent_path().string(); const std::string& randomSegment = cdom::getRandomFileName(); std::string tmpDir = dir + cdom::getFileSeparator() + randomSegment + cdom::getFileSeparator(); diff --git a/test/1.4/domTest.cpp b/test/1.4/domTest.cpp index 02dc65d..954acce 100644 --- a/test/1.4/domTest.cpp +++ b/test/1.4/domTest.cpp @@ -281,7 +281,7 @@ DefineTest(writeCamera) { string getRoundTripFile(const string& name) { - return getTmpFile(fs::basename(fs::path(name)) + "_roundTrip.dae"); + return getTmpFile(fs::path(name).stem().string() + "_roundTrip.dae"); } bool roundTrip(const string& file) { @@ -717,7 +717,7 @@ DefineTest(genericOps) { any->setAttribute(name.str().c_str(), value.str().c_str()); } - CheckResult(dae.writeTo(file, getTmpFile(fs::basename(fs::path(file)) + "_genericOps.dae"))); + CheckResult(dae.writeTo(file, getTmpFile(fs::path(file).stem().string() + "_genericOps.dae"))); return testResult(true); } @@ -1466,7 +1466,7 @@ bool printTestResults(const map& failedTests) { iter++) { cout << " " << iter->first; if (!iter->second.file.empty()) { - cout << " (file " << fs::path(iter->second.file).leaf(); + cout << " (file " << fs::path(iter->second.file).filename(); if (iter->second.line != -1) cout << ", line " << iter->second.line << ")"; else @@ -1541,9 +1541,9 @@ int main(int argc, char* argv[]) { // Shut the DOM up daeErrorHandler::setErrorHandler(&quietErrorHandler::getInstance()); - dataPath() = (fs::path(argv[0]).branch_path()/"domTestData/").normalize(); + dataPath() = (fs::path(argv[0]).parent_path()/"domTestData/").lexically_normal(); if (!fs::exists(dataPath())) - dataPath() = (fs::path(argv[0]).branch_path()/"../../test/1.4/data/").normalize(); + dataPath() = (fs::path(argv[0]).parent_path()/"../../test/1.4/data/").lexically_normal(); tmpPath() = dataPath() / "tmp"; tmpDir tmp(tmpPath(), !leaveTmpFiles);