Compare commits

...

2 Commits

Author SHA1 Message Date
1880c50fd8 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-23 10:27:53 -05:00
b8cb717772 refactor 2025-04-23 08:58:48 -05:00
8 changed files with 110 additions and 71 deletions

View File

@ -1,28 +1,27 @@
set(BINUTILS_VERSION 2.44) set(BINUTILS_VERSION 2.44)
set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0)
set(BOOST_MAJOR_VERSION 1) set(BOOST_MAJOR_VERSION 1)
set(BOOST_MINOR_VERSION 88) set(BOOST_MINOR_VERSION 88)
set(BOOST_PATCH_VERSION 0) set(BOOST_PATCH_VERSION 0)
set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0)
set(CPP_HTTPLIB_VERSION 0.20.0) set(CPP_HTTPLIB_VERSION 0.20.0)
set(CURL2_VERSION 8_13_0)
set(CURL_VERSION 8.13.0) set(CURL_VERSION 8.13.0)
set(EXPAT2_VERSION 2_7_1) set(CURL2_VERSION 8_13_0)
set(EXPAT_VERSION 2.7.1) set(EXPAT_VERSION 2.7.1)
set(EXPAT2_VERSION 2_7_1)
set(GCC_VERSION 14.2.0) set(GCC_VERSION 14.2.0)
set(GTEST_VERSION 1.16.0) set(GTEST_VERSION 1.16.0)
set(ICU_VERSION 76-1) set(ICU_VERSION 76-1)
set(JSON_VERSION 3.12.0) set(JSON_VERSION 3.12.0)
set(LIBSODIUM_VERSION 1.0.20) set(LIBSODIUM_VERSION 1.0.20)
set(MESA_VERSION 23.3.3)
set(MINGW_VERSION 12.0.0) set(MINGW_VERSION 12.0.0)
set(OPENSSL_VERSION 3.5.0) set(OPENSSL_VERSION 3.5.0)
set(PKG_CONFIG_VERSION 0.29.2) set(PKG_CONFIG_VERSION 0.29.2)
set(PUGIXML_VERSION 1.15) set(PUGIXML_VERSION 1.15)
set(ROCKSDB_VERSION 10.0.1) set(ROCKSDB_VERSION 10.0.1)
set(SPDLOG_VERSION 1.15.2) set(SPDLOG_VERSION 1.15.2)
set(SQLITE2_VERSION 3.49.1)
set(SQLITE_VERSION 3490100) set(SQLITE_VERSION 3490100)
set(SQLITE2_VERSION 3.49.1)
set(STDUUID_VERSION 1.2.3) set(STDUUID_VERSION 1.2.3)
set(ZLIB_VERSION 1.3.1) set(ZLIB_VERSION 1.3.1)

View File

