mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Merge remote-tracking branch 'origin/feature-90-native-format-backend'
This commit is contained in:
commit
967c563d07
@ -10,3 +10,8 @@ add_executable(fs_du du.cpp)
|
||||
target_link_libraries(fs_du ghc_filesystem)
|
||||
AddExecutableWithStdFS(std_fs_du du.cpp)
|
||||
|
||||
if(EXISTS "${PROJECT_SOURCE_DIR}/examples/benchmark.cpp")
|
||||
add_executable(fs_benchmark benchmark.cpp)
|
||||
set_property(TARGET fs_benchmark PROPERTY CXX_STANDARD 17)
|
||||
target_link_libraries(fs_benchmark ghc_filesystem)
|
||||
endif()
|
File diff suppressed because it is too large
Load Diff
@ -43,7 +43,7 @@ using fstream = std::fstream;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef GHC_USE_STD_FS
|
||||
#define GHC_WIN_WSTRING_STRING_TYPE
|
||||
//#define GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE
|
||||
#include <ghc/filesystem.hpp>
|
||||
namespace fs {
|
||||
using namespace ghc::filesystem;
|
||||
|
@ -46,7 +46,7 @@ using fstream = std::fstream;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef GHC_USE_STD_FS
|
||||
#define GHC_WIN_WSTRING_STRING_TYPE
|
||||
//#define GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE
|
||||
#define GHC_FILESYSTEM_FWD
|
||||
#include <ghc/filesystem.hpp>
|
||||
namespace fs {
|
||||
|
@ -37,7 +37,7 @@
|
||||
#endif
|
||||
#endif
|
||||
#ifndef GHC_USE_STD_FS
|
||||
#define GHC_WIN_WSTRING_STRING_TYPE
|
||||
//#define GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE
|
||||
#define GHC_FILESYSTEM_IMPLEMENTATION
|
||||
#include <ghc/filesystem.hpp>
|
||||
#endif
|
||||
|
@ -31,18 +31,18 @@ else()
|
||||
ParseAndAddCatchTests(filesystem_test)
|
||||
AddExecutableWithStdFS(std_filesystem_test filesystem_test.cpp catch.hpp)
|
||||
if(WIN32)
|
||||
add_executable(filesystem_test_wchar filesystem_test.cpp catch.hpp)
|
||||
target_link_libraries(filesystem_test_wchar ghc_filesystem)
|
||||
target_compile_options(filesystem_test_wchar PRIVATE
|
||||
add_executable(filesystem_test_char filesystem_test.cpp catch.hpp)
|
||||
target_link_libraries(filesystem_test_char ghc_filesystem)
|
||||
target_compile_options(filesystem_test_char PRIVATE
|
||||
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Werror>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-Wall -Werror>
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/WX>)
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
target_compile_definitions(filesystem_test_wchar PRIVATE _CRT_SECURE_NO_WARNINGS GHC_WIN_WSTRING_STRING_TYPE)
|
||||
target_compile_definitions(filesystem_test_char PRIVATE _CRT_SECURE_NO_WARNINGS GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE)
|
||||
else()
|
||||
target_compile_definitions(filesystem_test_wchar PRIVATE GHC_WIN_WSTRING_STRING_TYPE)
|
||||
target_compile_definitions(filesystem_test_char PRIVATE GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE)
|
||||
endif()
|
||||
ParseAndAddCatchTests(filesystem_test_wchar)
|
||||
ParseAndAddCatchTests(filesystem_test_char)
|
||||
endif()
|
||||
if("cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
|
||||
AddTestExecutableWithStdCpp(17 filesystem_test.cpp catch.hpp)
|
||||
|
@ -2816,8 +2816,8 @@ TEST_CASE("Windows: path namespace handling", "[filesystem][path][fs.path.win.na
|
||||
{R"(\\?\C:\Windows\notepad.exe)", R"(\\?\C:\Windows\notepad.exe)", "\\\\?", "\\\\?\\", "//?,/,C:,Windows,notepad.exe"},
|
||||
{R"(\??\C:\Windows\notepad.exe)", R"(\??\C:\Windows\notepad.exe)", "\\??", "\\??\\", "/??,/,C:,Windows,notepad.exe"},
|
||||
#else
|
||||
{R"(\\?\C:\Windows\notepad.exe)", R"(C:\Windows\notepad.exe)", "C:", "C:\\", "C:,/,Windows,notepad.exe"},
|
||||
{R"(\??\C:\Windows\notepad.exe)", R"(C:\Windows\notepad.exe)", "C:", "C:\\", "C:,/,Windows,notepad.exe"},
|
||||
{R"(\\?\C:\Windows\notepad.exe)", R"(\\?\C:\Windows\notepad.exe)", "C:", "C:\\", "//?/,C:,/,Windows,notepad.exe"},
|
||||
{R"(\??\C:\Windows\notepad.exe)", R"(\??\C:\Windows\notepad.exe)", "C:", "C:\\", "/?\?/,C:,/,Windows,notepad.exe"},
|
||||
#endif
|
||||
{R"(\\.\C:\Windows\notepad.exe)", R"(\\.\C:\Windows\notepad.exe)", "\\\\.", "\\\\.\\", "//.,/,C:,Windows,notepad.exe"},
|
||||
{R"(\\?\HarddiskVolume1\Windows\notepad.exe)", R"(\\?\HarddiskVolume1\Windows\notepad.exe)", "\\\\?", "\\\\?\\", "//?,/,HarddiskVolume1,Windows,notepad.exe"},
|
||||
@ -2834,6 +2834,7 @@ TEST_CASE("Windows: path namespace handling", "[filesystem][path][fs.path.win.na
|
||||
INFO("Used path: " + ti._path);
|
||||
auto p = fs::path(ti._path);
|
||||
CHECK(p.string() == ti._string);
|
||||
CHECK(p.is_absolute());
|
||||
CHECK(p.root_name().string() == ti._rootName);
|
||||
CHECK(p.root_path().string() == ti._rootPath);
|
||||
CHECK(iterateResult(p) == ti._iterateResult);
|
||||
|
Loading…
x
Reference in New Issue
Block a user