mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
minor refactorings and work on ci integration
This commit is contained in:
parent
e7169c4943
commit
f5bfb98aea
@ -16,6 +16,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND (CMAKE_CXX_COMPILER_VERSION
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(NOT APPLE)
|
if(NOT APPLE)
|
||||||
|
target_compile_options(${targetName} PRIVATE "-stdlib=libc++")
|
||||||
target_link_libraries(${targetName} -stdlib=libc++)
|
target_link_libraries(${targetName} -stdlib=libc++)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -177,7 +177,7 @@
|
|||||||
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
// ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch)
|
// ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch)
|
||||||
#define GHC_FILESYSTEM_VERSION 10210L
|
#define GHC_FILESYSTEM_VERSION 10211L
|
||||||
|
|
||||||
namespace ghc {
|
namespace ghc {
|
||||||
namespace filesystem {
|
namespace filesystem {
|
||||||
@ -677,7 +677,7 @@ private:
|
|||||||
file_status _symlink_status;
|
file_status _symlink_status;
|
||||||
uintmax_t _file_size = 0;
|
uintmax_t _file_size = 0;
|
||||||
#ifndef GHC_OS_WINDOWS
|
#ifndef GHC_OS_WINDOWS
|
||||||
uintmax_t _hard_link_count;
|
uintmax_t _hard_link_count = 0;
|
||||||
#endif
|
#endif
|
||||||
time_t _last_write_time = 0;
|
time_t _last_write_time = 0;
|
||||||
};
|
};
|
||||||
@ -2551,7 +2551,7 @@ GHC_INLINE path path::stem() const
|
|||||||
{
|
{
|
||||||
impl_string_type fn = filename().string();
|
impl_string_type fn = filename().string();
|
||||||
if (fn != "." && fn != "..") {
|
if (fn != "." && fn != "..") {
|
||||||
impl_string_type::size_type n = fn.rfind(".");
|
impl_string_type::size_type n = fn.rfind('.');
|
||||||
if (n != impl_string_type::npos && n != 0) {
|
if (n != impl_string_type::npos && n != 0) {
|
||||||
return fn.substr(0, n);
|
return fn.substr(0, n);
|
||||||
}
|
}
|
||||||
|
@ -1515,6 +1515,11 @@ TEST_CASE("30.10.15.1 absolute", "[filesystem][operations][fs.op.absolute]")
|
|||||||
TEST_CASE("30.10.15.2 canonical", "[filesystem][operations][fs.op.canonical]")
|
TEST_CASE("30.10.15.2 canonical", "[filesystem][operations][fs.op.canonical]")
|
||||||
{
|
{
|
||||||
CHECK_THROWS_AS(fs::canonical(""), fs::filesystem_error);
|
CHECK_THROWS_AS(fs::canonical(""), fs::filesystem_error);
|
||||||
|
{
|
||||||
|
std::error_code ec;
|
||||||
|
CHECK(fs::canonical("", ec) == "");
|
||||||
|
CHECK(ec);
|
||||||
|
}
|
||||||
CHECK(fs::canonical(fs::current_path()) == fs::current_path());
|
CHECK(fs::canonical(fs::current_path()) == fs::current_path());
|
||||||
|
|
||||||
CHECK(fs::canonical(".") == fs::current_path());
|
CHECK(fs::canonical(".") == fs::current_path());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user