@ -64,7 +64,7 @@ fuse_base::fuse_base(app_config &config) : config_(config) {
fuse_ops_.truncate = fuse_base::truncate_; fuse_ops_.truncate = fuse_base::truncate_;
#if !defined(__APPLE__) #if !defined(__APPLE__)
fuse_ops_.statfs = fuse_base::statfs_; fuse_ops_.statfs = fuse_base::statfs_;
#endif // __APPLE__ #endif // !defined(__APPLE__)
fuse_ops_.unlink = fuse_base::unlink_; fuse_ops_.unlink = fuse_base::unlink_;
fuse_ops_.utimens = fuse_base::utimens_; fuse_ops_.utimens = fuse_base::utimens_;
fuse_ops_.write = fuse_base::write_; fuse_ops_.write = fuse_base::write_;
@ -117,7 +117,7 @@ auto fuse_base::chflags_(const char *path, uint32_t flags) -> int {
return instance().chflags_impl(std::move(api_path), flags); return instance().chflags_impl(std::move(api_path), flags);
}); });
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::chmod_(const char *path, mode_t mode, struct fuse_file_info *fi) auto fuse_base::chmod_(const char *path, mode_t mode, struct fuse_file_info *fi)
@ -129,7 +129,7 @@ auto fuse_base::chmod_(const char *path, mode_t mode, struct fuse_file_info *fi)
return instance().chmod_impl(std::move(api_path), mode, fi); return instance().chmod_impl(std::move(api_path), mode, fi);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::chmod_(const char *path, mode_t mode) -> int { auto fuse_base::chmod_(const char *path, mode_t mode) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -138,7 +138,7 @@ auto fuse_base::chmod_(const char *path, mode_t mode) -> int {
return instance().chmod_impl(std::move(api_path), mode); return instance().chmod_impl(std::move(api_path), mode);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid, auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid,
@ -150,7 +150,7 @@ auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid,
return instance().chown_impl(std::move(api_path), uid, gid, fi); return instance().chown_impl(std::move(api_path), uid, gid, fi);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid) -> int { auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -159,7 +159,7 @@ auto fuse_base::chown_(const char *path, uid_t uid, gid_t gid) -> int {
return instance().chown_impl(std::move(api_path), uid, gid); return instance().chown_impl(std::move(api_path), uid, gid);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
auto fuse_base::create_(const char *path, mode_t mode, auto fuse_base::create_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int { struct fuse_file_info *fi) -> int {
@ -187,12 +187,12 @@ void fuse_base::display_options(
[[maybe_unused]] std::vector<const char *> args) { [[maybe_unused]] std::vector<const char *> args) {
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
fuse_cmdline_help(); fuse_cmdline_help();
#else #else // FUSE_USE_VERSION < 30
struct fuse_operations fuse_ops{}; struct fuse_operations fuse_ops{};
fuse_main(args.size(), fuse_main(args.size(),
reinterpret_cast<char **>(const_cast<char **>(args.data())), reinterpret_cast<char **>(const_cast<char **>(args.data())),
&fuse_ops, nullptr); &fuse_ops, nullptr);
#endif #endif // FUSE_USE_VERSION >= 30
std::cout << std::endl; std::cout << std::endl;
} }
@ -266,7 +266,7 @@ auto fuse_base::fgetattr_(const char *path, struct stat *st,
return instance().fgetattr_impl(std::move(api_path), st, fi); return instance().fgetattr_impl(std::move(api_path), st, fi);
}); });
} }
#endif #endif // FUSE_USE_VERSION < 30
#if defined(__APPLE__) #if defined(__APPLE__)
auto fuse_base::fsetattr_x_(const char *path, struct setattr_x *attr, auto fuse_base::fsetattr_x_(const char *path, struct setattr_x *attr,
@ -278,7 +278,7 @@ auto fuse_base::fsetattr_x_(const char *path, struct setattr_x *attr,
return instance().fsetattr_x_impl(std::move(api_path), attr, fi); return instance().fsetattr_x_impl(std::move(api_path), attr, fi);
}); });
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
auto fuse_base::fsync_(const char *path, int datasync, auto fuse_base::fsync_(const char *path, int datasync,
struct fuse_file_info *fi) -> int { struct fuse_file_info *fi) -> int {
@ -300,7 +300,7 @@ auto fuse_base::ftruncate_(const char *path, off_t size,
return instance().ftruncate_impl(std::move(api_path), size, fi); return instance().ftruncate_impl(std::move(api_path), size, fi);
}); });
} }
#endif #endif // FUSE_USE_VERSION < 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::getattr_(const char *path, struct stat *st, auto fuse_base::getattr_(const char *path, struct stat *st,
@ -312,7 +312,7 @@ auto fuse_base::getattr_(const char *path, struct stat *st,
return instance().getattr_impl(std::move(api_path), st, fi); return instance().getattr_impl(std::move(api_path), st, fi);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::getattr_(const char *path, struct stat *st) -> int { auto fuse_base::getattr_(const char *path, struct stat *st) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -321,7 +321,7 @@ auto fuse_base::getattr_(const char *path, struct stat *st) -> int {
return instance().getattr_impl(std::move(api_path), st); return instance().getattr_impl(std::move(api_path), st);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
#if defined(__APPLE__) #if defined(__APPLE__)
auto fuse_base::getxtimes_(const char *path, struct timespec *bkuptime, auto fuse_base::getxtimes_(const char *path, struct timespec *bkuptime,
@ -333,7 +333,7 @@ auto fuse_base::getxtimes_(const char *path, struct timespec *bkuptime,
return instance().getxtimes_impl(std::move(api_path), bkuptime, crtime); return instance().getxtimes_impl(std::move(api_path), bkuptime, crtime);
}); });
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::init_(struct fuse_conn_info *conn, struct fuse_config *cfg) auto fuse_base::init_(struct fuse_conn_info *conn, struct fuse_config *cfg)
@ -344,14 +344,14 @@ auto fuse_base::init_(struct fuse_conn_info *conn, struct fuse_config *cfg)
return instance().init_impl(conn, cfg); return instance().init_impl(conn, cfg);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::init_(struct fuse_conn_info *conn) -> void * { auto fuse_base::init_(struct fuse_conn_info *conn) -> void * {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
return execute_void_pointer_callback( return execute_void_pointer_callback(
function_name, [&]() -> void * { return instance().init_impl(conn); }); function_name, [&]() -> void * { return instance().init_impl(conn); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::init_impl([[maybe_unused]] struct fuse_conn_info *conn, auto fuse_base::init_impl([[maybe_unused]] struct fuse_conn_info *conn,
@ -413,9 +413,9 @@ auto fuse_base::mount(std::vector<std::string> args) -> int {
struct fuse_cmdline_opts opts{}; struct fuse_cmdline_opts opts{};
fuse_parse_cmdline(&fa, &opts); fuse_parse_cmdline(&fa, &opts);
mount_location = opts.mountpoint; mount_location = opts.mountpoint;
#else #else // FUSE_USE_VERSION < 30
fuse_parse_cmdline(&fa, &mount_location, nullptr, nullptr); fuse_parse_cmdline(&fa, &mount_location, nullptr, nullptr);
#endif #endif // FUSE_USE_VERSION >= 30
if (mount_location) { if (mount_location) {
mount_location_ = mount_location; mount_location_ = mount_location;
@ -427,7 +427,7 @@ auto fuse_base::mount(std::vector<std::string> args) -> int {
#if FUSE_USE_VERSION < 30 #if FUSE_USE_VERSION < 30
umask(0); umask(0);
#endif #endif // FUSE_USE_VERSION < 30
if (not console_enabled_) { if (not console_enabled_) {
repertory::project_cleanup(); repertory::project_cleanup();
@ -489,7 +489,7 @@ auto fuse_base::readdir_(const char *path, void *buf,
offset, fi, flags); offset, fi, flags);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::readdir_(const char *path, void *buf, auto fuse_base::readdir_(const char *path, void *buf,
fuse_fill_dir_t fuse_fill_dir, off_t offset, fuse_fill_dir_t fuse_fill_dir, off_t offset,
struct fuse_file_info *fi) -> int { struct fuse_file_info *fi) -> int {
@ -501,7 +501,7 @@ auto fuse_base::readdir_(const char *path, void *buf,
offset, fi); offset, fi);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
auto fuse_base::release_(const char *path, struct fuse_file_info *fi) -> int { auto fuse_base::release_(const char *path, struct fuse_file_info *fi) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -534,7 +534,7 @@ auto fuse_base::rename_(const char *from, const char *to, unsigned int flags)
std::move(to_api_path), flags); std::move(to_api_path), flags);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::rename_(const char *from, const char *to) -> int { auto fuse_base::rename_(const char *from, const char *to) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -545,7 +545,7 @@ auto fuse_base::rename_(const char *from, const char *to) -> int {
std::move(to_api_path)); std::move(to_api_path));
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
auto fuse_base::rmdir_(const char *path) -> int { auto fuse_base::rmdir_(const char *path) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -571,7 +571,7 @@ auto fuse_base::getxattr_(const char *path, const char *name, char *value,
return res == 0 ? attribute_size : res; return res == 0 ? attribute_size : res;
} }
#else // __APPLE__ #else // !defined(__APPLE__)
auto fuse_base::getxattr_(const char *path, const char *name, char *value, auto fuse_base::getxattr_(const char *path, const char *name, char *value,
size_t size) -> int { size_t size) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -585,7 +585,7 @@ auto fuse_base::getxattr_(const char *path, const char *name, char *value,
return res == 0 ? attribute_size : res; return res == 0 ? attribute_size : res;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
auto fuse_base::listxattr_(const char *path, char *buffer, size_t size) -> int { auto fuse_base::listxattr_(const char *path, char *buffer, size_t size) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -737,7 +737,7 @@ auto fuse_base::setxattr_(const char *path, const char *name, const char *value,
return res; return res;
} }
#else // __APPLE__ #else // !defined(__APPLE__)
auto fuse_base::setxattr_(const char *path, const char *name, const char *value, auto fuse_base::setxattr_(const char *path, const char *name, const char *value,
size_t size, int flags) -> int { size_t size, int flags) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -753,8 +753,8 @@ auto fuse_base::setxattr_(const char *path, const char *name, const char *value,
return res; return res;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#endif // HAS_SETXATTR #endif // defined(HAS_SETXATTR)
void fuse_base::shutdown() { void fuse_base::shutdown() {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -821,7 +821,7 @@ auto fuse_base::statfs_x_(const char *path, struct statfs *stbuf) -> int {
return instance().statfs_x_impl(std::move(api_path), stbuf); return instance().statfs_x_impl(std::move(api_path), stbuf);
}); });
} }
#else // __APPLE__ #else // !defined(__APPLE__)
auto fuse_base::statfs_(const char *path, struct statvfs *stbuf) -> int { auto fuse_base::statfs_(const char *path, struct statvfs *stbuf) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -830,7 +830,7 @@ auto fuse_base::statfs_(const char *path, struct statvfs *stbuf) -> int {
return instance().statfs_impl(std::move(api_path), stbuf); return instance().statfs_impl(std::move(api_path), stbuf);
}); });
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto fuse_base::truncate_(const char *path, off_t size, auto fuse_base::truncate_(const char *path, off_t size,
@ -842,7 +842,7 @@ auto fuse_base::truncate_(const char *path, off_t size,
return instance().truncate_impl(std::move(api_path), size, fi); return instance().truncate_impl(std::move(api_path), size, fi);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::truncate_(const char *path, off_t size) -> int { auto fuse_base::truncate_(const char *path, off_t size) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -851,7 +851,7 @@ auto fuse_base::truncate_(const char *path, off_t size) -> int {
return instance().truncate_impl(std::move(api_path), size); return instance().truncate_impl(std::move(api_path), size);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
auto fuse_base::unlink_(const char *path) -> int { auto fuse_base::unlink_(const char *path) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -865,13 +865,13 @@ auto fuse_base::unlink_(const char *path) -> int {
auto fuse_base::unmount(const std::string &mount_location) -> int { auto fuse_base::unmount(const std::string &mount_location) -> int {
#if defined(__APPLE__) #if defined(__APPLE__)
const auto cmd = "umount \"" + mount_location + "\" >/dev/null 2>&1"; const auto cmd = "umount \"" + mount_location + "\" >/dev/null 2>&1";
#else #else // !defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
const auto cmd = "fusermount3 -u \"" + mount_location + "\" >/dev/null 2>&1"; const auto cmd = "fusermount3 -u \"" + mount_location + "\" >/dev/null 2>&1";
#else #else // FUSE_USE_VERSION < 30
const auto cmd = "fusermount -u \"" + mount_location + "\" >/dev/null 2>&1"; const auto cmd = "fusermount -u \"" + mount_location + "\" >/dev/null 2>&1";
#endif #endif // FUSE_USE_VERSION >= 30
#endif #endif // defined(__APPLE__)
return system(cmd.c_str()); return system(cmd.c_str());
} }
@ -886,7 +886,7 @@ auto fuse_base::utimens_(const char *path, const struct timespec tv[2],
return instance().utimens_impl(std::move(api_path), tv, fi); return instance().utimens_impl(std::move(api_path), tv, fi);
}); });
} }
#else #else // FUSE_USE_VERSION < 30
auto fuse_base::utimens_(const char *path, const struct timespec tv[2]) -> int { auto fuse_base::utimens_(const char *path, const struct timespec tv[2]) -> int {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
@ -895,7 +895,7 @@ auto fuse_base::utimens_(const char *path, const struct timespec tv[2]) -> int {
return instance().utimens_impl(std::move(api_path), tv); return instance().utimens_impl(std::move(api_path), tv);
}); });
} }
#endif #endif // FUSE_USE_VERSION >= 30
auto fuse_base::write_(const char *path, const char *buffer, size_t write_size, auto fuse_base::write_(const char *path, const char *buffer, size_t write_size,
off_t write_offset, struct fuse_file_info *fi) -> int { off_t write_offset, struct fuse_file_info *fi) -> int {
@ -914,4 +914,4 @@ auto fuse_base::write_(const char *path, const char *buffer, size_t write_size,
} }
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)

View File

@ -1445,4 +1445,4 @@ void fuse_drive::update_accessed_time(const std::string &api_path) {
} }
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)

View File

@ -35,8 +35,8 @@ auto fuse_drive_base::access_impl(std::string api_path, int mask) -> api_error {
return check_access(api_path, mask); return check_access(api_path, mask);
} }
auto fuse_drive_base::check_access(const std::string &api_path, auto fuse_drive_base::check_access(const std::string &api_path, int mask) const
int mask) const -> api_error { -> api_error {
REPERTORY_USES_FUNCTION_NAME(); REPERTORY_USES_FUNCTION_NAME();
api_meta_map meta; api_meta_map meta;
@ -137,8 +137,9 @@ auto fuse_drive_base::check_and_perform(
return action(meta); return action(meta);
} }
auto fuse_drive_base::check_open_flags( auto fuse_drive_base::check_open_flags(int flags, int mask,
int flags, int mask, const api_error &fail_error) -> api_error { const api_error &fail_error)
-> api_error {
return (((flags & mask) == 0) ? api_error::success : fail_error); return (((flags & mask) == 0) ? api_error::success : fail_error);
} }
@ -195,8 +196,8 @@ auto fuse_drive_base::check_parent_access(const std::string &api_path,
return ret; return ret;
} }
auto fuse_drive_base::check_readable(int flags, auto fuse_drive_base::check_readable(int flags, const api_error &fail_error)
const api_error &fail_error) -> api_error { -> api_error {
auto mode = (flags & O_ACCMODE); auto mode = (flags & O_ACCMODE);
return ((mode == O_WRONLY) ? fail_error : api_error::success); return ((mode == O_WRONLY) ? fail_error : api_error::success);
} }
@ -254,13 +255,16 @@ auto fuse_drive_base::get_uid_from_meta(const api_meta_map &meta) -> uid_t {
} }
#if defined(__APPLE__) #if defined(__APPLE__)
auto fuse_drive_base::parse_xattr_parameters( auto fuse_drive_base::parse_xattr_parameters(const char *name,
const char *name, const uint32_t &position, std::string &attribute_name, const uint32_t &position,
const std::string &api_path) -> api_error { std::string &attribute_name,
const std::string &api_path)
-> api_error {
#else // !defined(__APPLE__) #else // !defined(__APPLE__)
auto fuse_drive_base::parse_xattr_parameters( auto fuse_drive_base::parse_xattr_parameters(const char *name,
const char *name, std::string &attribute_name, std::string &attribute_name,
const std::string &api_path) -> api_error { const std::string &api_path)
-> api_error {
#endif // defined(__APPLE__) #endif // defined(__APPLE__)
auto res = api_path.empty() ? api_error::bad_address : api_error::success; auto res = api_path.empty() ? api_error::bad_address : api_error::success;
if (res != api_error::success) { if (res != api_error::success) {
@ -293,9 +297,11 @@ auto fuse_drive_base::parse_xattr_parameters(
std::string &attribute_name, const std::string &api_path) -> api_error { std::string &attribute_name, const std::string &api_path) -> api_error {
auto res = parse_xattr_parameters(name, position, attribute_name, api_path); auto res = parse_xattr_parameters(name, position, attribute_name, api_path);
#else // !defined(__APPLE__) #else // !defined(__APPLE__)
auto fuse_drive_base::parse_xattr_parameters( auto fuse_drive_base::parse_xattr_parameters(const char *name,
const char *name, const char *value, size_t size, const char *value, size_t size,
std::string &attribute_name, const std::string &api_path) -> api_error { std::string &attribute_name,
const std::string &api_path)
-> api_error {
auto res = parse_xattr_parameters(name, attribute_name, api_path); auto res = parse_xattr_parameters(name, attribute_name, api_path);
#endif // defined(__APPLE__) #endif // defined(__APPLE__)
if (res != api_error::success) { if (res != api_error::success) {
@ -361,4 +367,4 @@ void fuse_drive_base::set_timespec_from_meta(const api_meta_map &meta,
} }
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)

View File

@ -604,4 +604,4 @@ auto remote_fuse_drive::write_impl(std::string api_path, const char *buffer,
} }
} // namespace repertory::remote_fuse } // namespace repertory::remote_fuse
#endif // _WIN32 #endif // !defined(_WIN32)

View File

@ -18,7 +18,6 @@ PROJECT_VERSIONS[GTEST]="1.16.0"
PROJECT_VERSIONS[ICU]="76-1" PROJECT_VERSIONS[ICU]="76-1"
PROJECT_VERSIONS[JSON]="3.12.0" PROJECT_VERSIONS[JSON]="3.12.0"
PROJECT_VERSIONS[LIBSODIUM]="1.0.20" PROJECT_VERSIONS[LIBSODIUM]="1.0.20"
PROJECT_VERSIONS[MESA]="23.3.3"
PROJECT_VERSIONS[MINGW]="12.0.0" PROJECT_VERSIONS[MINGW]="12.0.0"
PROJECT_VERSIONS[OPENSSL]="3.5.0" PROJECT_VERSIONS[OPENSSL]="3.5.0"
PROJECT_VERSIONS[PKG_CONFIG]="0.29.2" PROJECT_VERSIONS[PKG_CONFIG]="0.29.2"

View File

@ -29,8 +29,8 @@ constexpr const auto file_type_count{3U};
constexpr const auto file_type_count{2U}; constexpr const auto file_type_count{2U};
#endif #endif
[[nodiscard]] auto create_file(auto idx, auto path, [[nodiscard]] auto create_file(auto idx, auto path, bool read_only = false)
bool read_only = false) -> auto { -> auto {
switch (idx) { switch (idx) {
case 0U: case 0U:
return repertory::utils::file::file::open_or_create_file(path, read_only); return repertory::utils::file::file::open_or_create_file(path, read_only);
@ -47,8 +47,8 @@ constexpr const auto file_type_count{2U};
} }
} }
[[nodiscard]] auto open_file(auto idx, auto path, [[nodiscard]] auto open_file(auto idx, auto path, bool read_only = false)
bool read_only = false) -> auto { -> auto {
switch (idx) { switch (idx) {
case 0U: case 0U:
return repertory::utils::file::file::open_file(path, read_only); return repertory::utils::file::file::open_file(path, read_only);
@ -370,6 +370,41 @@ TEST(utils_file, directory_exists_in_path) {
} }
} }
TEST(utils_file, directory_can_get_empty_directory_count) {
auto &test_dir = test::generate_test_directory();
EXPECT_EQ(0U, test_dir.count());
EXPECT_EQ(0U, test_dir.count(false));
}
TEST(utils_file, directory_can_get_empty_directory_count_recursively) {
auto &test_dir = test::generate_test_directory();
EXPECT_EQ(0U, test_dir.count(true));
}
TEST(utils_file, directory_can_get_non_empty_directory_count) {
auto &test_dir = test::generate_test_directory();
auto sub_dir = test_dir.create_directory("sub_dir");
EXPECT_TRUE(sub_dir != nullptr);
if (sub_dir) {
sub_dir->create_directory("sub_dir");
EXPECT_EQ(1U, test_dir.count());
EXPECT_EQ(1U, test_dir.count(false));
}
}
TEST(utils_file, directory_can_get_non_empty_directory_count_recursively) {
auto &test_dir = test::generate_test_directory();
auto sub_dir = test_dir.create_directory("sub_dir");
EXPECT_TRUE(sub_dir != nullptr);
if (sub_dir) {
sub_dir = sub_dir->create_directory("sub_dir");
EXPECT_TRUE(sub_dir != nullptr);
}
EXPECT_EQ(2U, test_dir.count(true));
}
TEST(utils_file, file_exists_in_path) { TEST(utils_file, file_exists_in_path) {
auto &test_dir = test::generate_test_directory(); auto &test_dir = test::generate_test_directory();
EXPECT_FALSE( EXPECT_FALSE(

View File

@ -153,9 +153,9 @@ String getBaseUri() {
String? getSettingDescription(String settingPath) { String? getSettingDescription(String settingPath) {
switch (settingPath) { switch (settingPath) {
case 'ApiPassword': case 'ApiPassword':
return "HTTP basic authentication password"; return "HTTP authentication password";
case 'ApiUser': case 'ApiUser':
return "HTTP basic authentication user"; return "HTTP authentication user";
case 'HostConfig.ApiPassword': case 'HostConfig.ApiPassword':
return "RENTERD_API_PASSWORD"; return "RENTERD_API_PASSWORD";
default: default: