55 Commits

Author SHA1 Message Date
7a9ac2f063 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-05-20 08:49:22 -05:00
396863a551 clear buffer on retry
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-05-05 09:06:40 -05:00
626b9c0464 Merge branch 'v2.0.6-release-develop' of https://git.fifthgrid.com/blockstorage/repertory into v2.0.6-release-develop 2025-05-05 07:33:50 -05:00
5a823f975c attempt to prevent crash on curl error 6
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-05-03 08:13:24 -05:00
7cdc1c69e0 non-copyable/non-assignable/non-movable 2025-05-02 12:46:08 -05:00
7292fc11cf refactor static->inline
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-30 09:03:43 -05:00
34a49c1dfa refactor static->inline 2025-04-30 09:01:21 -05:00
176154e60d fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-29 15:19:03 -05:00
d86e40ab15 refactor 'constexpr const'->'constexpr' 2025-04-29 14:45:17 -05:00
a09fd441d3 added missing inline
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-29 13:43:23 -05:00
84e3cbe775 cleanup encrypt provider expired readers
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2025-04-29 13:37:34 -05:00
dd86ae3078 words
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-28 10:54:47 -05:00
be8bfeda71 Merge branch 'v2.0.6-release-develop' of https://git.fifthgrid.com/blockstorage/repertory into v2.0.6-release-develop
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-28 07:31:28 -05:00
7e3eb2bc16 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-25 23:28:26 -05:00
245b7a60d6 refactor 2025-04-25 10:04:41 -05:00
45a46650a2 [ui] Implement provider test button #49
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-24 10:48:13 -05:00
3c8e1d5986 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-24 08:58:02 -05:00
3c2d363a5e cleanup 2025-04-24 08:55:02 -05:00
22e5df62b9 cleanup
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-24 08:49:29 -05:00
853bc76b58 fix
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-24 08:48:29 -05:00
b100ff75cc [ui] Implement provider test button #49
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-24 07:12:36 -05:00
1fba3e129f [ui] Implement provider test button #49
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-24 07:09:27 -05:00
315d1f1d72 [ui] Implement provider test button #49
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-24 07:07:21 -05:00
bf11906434 [ui] Implement provider test button #49
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2025-04-24 07:00:48 -05:00
6fe6ccbbfe [ui] Implement provider test button #49 2025-04-24 06:56:55 -05:00
1a02d89ab9 [ui] Implement provider test button #49 2025-04-24 06:54:53 -05:00
eaa95cf9d1 [ui] Implement provider test button #49
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-23 17:42:07 -05:00
3e8284b851 refactor 2025-04-23 16:56:27 -05:00
f490842710 refactor 2025-04-23 16:55:24 -05:00
22eb7a44b4 [ui] Implement provider test button #49
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2025-04-23 16:46:20 -05:00
de5eb1005c [ui] Implement provider test button #49
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-23 15:31:37 -05:00
fcaade316f [ui] Implement provider test button #49 2025-04-23 15:12:03 -05:00
4d60b39ea1 cleanup 2025-04-23 15:10:40 -05:00
539abc1d5b [ui] Implement provider test button #49 2025-04-23 15:08:21 -05:00
3502bf2189 [ui] Implement provider test button #49 2025-04-23 14:14:59 -05:00
5f50e0204a [ui] Implement provider test button #49 2025-04-23 10:53:22 -05:00
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
0a747e7a62 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-22 13:50:54 -05:00
7784284097 refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-22 11:48:46 -05:00
09208e53a2 refactor 2025-04-22 11:40:54 -05:00
61d8b6d054 refactor 2025-04-22 11:35:22 -05:00
9398f17b76 refactor 2025-04-22 11:34:58 -05:00
f4251fcc97 refactor 2025-04-22 10:38:27 -05:00
add21a5608 refactor 2025-04-22 10:31:03 -05:00
bcccc5c4b8 refactor 2025-04-22 10:26:30 -05:00
ef8b16077b refactor 2025-04-22 10:20:10 -05:00
25007b4242 refactor 2025-04-22 10:01:26 -05:00
e1690509e1 refactor 2025-04-22 09:59:57 -05:00
92d6633f44 refactor 2025-04-22 08:17:16 -05:00
528fd595ab refactor 2025-04-22 07:40:28 -05:00
4e418c8969 updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 13:41:53 -05:00
d664c6a884 fix winfsp rename
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2025-04-17 13:20:00 -05:00
430fc1a651 fix test 2025-04-17 11:26:12 -05:00
314ee5b664 enable all winfsp tests 2025-04-17 11:07:02 -05:00
166 changed files with 3407 additions and 2681 deletions

View File

@ -17,6 +17,7 @@ bugprone
cflags cflags
chrono chrono
cmake_current_source_dir cmake_current_source_dir
coinit_apartmentthreaded
comdlg32 comdlg32
cppcoreguidelines cppcoreguidelines
cppdbg cppdbg

View File

@ -15,10 +15,12 @@
* \#46 [bug] Changes to maximum cache size should be updated live * \#46 [bug] Changes to maximum cache size should be updated live
* \#47 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty * \#47 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty
* \#48 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations * \#48 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations
* \#49 [ui] Implement provider test button
### Changes from v2.0.5-rc ### Changes from v2.0.5-rc
* Drive letters in UI should always be lowercase * Drive letters in UI should always be lowercase
* Fixed WinFSP directory rename for non-empty directories
* Migrated to v2 error handling * Migrated to v2 error handling
## v2.0.5-rc ## v2.0.5-rc

View File

@ -1,10 +1,10 @@
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237) set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4) set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866) set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866)
set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699) set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699)
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb) set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293) set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399) set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2) set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187) set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)

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(GCC_VERSION 14.2.0) set(EXPAT2_VERSION 2_7_1)
set(GCC_VERSION 15.1.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

@ -53,9 +53,6 @@ private:
std::optional<host_config> host_config_; std::optional<host_config> host_config_;
std::optional<s3_config> s3_config_; std::optional<s3_config> s3_config_;
private:
bool use_s3_path_style_{false};
public: public:
[[nodiscard]] static auto create_curl() -> CURL *; [[nodiscard]] static auto create_curl() -> CURL *;
@ -67,8 +64,7 @@ public:
const host_config &cfg) const host_config &cfg)
-> std::string; -> std::string;
[[nodiscard]] static auto create_host_config(const s3_config &cfg, [[nodiscard]] static auto create_host_config(const s3_config &cfg)
bool use_s3_path_style)
-> host_config; -> host_config;
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data, [[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
@ -237,8 +233,6 @@ public:
} }
public: public:
void enable_s3_path_style(bool enable) override;
[[nodiscard]] auto make_request(const curl::requests::http_delete &del, [[nodiscard]] auto make_request(const curl::requests::http_delete &del,
long &response_code, long &response_code,
stop_type &stop_requested) const stop_type &stop_requested) const

View File

@ -34,28 +34,29 @@ struct i_http_comm {
INTERFACE_SETUP(i_http_comm); INTERFACE_SETUP(i_http_comm);
public: public:
virtual void enable_s3_path_style(bool enable) = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
make_request(const curl::requests::http_delete &del, long &response_code, make_request(const curl::requests::http_delete &del, long &response_code,
stop_type &stop_requested) const -> bool = 0; stop_type &stop_requested) const -> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto make_request(const curl::requests::http_get &get,
make_request(const curl::requests::http_get &get, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool = 0; stop_type &stop_requested) const
-> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto make_request(const curl::requests::http_head &head,
make_request(const curl::requests::http_head &head, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool = 0; stop_type &stop_requested) const
-> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto make_request(const curl::requests::http_post &post,
make_request(const curl::requests::http_post &post, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool = 0; stop_type &stop_requested) const
-> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
make_request(const curl::requests::http_put_file &put_file, make_request(const curl::requests::http_put_file &put_file,
long &response_code, long &response_code, stop_type &stop_requested) const
stop_type &stop_requested) const -> bool = 0; -> bool = 0;
}; };
} // namespace repertory } // namespace repertory

View File

@ -94,7 +94,7 @@ private:
bool shutdown_ = false; bool shutdown_ = false;
private: private:
static constexpr const auto min_pool_size = 10U; static constexpr auto min_pool_size = 10U;
public: public:
void execute(const std::string &client_id, std::uint64_t thread_id, void execute(const std::string &client_id, std::uint64_t thread_id,

View File

@ -54,13 +54,13 @@ REPERTORY_IGNORE_WARNINGS_DISABLE()
using namespace std::chrono_literals; using namespace std::chrono_literals;
using json = nlohmann::json; using json = nlohmann::json;
inline constexpr const std::string_view REPERTORY{"repertory"}; inline constexpr std::string_view REPERTORY{"repertory"};
inline constexpr const std::string_view REPERTORY_DATA_NAME{"repertory2"}; inline constexpr std::string_view REPERTORY_DATA_NAME{"repertory2"};
inline constexpr const std::wstring_view REPERTORY_W{L"repertory"}; inline constexpr std::wstring_view REPERTORY_W{L"repertory"};
inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION{2ULL}; inline constexpr std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"}; inline constexpr std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"};
inline constexpr const std::string_view RENTERD_MIN_VERSION{"2.0.0"}; inline constexpr std::string_view RENTERD_MIN_VERSION{"2.0.0"};
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE #define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE

View File

@ -50,14 +50,14 @@ public:
[[nodiscard]] auto fill_buffer(const remote::file_offset &offset, [[nodiscard]] auto fill_buffer(const remote::file_offset &offset,
fuse_fill_dir_t filler_function, void *buffer, fuse_fill_dir_t filler_function, void *buffer,
populate_stat_callback populate_stat) -> int; populate_stat_callback populate_stat) -> int;
#endif #endif // !defined(_WIN32)
[[nodiscard]] auto get(std::size_t offset, std::string &item) -> int; [[nodiscard]] auto get(std::size_t offset, std::string &item) -> int;
[[nodiscard]] auto get_count() const -> std::size_t { return items_.size(); } [[nodiscard]] auto get_count() const -> std::size_t { return items_.size(); }
[[nodiscard]] auto get_directory_item(std::size_t offset, [[nodiscard]] auto get_directory_item(std::size_t offset, directory_item &di)
directory_item &di) -> api_error; -> api_error;
[[nodiscard]] auto get_directory_item(const std::string &api_path, [[nodiscard]] auto get_directory_item(const std::string &api_path,
directory_item &di) -> api_error; directory_item &di) -> api_error;
@ -71,8 +71,8 @@ public:
auto operator=(const directory_iterator &iterator) noexcept auto operator=(const directory_iterator &iterator) noexcept
-> directory_iterator &; -> directory_iterator &;
auto auto operator=(directory_iterator &&iterator) noexcept
operator=(directory_iterator &&iterator) noexcept -> directory_iterator &; -> directory_iterator &;
auto operator=(directory_item_list list) noexcept -> directory_iterator &; auto operator=(directory_item_list list) noexcept -> directory_iterator &;
}; };

View File

@ -61,7 +61,7 @@ private:
static auto instance() -> fuse_base &; static auto instance() -> fuse_base &;
private: private:
struct fuse_operations fuse_ops_ {}; struct fuse_operations fuse_ops_{};
private: private:
[[nodiscard]] auto [[nodiscard]] auto
@ -78,9 +78,9 @@ private:
static void execute_void_callback(std::string_view function_name, static void execute_void_callback(std::string_view function_name,
const std::function<void()> &cb); const std::function<void()> &cb);
static auto static auto execute_void_pointer_callback(std::string_view function_name,
execute_void_pointer_callback(std::string_view function_name, const std::function<void *()> &cb)
const std::function<void *()> &cb) -> void *; -> void *;
void raise_fuse_event(std::string_view function_name, void raise_fuse_event(std::string_view function_name,
std::string_view api_path, int ret, std::string_view api_path, int ret,
@ -91,22 +91,22 @@ private:
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto chflags_(const char *path, uint32_t flags) -> int; [[nodiscard]] static auto chflags_(const char *path, uint32_t flags) -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto chmod_(const char *path, mode_t mode, [[nodiscard]] static auto chmod_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto chmod_(const char *path, mode_t mode) -> int; [[nodiscard]] static auto chmod_(const char *path, mode_t mode) -> int;
#endif #endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid, [[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto chown_(const char *path, uid_t uid, [[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid)
gid_t gid) -> int; -> int;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto create_(const char *path, mode_t mode, [[nodiscard]] static auto create_(const char *path, mode_t mode,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
@ -114,19 +114,19 @@ private:
static void destroy_(void *ptr); static void destroy_(void *ptr);
[[nodiscard]] static auto fallocate_(const char *path, int mode, off_t offset, [[nodiscard]] static auto fallocate_(const char *path, int mode, off_t offset,
off_t length, off_t length, struct fuse_file_info *fi)
struct fuse_file_info *fi) -> int; -> int;
#if FUSE_USE_VERSION < 30 #if FUSE_USE_VERSION < 30
[[nodiscard]] static auto fgetattr_(const char *path, struct stat *st, [[nodiscard]] static auto fgetattr_(const char *path, struct stat *st,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#endif #endif // FUSE_USE_VERSION < 30
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto fsetattr_x_(const char *path, [[nodiscard]] static auto fsetattr_x_(const char *path,
struct setattr_x *attr, struct setattr_x *attr,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] static auto fsync_(const char *path, int datasync, [[nodiscard]] static auto fsync_(const char *path, int datasync,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
@ -137,27 +137,27 @@ private:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto getattr_(const char *path, struct stat *st, [[nodiscard]] static auto getattr_(const char *path, struct stat *st,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto getattr_(const char *path, struct stat *st) -> int; [[nodiscard]] static auto getattr_(const char *path, struct stat *st) -> int;
#endif #endif // FUSE_USE_VERSION >= 30
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto getxtimes_(const char *path, [[nodiscard]] static auto getxtimes_(const char *path,
struct timespec *bkuptime, struct timespec *bkuptime,
struct timespec *crtime) -> int; struct timespec *crtime) -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto init_(struct fuse_conn_info *conn, [[nodiscard]] static auto init_(struct fuse_conn_info *conn,
struct fuse_config *cfg) -> void *; struct fuse_config *cfg) -> void *;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto init_(struct fuse_conn_info *conn) -> void *; [[nodiscard]] static auto init_(struct fuse_conn_info *conn) -> void *;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto mkdir_(const char *path, mode_t mode) -> int; [[nodiscard]] static auto mkdir_(const char *path, mode_t mode) -> int;
[[nodiscard]] static auto open_(const char *path, [[nodiscard]] static auto open_(const char *path, struct fuse_file_info *fi)
struct fuse_file_info *fi) -> int; -> int;
[[nodiscard]] static auto opendir_(const char *path, [[nodiscard]] static auto opendir_(const char *path,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
@ -171,12 +171,12 @@ private:
fuse_fill_dir_t fuse_fill_dir, fuse_fill_dir_t fuse_fill_dir,
off_t offset, struct fuse_file_info *fi, off_t offset, struct fuse_file_info *fi,
fuse_readdir_flags flags) -> int; fuse_readdir_flags flags) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto readdir_(const char *path, void *buf, [[nodiscard]] static auto readdir_(const char *path, void *buf,
fuse_fill_dir_t fuse_fill_dir, fuse_fill_dir_t fuse_fill_dir,
off_t offset, off_t offset, struct fuse_file_info *fi)
struct fuse_file_info *fi) -> int; -> int;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto release_(const char *path, [[nodiscard]] static auto release_(const char *path,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
@ -187,9 +187,9 @@ private:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto rename_(const char *from, const char *to, [[nodiscard]] static auto rename_(const char *from, const char *to,
unsigned int flags) -> int; unsigned int flags) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto rename_(const char *from, const char *to) -> int; [[nodiscard]] static auto rename_(const char *from, const char *to) -> int;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto rmdir_(const char *path) -> int; [[nodiscard]] static auto rmdir_(const char *path) -> int;
@ -199,35 +199,36 @@ private:
char *value, size_t size, char *value, size_t size,
uint32_t position) -> int; uint32_t position) -> int;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] static auto getxattr_(const char *path, const char *name, [[nodiscard]] static auto getxattr_(const char *path, const char *name,
char *value, size_t size) -> int; char *value, size_t size) -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] static auto listxattr_(const char *path, char *buffer, [[nodiscard]] static auto listxattr_(const char *path, char *buffer,
size_t size) -> int; size_t size) -> int;
[[nodiscard]] static auto removexattr_(const char *path, [[nodiscard]] static auto removexattr_(const char *path, const char *name)
const char *name) -> int; -> int;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto setxattr_(const char *path, const char *name, [[nodiscard]] static auto setxattr_(const char *path, const char *name,
const char *value, size_t size, int flags, const char *value, size_t size, int flags,
uint32_t position) -> int; uint32_t position) -> int;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] static auto setxattr_(const char *path, const char *name, [[nodiscard]] static auto setxattr_(const char *path, const char *name,
const char *value, size_t size, const char *value, size_t size, int flags)
int flags) -> int; -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
#endif // HAS_SETXATTR #endif // defined(HAS_SETXATTR)
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto setattr_x_(const char *path, [[nodiscard]] static auto setattr_x_(const char *path, struct setattr_x *attr)
struct setattr_x *attr) -> int; -> int;
[[nodiscard]] static auto [[nodiscard]] static auto setbkuptime_(const char *path,
setbkuptime_(const char *path, const struct timespec *bkuptime) -> int; const struct timespec *bkuptime)
-> int;
[[nodiscard]] static auto setchgtime_(const char *path, [[nodiscard]] static auto setchgtime_(const char *path,
const struct timespec *chgtime) -> int; const struct timespec *chgtime) -> int;
@ -237,20 +238,20 @@ private:
[[nodiscard]] static auto setvolname_(const char *volname) -> int; [[nodiscard]] static auto setvolname_(const char *volname) -> int;
[[nodiscard]] static auto statfs_x_(const char *path, [[nodiscard]] static auto statfs_x_(const char *path, struct statfs *stbuf)
struct statfs *stbuf) -> int; -> int;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] static auto statfs_(const char *path, [[nodiscard]] static auto statfs_(const char *path, struct statvfs *stbuf)
struct statvfs *stbuf) -> int; -> int;
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] static auto truncate_(const char *path, off_t size, [[nodiscard]] static auto truncate_(const char *path, off_t size,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto truncate_(const char *path, off_t size) -> int; [[nodiscard]] static auto truncate_(const char *path, off_t size) -> int;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto unlink_(const char *path) -> int; [[nodiscard]] static auto unlink_(const char *path) -> int;
@ -258,18 +259,18 @@ private:
[[nodiscard]] static auto utimens_(const char *path, [[nodiscard]] static auto utimens_(const char *path,
const struct timespec tv[2], const struct timespec tv[2],
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] static auto utimens_(const char *path, [[nodiscard]] static auto utimens_(const char *path,
const struct timespec tv[2]) -> int; const struct timespec tv[2]) -> int;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] static auto write_(const char *path, const char *buffer, [[nodiscard]] static auto write_(const char *path, const char *buffer,
size_t write_size, off_t write_offset, size_t write_size, off_t write_offset,
struct fuse_file_info *fi) -> int; struct fuse_file_info *fi) -> int;
protected: protected:
[[nodiscard]] virtual auto access_impl(std::string /*api_path*/, [[nodiscard]] virtual auto access_impl(std::string /*api_path*/, int /*mask*/)
int /*mask*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -278,37 +279,40 @@ protected:
uint32_t /*flags*/) -> api_error { uint32_t /*flags*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
chmod_impl(std::string /*api_path*/, mode_t /*mode*/, mode_t /*mode*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else //FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/, [[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
mode_t /*mode*/) -> api_error { mode_t /*mode*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
chown_impl(std::string /*api_path*/, uid_t /*uid*/, gid_t /*gid*/, gid_t /*gid*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/, [[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
gid_t /*gid*/) -> api_error { gid_t /*gid*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto create_impl(std::string /*api_path*/,
create_impl(std::string /*api_path*/, mode_t /*mode*/, mode_t /*mode*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -316,81 +320,87 @@ protected:
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/, fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/,
off_t /*length*/, off_t /*length*/, struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*fi*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto fgetattr_impl(std::string /*api_path*/,
fgetattr_impl(std::string /*api_path*/, struct stat * /*st*/, struct stat * /*st*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto fsetattr_x_impl(std::string /*api_path*/,
fsetattr_x_impl(std::string /*api_path*/, struct setattr_x * /*attr*/, struct setattr_x * /*attr*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto fsync_impl(std::string /*api_path*/,
fsync_impl(std::string /*api_path*/, int /*datasync*/, int /*datasync*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#if FUSE_USE_VERSION < 30 #if FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto ftruncate_impl(std::string /*api_path*/,
ftruncate_impl(std::string /*api_path*/, off_t /*size*/, off_t /*size*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION < 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
getattr_impl(std::string /*api_path*/, struct stat * /*st*/, struct stat * /*st*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/, [[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
struct stat * /*st*/) -> api_error { struct stat * /*st*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto getxtimes_impl(std::string /*api_path*/,
getxtimes_impl(std::string /*api_path*/, struct timespec * /*bkuptime*/, struct timespec * /*bkuptime*/,
struct timespec * /*crtime*/) -> api_error { struct timespec * /*crtime*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
virtual auto init_impl(struct fuse_conn_info *conn, virtual auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
struct fuse_config *cfg) -> void *; -> void *;
#else #else // FUSE_USE_VERSION < 30
virtual auto init_impl(struct fuse_conn_info *conn) -> void *; virtual auto init_impl(struct fuse_conn_info *conn) -> void *;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto mkdir_impl(std::string /*api_path*/, [[nodiscard]] virtual auto mkdir_impl(std::string /*api_path*/,
mode_t /*mode*/) -> api_error { mode_t /*mode*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto open_impl(std::string /*api_path*/,
open_impl(std::string /*api_path*/, struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*fi*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto opendir_impl(std::string /*api_path*/,
opendir_impl(std::string /*api_path*/, struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*fi*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -405,28 +415,28 @@ protected:
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
readdir_impl(std::string /*api_path*/, void * /*buf*/, readdir_impl(std::string /*api_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*/, struct fuse_file_info * /*fi*/, fuse_readdir_flags /*flags*/)
fuse_readdir_flags /*flags*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
readdir_impl(std::string /*api_path*/, void * /*buf*/, readdir_impl(std::string /*api_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*/) -> api_error { struct fuse_file_info * /*fi*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto release_impl(std::string /*api_path*/,
release_impl(std::string /*api_path*/, struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*fi*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto releasedir_impl(std::string /*api_path*/,
releasedir_impl(std::string /*api_path*/, struct fuse_file_info * /*fi*/)
struct fuse_file_info * /*fi*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -436,13 +446,13 @@ protected:
unsigned int /*flags*/) -> api_error { unsigned int /*flags*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto rename_impl(std::string /*from_api_path*/,
rename_impl(std::string /*from_api_path*/, std::string /*to_api_path*/)
std::string /*to_api_path*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto rmdir_impl(std::string /*api_path*/) -> api_error { [[nodiscard]] virtual auto rmdir_impl(std::string /*api_path*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
@ -456,14 +466,14 @@ protected:
int & /*attribute_size*/) -> api_error { int & /*attribute_size*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
getxattr_impl(std::string /*api_path*/, const char * /*name*/, getxattr_impl(std::string /*api_path*/, const char * /*name*/,
char * /*value*/, size_t /*size*/, char * /*value*/, size_t /*size*/, int & /*attribute_size*/)
int & /*attribute_size*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
listxattr_impl(std::string /*api_path*/, char * /*buffer*/, size_t /*size*/, listxattr_impl(std::string /*api_path*/, char * /*buffer*/, size_t /*size*/,
@ -471,9 +481,9 @@ protected:
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto removexattr_impl(std::string /*api_path*/,
removexattr_impl(std::string /*api_path*/, const char * /*name*/)
const char * /*name*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -485,21 +495,20 @@ protected:
uint32_t /*position*/) -> api_error { uint32_t /*position*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else // __APPLE__ #else // !defined (__APPLE__)
[[nodiscard]] virtual auto setxattr_impl(std::string /*api_path*/, [[nodiscard]] virtual auto
const char * /*name*/, setxattr_impl(std::string /*api_path*/, const char * /*name*/,
const char * /*value*/, const char * /*value*/, size_t /*size*/, int /*flags*/)
size_t /*size*/, -> api_error {
int /*flags*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined (__APPLE__)
#endif // HAS_SETXATTR #endif // defined(HAS_SETXATTR)
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto setattr_x_impl(std::string /*api_path*/,
setattr_x_impl(std::string /*api_path*/, struct setattr_x * /*attr*/)
struct setattr_x * /*attr*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -510,72 +519,74 @@ protected:
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
setchgtime_impl(std::string /*api_path*/, setchgtime_impl(std::string /*api_path*/, const struct timespec * /*chgtime*/)
const struct timespec * /*chgtime*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto setcrtime_impl(std::string /*api_path*/,
setcrtime_impl(std::string /*api_path*/, const struct timespec * /*crtime*/)
const struct timespec * /*crtime*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto setvolname_impl(const char * /*volname*/)
setvolname_impl(const char * /*volname*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto statfs_x_impl(std::string /*api_path*/,
statfs_x_impl(std::string /*api_path*/, struct statfs * /*stbuf*/)
struct statfs * /*stbuf*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] virtual auto [[nodiscard]] virtual auto statfs_impl(std::string /*api_path*/,
statfs_impl(std::string /*api_path*/, struct statvfs * /*stbuf*/)
struct statvfs * /*stbuf*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
truncate_impl(std::string /*api_path*/, off_t /*size*/, off_t /*size*/,
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/, [[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
off_t /*size*/) -> api_error { off_t /*size*/) -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto unlink_impl(std::string /*api_path*/)
unlink_impl(std::string /*api_path*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
utimens_impl(std::string /*api_path*/, const struct timespec /*tv*/[2], const struct timespec /*tv*/[2],
struct fuse_file_info * /*fi*/) -> api_error { struct fuse_file_info * /*fi*/)
-> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
utimens_impl(std::string /*api_path*/, const struct timespec /*tv*/[2])
const struct timespec /*tv*/[2]) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
write_impl(std::string /*api_path*/, const char * /*buffer*/, write_impl(std::string /*api_path*/, const char * /*buffer*/,
size_t /*write_size*/, off_t /*write_offset*/, size_t /*write_size*/, off_t /*write_offset*/,
struct fuse_file_info * /*fi*/, struct fuse_file_info * /*fi*/, std::size_t & /*bytes_written*/)
std::size_t & /*bytes_written*/) -> api_error { -> api_error {
return api_error::not_implemented; return api_error::not_implemented;
} }
@ -603,5 +614,5 @@ public:
}; };
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_ #endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_

View File

@ -75,25 +75,25 @@ protected:
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto chflags_impl(std::string api_path, uint32_t flags) [[nodiscard]] auto chflags_impl(std::string api_path, uint32_t flags)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__{}
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode, [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode) [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid, [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid) [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto create_impl(std::string api_path, mode_t mode, [[nodiscard]] auto create_impl(std::string api_path, mode_t mode,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
@ -115,7 +115,7 @@ protected:
struct setattr_x *attr, struct setattr_x *attr,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] auto fsync_impl(std::string api_path, int datasync, [[nodiscard]] auto fsync_impl(std::string api_path, int datasync,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
@ -125,30 +125,30 @@ protected:
[[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size, [[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION < 30
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st, [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st) [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto getxtimes_impl(std::string api_path, [[nodiscard]] auto getxtimes_impl(std::string api_path,
struct timespec *bkuptime, struct timespec *bkuptime,
struct timespec *crtime) struct timespec *crtime)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg) auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
-> void * override; -> void * override;
#else #else // FUSE_USE_VERSION < 30
auto init_impl(struct fuse_conn_info *conn) -> void * override; auto init_impl(struct fuse_conn_info *conn) -> void * override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto mkdir_impl(std::string api_path, mode_t mode) [[nodiscard]] auto mkdir_impl(std::string api_path, mode_t mode)
-> api_error override; -> api_error override;
@ -174,12 +174,12 @@ protected:
struct fuse_file_info *file_info, struct fuse_file_info *file_info,
fuse_readdir_flags flags) fuse_readdir_flags flags)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto readdir_impl(std::string api_path, void *buf, [[nodiscard]] auto readdir_impl(std::string api_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 *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto release_impl(std::string api_path, [[nodiscard]] auto release_impl(std::string api_path,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
@ -193,10 +193,10 @@ protected:
[[nodiscard]] auto rename_impl(std::string from_api_path, [[nodiscard]] auto rename_impl(std::string from_api_path,
std::string to_api_path, unsigned int flags) std::string to_api_path, unsigned int flags)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto rename_impl(std::string from_api_path, [[nodiscard]] auto rename_impl(std::string from_api_path,
std::string to_api_path) -> api_error override; std::string to_api_path) -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto rmdir_impl(std::string api_path) -> api_error override; [[nodiscard]] auto rmdir_impl(std::string api_path) -> api_error override;
@ -210,11 +210,11 @@ protected:
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
char *value, size_t size, uint32_t position, char *value, size_t size, uint32_t position,
int &attribute_size) -> api_error override; int &attribute_size) -> api_error override;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
char *value, size_t size, char *value, size_t size,
int &attribute_size) -> api_error override; int &attribute_size) -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] auto listxattr_impl(std::string api_path, char *buffer, [[nodiscard]] auto listxattr_impl(std::string api_path, char *buffer,
size_t size, int &required_size, size_t size, int &required_size,
@ -227,12 +227,12 @@ protected:
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
const char *value, size_t size, int flags, const char *value, size_t size, int flags,
uint32_t position) -> api_error override; uint32_t position) -> api_error override;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name, [[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
const char *value, size_t size, int flags) const char *value, size_t size, int flags)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__)
#endif // HAS_SETXATTR #endif // defined(HAS_SETXATTR{}
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto setattr_x_impl(std::string api_path, [[nodiscard]] auto setattr_x_impl(std::string api_path,
@ -255,19 +255,19 @@ protected:
[[nodiscard]] auto statfs_x_impl(std::string api_path, struct statfs *stbuf) [[nodiscard]] auto statfs_x_impl(std::string api_path, struct statfs *stbuf)
-> api_error override; -> api_error override;
#else // __APPLE__ #else // !defined(__APPLE__)
[[nodiscard]] auto statfs_impl(std::string api_path, struct statvfs *stbuf) [[nodiscard]] auto statfs_impl(std::string api_path, struct statvfs *stbuf)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // defined(__APPLE__)
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size, [[nodiscard]] auto truncate_impl(std::string api_path, off_t size,
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size) [[nodiscard]] auto truncate_impl(std::string api_path, off_t size)
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override; [[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override;
@ -276,11 +276,11 @@ protected:
const struct timespec tv[2], const struct timespec tv[2],
struct fuse_file_info *file_info) struct fuse_file_info *file_info)
-> api_error override; -> api_error override;
#else #else // FUSE_USE_VERSION < 30
[[nodiscard]] auto utimens_impl(std::string api_path, [[nodiscard]] auto utimens_impl(std::string api_path,
const struct timespec tv[2]) const struct timespec tv[2])
-> api_error override; -> api_error override;
#endif #endif // FUSE_USE_VERSION >= 30
[[nodiscard]] auto write_impl(std::string api_path, const char *buffer, [[nodiscard]] auto write_impl(std::string api_path, const char *buffer,
size_t write_size, off_t write_offset, size_t write_size, off_t write_offset,
@ -335,5 +335,5 @@ public:
}; };
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_ #endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_

View File

@ -43,16 +43,17 @@ public:
auto operator=(fuse_drive_base &&) -> fuse_drive_base & = delete; auto operator=(fuse_drive_base &&) -> fuse_drive_base & = delete;
protected: protected:
[[nodiscard]] auto access_impl(std::string api_path, [[nodiscard]] auto access_impl(std::string api_path, int mask)
int mask) -> api_error override; -> api_error override;
protected: protected:
[[nodiscard]] auto check_access(const std::string &api_path, [[nodiscard]] auto check_access(const std::string &api_path, int mask) const
int mask) const -> api_error; -> api_error;
[[nodiscard]] auto check_and_perform( [[nodiscard]] auto
const std::string &api_path, int parent_mask, check_and_perform(const std::string &api_path, int parent_mask,
const std::function<api_error(api_meta_map &meta)> &action) -> api_error; const std::function<api_error(api_meta_map &meta)> &action)
-> api_error;
[[nodiscard]] auto get_current_gid() const -> gid_t; [[nodiscard]] auto get_current_gid() const -> gid_t;
@ -62,58 +63,63 @@ protected:
[[nodiscard]] auto get_effective_uid() const -> uid_t; [[nodiscard]] auto get_effective_uid() const -> uid_t;
[[nodiscard]] static auto [[nodiscard]] static auto check_open_flags(int flags, int mask,
check_open_flags(int flags, int mask, const api_error &fail_error)
const api_error &fail_error) -> api_error; -> api_error;
[[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error; [[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error;
[[nodiscard]] static auto [[nodiscard]] static auto check_readable(int flags,
check_readable(int flags, const api_error &fail_error) -> api_error; const api_error &fail_error)
-> api_error;
[[nodiscard]] static auto [[nodiscard]] static auto check_writeable(int flags,
check_writeable(int flags, const api_error &fail_error) -> api_error; const api_error &fail_error)
-> api_error;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] static auto [[nodiscard]] static auto get_flags_from_meta(const api_meta_map &meta)
get_flags_from_meta(const api_meta_map &meta) -> __uint32_t; -> __uint32_t;
#endif // __APPLE__ #endif // defined(__APPLE__)
[[nodiscard]] static auto [[nodiscard]] static auto get_gid_from_meta(const api_meta_map &meta)
get_gid_from_meta(const api_meta_map &meta) -> gid_t; -> gid_t;
[[nodiscard]] static auto [[nodiscard]] static auto get_mode_from_meta(const api_meta_map &meta)
get_mode_from_meta(const api_meta_map &meta) -> mode_t; -> mode_t;
static void get_timespec_from_meta(const api_meta_map &meta, static void get_timespec_from_meta(const api_meta_map &meta,
const std::string &name, const std::string &name,
struct timespec &ts); struct timespec &ts);
[[nodiscard]] static auto [[nodiscard]] static auto get_uid_from_meta(const api_meta_map &meta)
get_uid_from_meta(const api_meta_map &meta) -> uid_t; -> uid_t;
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto parse_xattr_parameters(const char *name,
parse_xattr_parameters(const char *name, const uint32_t &position, const uint32_t &position,
std::string &attribute_name, std::string &attribute_name,
const std::string &api_path) -> api_error; const std::string &api_path)
#else -> api_error;
[[nodiscard]] auto #else // !defined(__APPLE__)
parse_xattr_parameters(const char *name, std::string &attribute_name, [[nodiscard]] auto parse_xattr_parameters(const char *name,
const std::string &api_path) -> api_error; std::string &attribute_name,
#endif const std::string &api_path)
-> api_error;
#endif // defined(__APPLE__)
#if defined(__APPLE__) #if defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto
parse_xattr_parameters(const char *name, const char *value, size_t size, parse_xattr_parameters(const char *name, const char *value, size_t size,
const uint32_t &position, std::string &attribute_name, const uint32_t &position, std::string &attribute_name,
const std::string &api_path) -> api_error; const std::string &api_path) -> api_error;
#else #else // !defined(__APPLE__)
[[nodiscard]] auto [[nodiscard]] auto parse_xattr_parameters(const char *name, const char *value,
parse_xattr_parameters(const char *name, const char *value, size_t size, size_t size,
std::string &attribute_name, std::string &attribute_name,
const std::string &api_path) -> api_error; const std::string &api_path)
#endif -> api_error;
#endif // defined(__APPLE__)
static void populate_stat(const std::string &api_path, static void populate_stat(const std::string &api_path,
std::uint64_t size_or_count, std::uint64_t size_or_count,
@ -125,13 +131,13 @@ protected:
struct timespec &ts); struct timespec &ts);
public: public:
[[nodiscard]] auto [[nodiscard]] auto check_owner(const std::string &api_path) const
check_owner(const std::string &api_path) const -> api_error override; -> api_error override;
[[nodiscard]] auto check_parent_access(const std::string &api_path, [[nodiscard]] auto check_parent_access(const std::string &api_path,
int mask) const -> api_error override; int mask) const -> api_error override;
}; };
} // namespace repertory } // namespace repertory
#endif // _WIN32 #endif // !defined(_WIN32)
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_BASE_HPP_ #endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_BASE_HPP_

View File

@ -86,5 +86,5 @@ public:
}; };
} // namespace repertory } // namespace repertory
#endif #endif // !defined(_WIN32)
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_I_FUSE_DRIVE_HPP_ #endif // REPERTORY_INCLUDE_DRIVES_FUSE_I_FUSE_DRIVE_HPP_

View File

@ -38,10 +38,12 @@ public:
private: private:
const app_config &config_; const app_config &config_;
packet_client packet_client_; packet_client packet_client_;
remote::user_id uid_ = 0; remote::user_id uid_{0};
remote::group_id gid_ = 0; remote::group_id gid_{0};
public: public:
[[nodiscard]] auto check() -> packet::error_type;
[[nodiscard]] auto fuse_access(const char *path, const std::int32_t &mask) [[nodiscard]] auto fuse_access(const char *path, const std::int32_t &mask)
-> packet::error_type override; -> packet::error_type override;
@ -51,9 +53,9 @@ public:
[[nodiscard]] auto fuse_chmod(const char *path, const remote::file_mode &mode) [[nodiscard]] auto fuse_chmod(const char *path, const remote::file_mode &mode)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_chown(const char *path, const remote::user_id &uid,
fuse_chown(const char *path, const remote::user_id &uid, const remote::group_id &gid)
const remote::group_id &gid) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_destroy() -> packet::error_type override; [[nodiscard]] auto fuse_destroy() -> packet::error_type override;
@ -67,21 +69,23 @@ public:
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_fsetattr_x( [[nodiscard]] auto fuse_fsetattr_x(const char *path,
const char *path, const remote::setattr_x &attr, const remote::setattr_x &attr,
const remote::file_handle &handle) -> packet::error_type override; const remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_fsync(const char *path, const std::int32_t &datasync,
fuse_fsync(const char *path, const std::int32_t &datasync, const remote::file_handle &handle)
const remote::file_handle &handle) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_ftruncate( [[nodiscard]] auto fuse_ftruncate(const char *path,
const char *path, const remote::file_offset &size, const remote::file_offset &size,
const remote::file_handle &handle) -> packet::error_type override; const remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_getattr(const char *path, remote::stat &st,
fuse_getattr(const char *path, remote::stat &st, bool &directory)
bool &directory) -> packet::error_type override; -> packet::error_type override;
/*[[nodiscard]] packet::error_type fuse_getxattr(const char *path, const char /*[[nodiscard]] packet::error_type fuse_getxattr(const char *path, const char
*name, char *value, const remote::file_size &size) override ; *name, char *value, const remote::file_size &size) override ;
@ -90,9 +94,10 @@ public:
*name, char *value, const remote::file_size &size, std::uint32_t position) *name, char *value, const remote::file_size &size, std::uint32_t position)
override ;*/ override ;*/
[[nodiscard]] auto [[nodiscard]] auto fuse_getxtimes(const char *path,
fuse_getxtimes(const char *path, remote::file_time &bkuptime, remote::file_time &bkuptime,
remote::file_time &crtime) -> packet::error_type override; remote::file_time &crtime)
-> packet::error_type override;
[[nodiscard]] auto fuse_init() -> packet::error_type override; [[nodiscard]] auto fuse_init() -> packet::error_type override;
@ -107,25 +112,27 @@ public:
[[nodiscard]] auto [[nodiscard]] auto
fuse_create(const char *path, const remote::file_mode &mode, fuse_create(const char *path, const remote::file_mode &mode,
const remote::open_flags &flags, const remote::open_flags &flags, remote::file_handle &handle)
remote::file_handle &handle) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_open(const char *path,
fuse_open(const char *path, const remote::open_flags &flags, const remote::open_flags &flags,
remote::file_handle &handle) -> packet::error_type override; remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_read(const char *path, char *buffer,
fuse_read(const char *path, char *buffer, const remote::file_size &read_size, const remote::file_size &read_size,
const remote::file_offset &read_offset, const remote::file_offset &read_offset,
const remote::file_handle &handle) -> packet::error_type override; const remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto fuse_rename(const char *from, [[nodiscard]] auto fuse_rename(const char *from, const char *to)
const char *to) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto
fuse_readdir(const char *path, const remote::file_offset &offset, fuse_readdir(const char *path, const remote::file_offset &offset,
const remote::file_handle &handle, const remote::file_handle &handle, std::string &item_path)
std::string &item_path) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_release(const char *path, [[nodiscard]] auto fuse_release(const char *path,
const remote::file_handle &handle) const remote::file_handle &handle)
@ -139,8 +146,8 @@ public:
* char *name) override * char *name) override
* ;*/ * ;*/
[[nodiscard]] auto [[nodiscard]] auto fuse_rmdir(const char *path)
fuse_rmdir(const char *path) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_setattr_x(const char *path, remote::setattr_x &attr) [[nodiscard]] auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
-> packet::error_type override; -> packet::error_type override;
@ -157,8 +164,8 @@ public:
const remote::file_time &crtime) const remote::file_time &crtime)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_setvolname(const char *volname)
fuse_setvolname(const char *volname) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] /*packet::error_type fuse_setxattr(const char *path, const char [[nodiscard]] /*packet::error_type fuse_setxattr(const char *path, const char
*name, const char *value, const remote::file_size &size, const std::int32_t *name, const char *value, const remote::file_size &size, const std::int32_t
@ -169,45 +176,48 @@ public:
std::int32_t &flags, std::uint32_t position) override ;*/ std::int32_t &flags, std::uint32_t position) override ;*/
[[nodiscard]] auto [[nodiscard]] auto
fuse_statfs(const char *path, std::uint64_t frsize, fuse_statfs(const char *path, std::uint64_t frsize, remote::statfs &st)
remote::statfs &st) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize,
fuse_statfs_x(const char *path, std::uint64_t bsize, remote::statfs_x &st)
remote::statfs_x &st) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_truncate(const char *path,
fuse_truncate(const char *path, const remote::file_offset &size)
const remote::file_offset &size) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_unlink(const char *path)
fuse_unlink(const char *path) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_utimens(const char *path, const remote::file_time *tv,
fuse_utimens(const char *path, const remote::file_time *tv, std::uint64_t op0, std::uint64_t op0, std::uint64_t op1)
std::uint64_t op1) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto [[nodiscard]] auto fuse_write(const char *path, const char *buffer,
fuse_write(const char *path, const char *buffer, const remote::file_size &write_size,
const remote::file_size &write_size, const remote::file_offset &write_offset,
const remote::file_offset &write_offset, const remote::file_handle &handle)
const remote::file_handle &handle) -> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_write_base64( [[nodiscard]] auto fuse_write_base64(const char *path, const char *buffer,
const char *path, const char *buffer, const remote::file_size &write_size, const remote::file_size &write_size,
const remote::file_offset &write_offset, const remote::file_offset &write_offset,
const remote::file_handle &handle) -> packet::error_type override; const remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto json_create_directory_snapshot( [[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
const std::string &path, json &json_data) -> packet::error_type override; json &json_data)
-> packet::error_type override;
[[nodiscard]] auto json_read_directory_snapshot( [[nodiscard]] auto json_read_directory_snapshot(
const std::string &path, const remote::file_handle &handle, const std::string &path, const remote::file_handle &handle,
std::uint32_t page, json &json_data) -> packet::error_type override; std::uint32_t page, json &json_data) -> packet::error_type override;
[[nodiscard]] auto json_release_directory_snapshot( [[nodiscard]] auto
const std::string &path, json_release_directory_snapshot(const std::string &path,
const remote::file_handle &handle) -> packet::error_type override; const remote::file_handle &handle)
-> packet::error_type override;
void set_fuse_uid_gid(const remote::user_id &uid, void set_fuse_uid_gid(const remote::user_id &uid,
const remote::group_id &gid) override; const remote::group_id &gid) override;

View File

@ -29,87 +29,92 @@ class i_remote_instance : public virtual i_remote_json {
INTERFACE_SETUP(i_remote_instance); INTERFACE_SETUP(i_remote_instance);
public: public:
virtual auto winfsp_can_delete(PVOID file_desc, PWSTR file_name) [[nodiscard]] virtual auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags, [[nodiscard]] virtual auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
BOOLEAN &was_deleted) -> packet::error_type = 0; UINT32 flags, BOOLEAN &was_deleted)
virtual auto winfsp_close(PVOID file_desc) -> packet::error_type = 0;
virtual auto winfsp_create(PWSTR file_name, UINT32 create_options,
UINT32 granted_access, UINT32 file_attributes,
UINT64 allocation_size, PVOID *file_desc,
remote::file_info *file_info,
std::string &normalized_name, BOOLEAN &exists)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_flush(PVOID file_desc, remote::file_info *file_info) [[nodiscard]] virtual auto winfsp_close(PVOID file_desc)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr) [[nodiscard]] virtual auto
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
UINT32 file_attributes, UINT64 allocation_size,
PVOID *file_desc, remote::file_info *file_info,
std::string &normalized_name, BOOLEAN &exists)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_get_file_info(PVOID file_desc, [[nodiscard]] virtual auto winfsp_flush(PVOID file_desc,
remote::file_info *file_info) remote::file_info *file_info)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto [[nodiscard]] virtual auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
-> packet::error_type = 0;
[[nodiscard]] virtual auto winfsp_get_file_info(PVOID file_desc,
remote::file_info *file_info)
-> packet::error_type = 0;
[[nodiscard]] virtual auto
winfsp_get_security_by_name(PWSTR file_name, PUINT32 file_attributes, winfsp_get_security_by_name(PWSTR file_name, PUINT32 file_attributes,
std::uint64_t *security_descriptor_size, std::uint64_t *security_descriptor_size,
std::wstring &str_descriptor) std::wstring &str_descriptor)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size, [[nodiscard]] virtual auto winfsp_get_volume_info(UINT64 &total_size,
std::string &volume_label) UINT64 &free_size,
std::string &volume_label)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_mounted(const std::wstring &location) [[nodiscard]] virtual auto winfsp_mounted(const std::wstring &location)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_open(PWSTR file_name, UINT32 create_options, [[nodiscard]] virtual auto
UINT32 granted_access, PVOID *file_desc, winfsp_open(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
remote::file_info *file_info, PVOID *file_desc, remote::file_info *file_info,
std::string &normalized_name) std::string &normalized_name) -> packet::error_type = 0;
[[nodiscard]] virtual auto
winfsp_overwrite(PVOID file_desc, UINT32 file_attributes,
BOOLEAN replace_file_attributes, UINT64 allocation_size,
remote::file_info *file_info) -> packet::error_type = 0;
[[nodiscard]] virtual auto winfsp_read(PVOID file_desc, PVOID buffer,
UINT64 offset, UINT32 length,
PUINT32 bytes_transferred)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_overwrite(PVOID file_desc, UINT32 file_attributes, [[nodiscard]] virtual auto winfsp_read_directory(PVOID file_desc,
BOOLEAN replace_file_attributes, PWSTR pattern, PWSTR marker,
UINT64 allocation_size, json &itemList)
remote::file_info *file_info)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset, [[nodiscard]] virtual auto winfsp_rename(PVOID file_desc, PWSTR file_name,
UINT32 length, PUINT32 bytes_transferred) PWSTR new_file_name,
BOOLEAN replace_if_exists)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_read_directory(PVOID file_desc, PWSTR pattern, [[nodiscard]] virtual auto
PWSTR marker, json &itemList) winfsp_set_basic_info(PVOID file_desc, UINT32 file_attributes,
UINT64 creation_time, UINT64 last_access_time,
UINT64 last_write_time, UINT64 change_time,
remote::file_info *file_info) -> packet::error_type = 0;
[[nodiscard]] virtual auto winfsp_set_file_size(PVOID file_desc,
UINT64 new_size,
BOOLEAN set_allocation_size,
remote::file_info *file_info)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_rename(PVOID file_desc, PWSTR file_name, [[nodiscard]] virtual auto winfsp_unmounted(const std::wstring &location)
PWSTR new_file_name, BOOLEAN replace_if_exists)
-> packet::error_type = 0; -> packet::error_type = 0;
virtual auto winfsp_set_basic_info(PVOID file_desc, UINT32 file_attributes, [[nodiscard]] virtual auto
UINT64 creation_time, winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
UINT64 last_access_time, BOOLEAN write_to_end, BOOLEAN constrained_io,
UINT64 last_write_time, UINT64 change_time, PUINT32 bytes_transferred, remote::file_info *file_info)
remote::file_info *file_info)
-> packet::error_type = 0;
virtual auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
BOOLEAN set_allocation_size,
remote::file_info *file_info)
-> packet::error_type = 0;
virtual auto winfsp_unmounted(const std::wstring &location)
-> packet::error_type = 0;
virtual auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset,
UINT32 length, BOOLEAN write_to_end,
BOOLEAN constrained_io, PUINT32 bytes_transferred,
remote::file_info *file_info)
-> packet::error_type = 0; -> packet::error_type = 0;
}; };

View File

@ -44,93 +44,105 @@ private:
#if defined(_WIN32) #if defined(_WIN32)
#define to_handle(x) (x) #define to_handle(x) (x)
#else // !defined(_WIN32) #else // !defined(_WIN32)
static auto to_handle(PVOID file_desc) -> native_handle; [[nodiscard]] static auto to_handle(PVOID file_desc) -> native_handle;
#endif // defined(_WIN32) #endif // defined(_WIN32)
public: public:
auto json_create_directory_snapshot(const std::string &path, json &json_data) [[nodiscard]] auto check() -> packet::error_type;
[[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
json &json_data)
-> packet::error_type override; -> packet::error_type override;
auto json_read_directory_snapshot(const std::string &path, [[nodiscard]] auto json_read_directory_snapshot(
const remote::file_handle &handle, const std::string &path, const remote::file_handle &handle,
std::uint32_t page, json &json_data) std::uint32_t page, json &json_data) -> packet::error_type override;
[[nodiscard]] auto
json_release_directory_snapshot(const std::string &path,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto json_release_directory_snapshot(const std::string &path, [[nodiscard]] auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_can_delete(PVOID file_desc, PWSTR file_name) [[nodiscard]] auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
UINT32 flags, BOOLEAN &was_deleted)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags, [[nodiscard]] auto winfsp_close(PVOID file_desc)
BOOLEAN &was_deleted) -> packet::error_type override;
auto winfsp_close(PVOID file_desc) -> packet::error_type override;
auto winfsp_create(PWSTR file_name, UINT32 create_options,
UINT32 granted_access, UINT32 attributes,
UINT64 allocation_size, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name,
BOOLEAN &exists) -> packet::error_type override;
auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr) [[nodiscard]] auto
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
UINT32 attributes, UINT64 allocation_size, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name,
BOOLEAN &exists) -> packet::error_type override;
[[nodiscard]] auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_file_info(PVOID file_desc, remote::file_info *file_info) [[nodiscard]] auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_security_by_name(PWSTR file_name, PUINT32 attributes, [[nodiscard]] auto winfsp_get_file_info(PVOID file_desc,
std::uint64_t *descriptor_size, remote::file_info *file_info)
std::wstring &string_descriptor)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size, [[nodiscard]] auto winfsp_get_security_by_name(
std::string &volume_label) PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size,
std::wstring &string_descriptor) -> packet::error_type override;
[[nodiscard]] auto winfsp_get_volume_info(UINT64 &total_size,
UINT64 &free_size,
std::string &volume_label)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_mounted(const std::wstring &location) [[nodiscard]] auto winfsp_mounted(const std::wstring &location)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_open(PWSTR file_name, UINT32 create_options, [[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options,
UINT32 granted_access, PVOID *file_desc, UINT32 granted_access, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name) remote::file_info *file_info,
std::string &normalized_name)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_overwrite(PVOID file_desc, UINT32 attributes, [[nodiscard]] auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
BOOLEAN replace_attributes, UINT64 allocation_size, BOOLEAN replace_attributes,
remote::file_info *file_info) UINT64 allocation_size,
remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length, [[nodiscard]] auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset,
PUINT32 bytes_transferred) -> packet::error_type override; UINT32 length, PUINT32 bytes_transferred)
auto winfsp_read_directory(PVOID file_desc, PWSTR pattern, PWSTR marker,
json &itemList) -> packet::error_type override;
auto winfsp_rename(PVOID file_desc, PWSTR file_name, PWSTR new_file_name,
BOOLEAN replace_if_exists) -> packet::error_type override;
auto winfsp_set_basic_info(PVOID file_desc, UINT32 attributes,
UINT64 creation_time, UINT64 last_access_time,
UINT64 last_write_time, UINT64 change_time,
remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size, [[nodiscard]] auto winfsp_read_directory(PVOID file_desc, PWSTR pattern,
BOOLEAN set_allocation_size, PWSTR marker, json &itemList)
remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_unmounted(const std::wstring &location) [[nodiscard]] auto winfsp_rename(PVOID file_desc, PWSTR file_name,
PWSTR new_file_name,
BOOLEAN replace_if_exists)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length, [[nodiscard]] auto winfsp_set_basic_info(
BOOLEAN write_to_end, BOOLEAN constrained_io, PVOID file_desc, UINT32 attributes, UINT64 creation_time,
PUINT32 bytes_transferred, remote::file_info *file_info) UINT64 last_access_time, UINT64 last_write_time, UINT64 change_time,
remote::file_info *file_info) -> packet::error_type override;
[[nodiscard]] auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
BOOLEAN set_allocation_size,
remote::file_info *file_info)
-> packet::error_type override;
[[nodiscard]] auto winfsp_unmounted(const std::wstring &location)
-> packet::error_type override;
[[nodiscard]] auto
winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
BOOLEAN write_to_end, BOOLEAN constrained_io,
PUINT32 bytes_transferred, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
}; };
} // namespace remote_winfsp } // namespace remote_winfsp

View File

@ -58,41 +58,46 @@ private:
public: public:
// FUSE Layer // FUSE Layer
auto fuse_access(const char *path, const std::int32_t &mask) [[nodiscard]] auto fuse_access(const char *path, const std::int32_t &mask)
-> packet::error_type override; -> packet::error_type override;
auto fuse_chflags(const char *path, std::uint32_t flags) [[nodiscard]] auto fuse_chflags(const char *path, std::uint32_t flags)
-> packet::error_type override; -> packet::error_type override;
auto fuse_chmod(const char *path, const remote::file_mode &mode) [[nodiscard]] auto fuse_chmod(const char *path, const remote::file_mode &mode)
-> packet::error_type override; -> packet::error_type override;
auto fuse_chown(const char *path, const remote::user_id &uid, [[nodiscard]] auto fuse_chown(const char *path, const remote::user_id &uid,
const remote::group_id &gid) -> packet::error_type override; const remote::group_id &gid)
-> packet::error_type override;
auto fuse_destroy() -> packet::error_type override; [[nodiscard]] auto fuse_destroy() -> packet::error_type override;
/*packet::error_type fuse_fallocate(const char *path, const std::int32_t /*packet::error_type fuse_fallocate(const char *path, const std::int32_t
&mode, const remote::file_offset &offset, const remote::file_offset &mode, const remote::file_offset &offset, const remote::file_offset
&length, const remote::file_handle &handle) override ;*/ &length, const remote::file_handle &handle) override ;*/
auto fuse_fgetattr(const char *path, remote::stat &r_stat, bool &directory, [[nodiscard]] auto fuse_fgetattr(const char *path, remote::stat &r_stat,
const remote::file_handle &handle) bool &directory,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_fsetattr_x(const char *path, const remote::setattr_x &attr, [[nodiscard]] auto fuse_fsetattr_x(const char *path,
const remote::file_handle &handle) const remote::setattr_x &attr,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_fsync(const char *path, const std::int32_t &datasync, [[nodiscard]] auto fuse_fsync(const char *path, const std::int32_t &datasync,
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_ftruncate(const char *path, const remote::file_offset &size, [[nodiscard]] auto fuse_ftruncate(const char *path,
const remote::file_handle &handle) const remote::file_offset &size,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_getattr(const char *path, remote::stat &r_stat, bool &directory) [[nodiscard]] auto fuse_getattr(const char *path, remote::stat &r_stat,
bool &directory)
-> packet::error_type override; -> packet::error_type override;
/*packet::error_type fuse_getxattr(const char *path, const char *name, char /*packet::error_type fuse_getxattr(const char *path, const char *name, char
@ -101,77 +106,90 @@ public:
packet::error_type fuse_getxattrOSX(const char *path, const char *name, char packet::error_type fuse_getxattrOSX(const char *path, const char *name, char
*value, const remote::file_size &size, std::uint32_t position) override ;*/ *value, const remote::file_size &size, std::uint32_t position) override ;*/
auto fuse_getxtimes(const char *path, remote::file_time &bkuptime, [[nodiscard]] auto fuse_getxtimes(const char *path,
remote::file_time &crtime) -> packet::error_type override; remote::file_time &bkuptime,
remote::file_time &crtime)
-> packet::error_type override;
auto fuse_init() -> packet::error_type override; [[nodiscard]] auto fuse_init() -> packet::error_type override;
/*packet::error_type fuse_listxattr(const char *path, char *buffer, /*packet::error_type fuse_listxattr(const char *path, char *buffer,
const remote::file_size &size) override const remote::file_size &size) override
;*/ ;*/
auto fuse_mkdir(const char *path, const remote::file_mode &mode) [[nodiscard]] auto fuse_mkdir(const char *path, const remote::file_mode &mode)
-> packet::error_type override; -> packet::error_type override;
auto fuse_opendir(const char *path, remote::file_handle &handle) [[nodiscard]] auto fuse_opendir(const char *path, remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_create(const char *path, const remote::file_mode &mode, [[nodiscard]] auto
const remote::open_flags &flags, remote::file_handle &handle) fuse_create(const char *path, const remote::file_mode &mode,
const remote::open_flags &flags, remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_open(const char *path, const remote::open_flags &flags, [[nodiscard]] auto fuse_open(const char *path,
remote::file_handle &handle) -> packet::error_type override; const remote::open_flags &flags,
remote::file_handle &handle)
auto fuse_read(const char *path, char *buffer,
const remote::file_size &read_size,
const remote::file_offset &read_offset,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_rename(const char *from, const char *to) [[nodiscard]] auto fuse_read(const char *path, char *buffer,
const remote::file_size &read_size,
const remote::file_offset &read_offset,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_write(const char *path, const char *buffer, [[nodiscard]] auto fuse_rename(const char *from, const char *to)
const remote::file_size &write_size,
const remote::file_offset &write_offset,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_write_base64(const char *path, const char *buffer, [[nodiscard]] auto fuse_write(const char *path, const char *buffer,
const remote::file_size &write_size, const remote::file_size &write_size,
const remote::file_offset &write_offset, const remote::file_offset &write_offset,
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_readdir(const char *path, const remote::file_offset &offset, [[nodiscard]] auto fuse_write_base64(const char *path, const char *buffer,
const remote::file_handle &handle, std::string &item_path) const remote::file_size &write_size,
const remote::file_offset &write_offset,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_release(const char *path, const remote::file_handle &handle) [[nodiscard]] auto
fuse_readdir(const char *path, const remote::file_offset &offset,
const remote::file_handle &handle, std::string &item_path)
-> packet::error_type override; -> packet::error_type override;
auto fuse_releasedir(const char *path, const remote::file_handle &handle) [[nodiscard]] auto fuse_release(const char *path,
const remote::file_handle &handle)
-> packet::error_type override;
[[nodiscard]] auto fuse_releasedir(const char *path,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
/*packet::error_type fuse_removexattr(const char *path, const char *name) /*packet::error_type fuse_removexattr(const char *path, const char *name)
* override ;*/ * override ;*/
auto fuse_rmdir(const char *path) -> packet::error_type override; [[nodiscard]] auto fuse_rmdir(const char *path)
auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
-> packet::error_type override; -> packet::error_type override;
auto fuse_setbkuptime(const char *path, const remote::file_time &bkuptime) [[nodiscard]] auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
-> packet::error_type override; -> packet::error_type override;
auto fuse_setchgtime(const char *path, const remote::file_time &chgtime) [[nodiscard]] auto fuse_setbkuptime(const char *path,
const remote::file_time &bkuptime)
-> packet::error_type override; -> packet::error_type override;
auto fuse_setcrtime(const char *path, const remote::file_time &crtime) [[nodiscard]] auto fuse_setchgtime(const char *path,
const remote::file_time &chgtime)
-> packet::error_type override; -> packet::error_type override;
auto fuse_setvolname(const char *volname) -> packet::error_type override; [[nodiscard]] auto fuse_setcrtime(const char *path,
const remote::file_time &crtime)
-> packet::error_type override;
[[nodiscard]] auto fuse_setvolname(const char *volname)
-> packet::error_type override;
/*packet::error_type fuse_setxattr(const char *path, const char *name, const /*packet::error_type fuse_setxattr(const char *path, const char *name, const
char *value, const remote::file_size &size, const std::int32_t &flags) char *value, const remote::file_size &size, const std::int32_t &flags)
@ -181,109 +199,123 @@ public:
char *value, const remote::file_size &size, const std::int32_t &flags, char *value, const remote::file_size &size, const std::int32_t &flags,
std::uint32_t position) override ;*/ std::uint32_t position) override ;*/
auto fuse_statfs(const char *path, std::uint64_t frsize, [[nodiscard]] auto fuse_statfs(const char *path, std::uint64_t frsize,
remote::statfs &r_stat) -> packet::error_type override; remote::statfs &r_stat)
auto fuse_statfs_x(const char *path, std::uint64_t bsize,
remote::statfs_x &r_stat) -> packet::error_type override;
auto fuse_truncate(const char *path, const remote::file_offset &size)
-> packet::error_type override; -> packet::error_type override;
auto fuse_unlink(const char *path) -> packet::error_type override; [[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize,
remote::statfs_x &r_stat)
-> packet::error_type override;
auto fuse_utimens(const char *path, const remote::file_time *tv, [[nodiscard]] auto fuse_truncate(const char *path,
std::uint64_t op0, std::uint64_t op1) const remote::file_offset &size)
-> packet::error_type override;
[[nodiscard]] auto fuse_unlink(const char *path)
-> packet::error_type override;
[[nodiscard]] auto fuse_utimens(const char *path, const remote::file_time *tv,
std::uint64_t op0, std::uint64_t op1)
-> packet::error_type override; -> packet::error_type override;
void set_fuse_uid_gid(const remote::user_id & /* uid */, void set_fuse_uid_gid(const remote::user_id & /* uid */,
const remote::group_id & /* gid */) override {} const remote::group_id & /* gid */) override {}
// JSON Layer // JSON Layer
auto json_create_directory_snapshot(const std::string &path, json &json_data) [[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
json &json_data)
-> packet::error_type override; -> packet::error_type override;
auto json_read_directory_snapshot(const std::string &path, [[nodiscard]] auto json_read_directory_snapshot(
const remote::file_handle &handle, const std::string &path, const remote::file_handle &handle,
std::uint32_t page, json &json_data) std::uint32_t page, json &json_data) -> packet::error_type override;
-> packet::error_type override;
auto json_release_directory_snapshot(const std::string &path, [[nodiscard]] auto
const remote::file_handle &handle) json_release_directory_snapshot(const std::string &path,
const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
// WinFSP Layer // WinFSP Layer
auto winfsp_can_delete(PVOID file_desc, PWSTR file_name) [[nodiscard]] auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags, [[nodiscard]] auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
BOOLEAN &was_deleted) -> packet::error_type override; UINT32 flags, BOOLEAN &was_deleted)
auto winfsp_close(PVOID file_desc) -> packet::error_type override;
auto winfsp_create(PWSTR file_name, UINT32 create_options,
UINT32 granted_access, UINT32 attributes,
UINT64 allocation_size, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name,
BOOLEAN &exists) -> packet::error_type override;
auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr) [[nodiscard]] auto winfsp_close(PVOID file_desc)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_file_info(PVOID file_desc, remote::file_info *file_info) [[nodiscard]] auto
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
UINT32 attributes, UINT64 allocation_size, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name,
BOOLEAN &exists) -> packet::error_type override;
[[nodiscard]] auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_security_by_name(PWSTR file_name, PUINT32 attributes, [[nodiscard]] auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
std::uint64_t *descriptor_size,
std::wstring &string_descriptor)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size, [[nodiscard]] auto winfsp_get_file_info(PVOID file_desc,
std::string &volume_label) remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_mounted(const std::wstring &location) [[nodiscard]] auto winfsp_get_security_by_name(
PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size,
std::wstring &string_descriptor) -> packet::error_type override;
[[nodiscard]] auto winfsp_get_volume_info(UINT64 &total_size,
UINT64 &free_size,
std::string &volume_label)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_open(PWSTR file_name, UINT32 create_options, [[nodiscard]] auto winfsp_mounted(const std::wstring &location)
UINT32 granted_access, PVOID *file_desc,
remote::file_info *file_info, std::string &normalized_name)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_overwrite(PVOID file_desc, UINT32 attributes, [[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options,
BOOLEAN replace_attributes, UINT64 allocation_size, UINT32 granted_access, PVOID *file_desc,
remote::file_info *file_info) remote::file_info *file_info,
std::string &normalized_name)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length, [[nodiscard]] auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
PUINT32 bytes_transferred) -> packet::error_type override; BOOLEAN replace_attributes,
UINT64 allocation_size,
auto winfsp_read_directory(PVOID file_desc, PWSTR pattern, PWSTR marker, remote::file_info *file_info)
json &item_list) -> packet::error_type override;
auto winfsp_rename(PVOID file_desc, PWSTR file_name, PWSTR new_file_name,
BOOLEAN replace_if_exists) -> packet::error_type override;
auto winfsp_set_basic_info(PVOID file_desc, UINT32 attributes,
UINT64 creation_time, UINT64 last_access_time,
UINT64 last_write_time, UINT64 change_time,
remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size, [[nodiscard]] auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset,
BOOLEAN set_allocation_size, UINT32 length, PUINT32 bytes_transferred)
remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_unmounted(const std::wstring &location) [[nodiscard]] auto winfsp_read_directory(PVOID file_desc, PWSTR pattern,
PWSTR marker, json &item_list)
-> packet::error_type override; -> packet::error_type override;
auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length, [[nodiscard]] auto winfsp_rename(PVOID file_desc, PWSTR file_name,
BOOLEAN write_to_end, BOOLEAN constrained_io, PWSTR new_file_name,
PUINT32 bytes_transferred, remote::file_info *file_info) BOOLEAN replace_if_exists)
-> packet::error_type override;
[[nodiscard]] auto winfsp_set_basic_info(
PVOID file_desc, UINT32 attributes, UINT64 creation_time,
UINT64 last_access_time, UINT64 last_write_time, UINT64 change_time,
remote::file_info *file_info) -> packet::error_type override;
[[nodiscard]] auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
BOOLEAN set_allocation_size,
remote::file_info *file_info)
-> packet::error_type override;
[[nodiscard]] auto winfsp_unmounted(const std::wstring &location)
-> packet::error_type override;
[[nodiscard]] auto
winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
BOOLEAN write_to_end, BOOLEAN constrained_io,
PUINT32 bytes_transferred, remote::file_info *file_info)
-> packet::error_type override; -> packet::error_type override;
}; };
} // namespace remote_winfsp } // namespace remote_winfsp

View File

@ -35,9 +35,8 @@ public:
~logging_consumer(); ~logging_consumer();
private: private:
static constexpr const std::uint8_t MAX_LOG_FILES{5U}; static constexpr std::uint8_t MAX_LOG_FILES{5U};
static constexpr const std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * static constexpr std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * 5ULL};
5ULL};
private: private:
static void process_event(const i_event &evt); static void process_event(const i_event &evt);

View File

@ -27,7 +27,7 @@ class i_event;
class event_system final { class event_system final {
private: private:
static constexpr const std::uint8_t max_queue_retry{ static constexpr std::uint8_t max_queue_retry{
30U, 30U,
}; };
@ -35,7 +35,7 @@ private:
std::thread::hardware_concurrency() * 4U, std::thread::hardware_concurrency() * 4U,
}; };
static constexpr const std::chrono::seconds queue_wait_secs{ static constexpr std::chrono::seconds queue_wait_secs{
5s, 5s,
}; };

View File

@ -33,8 +33,8 @@ struct curl_error final : public i_event {
function_name(std::string{function_name_}), function_name(std::string{function_name_}),
url(std::move(url_)) {} url(std::move(url_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"curl_error"}; static constexpr std::string_view name{"curl_error"};
CURLcode code{}; CURLcode code{};
std::string function_name; std::string function_name;

View File

@ -31,8 +31,8 @@ struct debug_log final : public i_event {
debug_log(std::string_view function_name_, std::string msg_) debug_log(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {} : function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"debug_log"}; static constexpr std::string_view name{"debug_log"};
std::string function_name; std::string function_name;
std::string msg; std::string msg;

View File

@ -34,8 +34,8 @@ struct directory_remove_failed final : public i_event {
error(error_), error(error_),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"directory_remove_failed"}; static constexpr std::string_view name{"directory_remove_failed"};
std::string api_path; std::string api_path;
api_error error{}; api_error error{};

View File

@ -32,8 +32,8 @@ struct directory_removed final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"directory_removed"}; static constexpr std::string_view name{"directory_removed"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct directory_removed_externally final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"directory_removed_externally"}; static constexpr std::string_view name{"directory_removed_externally"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -34,8 +34,8 @@ struct download_begin final : public i_event {
dest_path(std::move(dest_path_)), dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"download_begin"}; static constexpr std::string_view name{"download_begin"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -35,8 +35,8 @@ struct download_end final : public i_event {
error(error_), error(error_),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"download_end"}; static constexpr std::string_view name{"download_end"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -35,8 +35,8 @@ struct download_progress final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
progress(progress_) {} progress(progress_) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"download_progress"}; static constexpr std::string_view name{"download_progress"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -35,8 +35,8 @@ struct download_restore_failed final : public i_event {
error(std::move(error_)), error(std::move(error_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"download_restore_failed"}; static constexpr std::string_view name{"download_restore_failed"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -34,8 +34,8 @@ struct download_restored final : public i_event {
dest_path(std::move(dest_path_)), dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"download_restored"}; static constexpr std::string_view name{"download_restored"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -36,8 +36,8 @@ struct download_resume_add_failed final : public i_event {
error(std::move(error_)), error(std::move(error_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"download_resume_add_failed"}; static constexpr std::string_view name{"download_resume_add_failed"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -34,8 +34,8 @@ struct download_resume_added final : public i_event {
dest_path(std::move(dest_path_)), dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"download_resume_added"}; static constexpr std::string_view name{"download_resume_added"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -34,8 +34,8 @@ struct download_resume_removed final : public i_event {
dest_path(std::move(dest_path_)), dest_path(std::move(dest_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"download_resume_removed"}; static constexpr std::string_view name{"download_resume_removed"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -35,8 +35,8 @@ struct download_type_selected final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
type(type_) {} type(type_) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"download_type_selected"}; static constexpr std::string_view name{"download_type_selected"};
std::string api_path; std::string api_path;
std::string dest_path; std::string dest_path;

View File

@ -35,8 +35,8 @@ struct drive_mount_failed final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {} mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"drive_mount_failed"}; static constexpr std::string_view name{"drive_mount_failed"};
NTSTATUS error{}; NTSTATUS error{};
std::string function_name; std::string function_name;

View File

@ -34,8 +34,8 @@ struct drive_mount_result final : public i_event {
mount_location(std::move(mount_location_)), mount_location(std::move(mount_location_)),
result(std::move(result_)) {} result(std::move(result_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"drive_mount_result"}; static constexpr std::string_view name{"drive_mount_result"};
std::string function_name; std::string function_name;
std::string mount_location; std::string mount_location;

View File

@ -32,8 +32,8 @@ struct drive_mounted final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {} mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"drive_mounted"}; static constexpr std::string_view name{"drive_mounted"};
std::string function_name; std::string function_name;
std::string mount_location; std::string mount_location;

View File

@ -31,8 +31,8 @@ struct drive_stop_timed_out final : public i_event {
drive_stop_timed_out(std::string_view function_name_) drive_stop_timed_out(std::string_view function_name_)
: function_name(std::string(function_name_)) {} : function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"drive_stop_timed_out"}; static constexpr std::string_view name{"drive_stop_timed_out"};
std::string function_name; std::string function_name;

View File

@ -33,8 +33,8 @@ struct drive_unmount_pending final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {} mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"drive_unmount_pending"}; static constexpr std::string_view name{"drive_unmount_pending"};
std::string function_name; std::string function_name;
std::string mount_location; std::string mount_location;

View File

@ -32,8 +32,8 @@ struct drive_unmounted final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
mount_location(std::move(mount_location_)) {} mount_location(std::move(mount_location_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"drive_unmounted"}; static constexpr std::string_view name{"drive_unmounted"};
std::string function_name; std::string function_name;
std::string mount_location; std::string mount_location;

View File

@ -31,8 +31,8 @@ struct event_level_changed final : public i_event {
event_level_changed(std::string_view function_name_, event_level new_level_) event_level_changed(std::string_view function_name_, event_level new_level_)
: function_name(std::string(function_name_)), new_level(new_level_) {} : function_name(std::string(function_name_)), new_level(new_level_) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"event_level_changed"}; static constexpr std::string_view name{"event_level_changed"};
std::string function_name; std::string function_name;
event_level new_level{}; event_level new_level{};

View File

@ -32,8 +32,8 @@ struct file_pinned final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"file_pinned"}; static constexpr std::string_view name{"file_pinned"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -34,8 +34,8 @@ struct file_remove_failed final : public i_event {
error(error_), error(error_),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"file_remove_failed"}; static constexpr std::string_view name{"file_remove_failed"};
std::string api_path; std::string api_path;
api_error error{}; api_error error{};

View File

@ -32,8 +32,8 @@ struct file_removed final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"file_removed"}; static constexpr std::string_view name{"file_removed"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct file_removed_externally final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"file_removed_externally"}; static constexpr std::string_view name{"file_removed_externally"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -32,8 +32,8 @@ struct file_unpinned final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"file_unpinned"}; static constexpr std::string_view name{"file_unpinned"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -37,8 +37,8 @@ struct file_upload_completed final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"file_upload_completed"}; static constexpr std::string_view name{"file_upload_completed"};
std::string api_path; std::string api_path;
bool cancelled{}; bool cancelled{};

View File

@ -35,8 +35,8 @@ struct file_upload_failed final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"file_upload_failed"}; static constexpr std::string_view name{"file_upload_failed"};
std::string api_path; std::string api_path;
std::string error; std::string error;

View File

@ -34,8 +34,8 @@ struct file_upload_not_found final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"file_upload_not_found"}; static constexpr std::string_view name{"file_upload_not_found"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -34,8 +34,8 @@ struct file_upload_queued final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"file_upload_queued"}; static constexpr std::string_view name{"file_upload_queued"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -32,8 +32,8 @@ struct file_upload_removed final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"file_upload_removed"}; static constexpr std::string_view name{"file_upload_removed"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct file_upload_retry final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"file_upload_retry"}; static constexpr std::string_view name{"file_upload_retry"};
std::string api_path; std::string api_path;
api_error error{}; api_error error{};

View File

@ -35,8 +35,8 @@ struct filesystem_item_added final : public i_event {
directory(directory_), directory(directory_),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"filesystem_item_added"}; static constexpr std::string_view name{"filesystem_item_added"};
std::string api_parent; std::string api_parent;
std::string api_path; std::string api_path;

View File

@ -37,8 +37,8 @@ struct filesystem_item_closed final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"filesystem_item_closed"}; static constexpr std::string_view name{"filesystem_item_closed"};
std::string api_path; std::string api_path;
bool changed{}; bool changed{};

View File

@ -35,8 +35,8 @@ struct filesystem_item_evicted final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"filesystem_item_evicted"}; static constexpr std::string_view name{"filesystem_item_evicted"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -39,8 +39,8 @@ struct filesystem_item_handle_closed final : public i_event {
handle(handle_), handle(handle_),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"filesystem_item_handle_closed"}; static constexpr std::string_view name{"filesystem_item_handle_closed"};
std::string api_path; std::string api_path;
bool changed{}; bool changed{};

View File

@ -37,8 +37,8 @@ struct filesystem_item_handle_opened final : public i_event {
handle(handle_), handle(handle_),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"filesystem_item_handle_opened"}; static constexpr std::string_view name{"filesystem_item_handle_opened"};
std::string api_path; std::string api_path;
bool directory{}; bool directory{};

View File

@ -36,8 +36,8 @@ struct filesystem_item_opened final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"filesystem_item_opened"}; static constexpr std::string_view name{"filesystem_item_opened"};
std::string api_path; std::string api_path;
bool directory{}; bool directory{};

View File

@ -32,8 +32,8 @@ struct fuse_args_parsed final : public i_event {
fuse_args_parsed(std::string_view args_, std::string_view function_name_) fuse_args_parsed(std::string_view args_, std::string_view function_name_)
: args(std::move(args_)), function_name(std::string{function_name_}) {} : args(std::move(args_)), function_name(std::string{function_name_}) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"fuse_args_parsed"}; static constexpr std::string_view name{"fuse_args_parsed"};
std::string args; std::string args;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct fuse_event final : public i_event {
error(error_), error(error_),
function_name(std::string{function_name_}) {} function_name(std::string{function_name_}) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"fuse_event"}; static constexpr std::string_view name{"fuse_event"};
std::string api_path; std::string api_path;
std::int32_t error{}; std::int32_t error{};

View File

@ -31,8 +31,8 @@ struct info_log final : public i_event {
info_log(std::string_view function_name_, std::string msg_) info_log(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {} : function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"info_log"}; static constexpr std::string_view name{"info_log"};
std::string function_name; std::string function_name;
std::string msg; std::string msg;

View File

@ -34,8 +34,8 @@ struct invalid_cache_size final : public i_event {
function_name(std::string{function_name_}), function_name(std::string{function_name_}),
invalid_size(invalid_size_) {} invalid_size(invalid_size_) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"invalid_cache_size"}; static constexpr std::string_view name{"invalid_cache_size"};
std::uint64_t cache_size{}; std::uint64_t cache_size{};
std::string function_name; std::string function_name;

View File

@ -32,8 +32,8 @@ struct item_timeout final : public i_event {
: api_path(std::move(api_path_)), : api_path(std::move(api_path_)),
function_name(std::string(function_name_)) {} function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"item_timeout"}; static constexpr std::string_view name{"item_timeout"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct max_cache_size_reached final : public i_event {
function_name(std::string{function_name_}), function_name(std::string{function_name_}),
max_cache_size(max_cache_size_) {} max_cache_size(max_cache_size_) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"max_cache_size_reached"}; static constexpr std::string_view name{"max_cache_size_reached"};
std::uint64_t cache_size{}; std::uint64_t cache_size{};
std::string function_name; std::string function_name;

View File

@ -33,8 +33,8 @@ struct orphaned_file_detected final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"orphaned_file_detected"}; static constexpr std::string_view name{"orphaned_file_detected"};
std::string function_name; std::string function_name;
std::string source_path; std::string source_path;

View File

@ -36,8 +36,8 @@ struct orphaned_file_processing_failed final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{ static constexpr std::string_view name{
"orphaned_file_processing_failed", "orphaned_file_processing_failed",
}; };

View File

@ -33,8 +33,8 @@ struct orphaned_source_file_detected final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"orphaned_source_file_detected"}; static constexpr std::string_view name{"orphaned_source_file_detected"};
std::string function_name; std::string function_name;
std::string source_path; std::string source_path;

View File

@ -33,8 +33,8 @@ struct orphaned_source_file_removed final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"orphaned_source_file_removed"}; static constexpr std::string_view name{"orphaned_source_file_removed"};
std::string function_name; std::string function_name;
std::string source_path; std::string source_path;

View File

@ -34,8 +34,8 @@ struct packet_client_timeout final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
msg(std::move(msg_)) {} msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"packet_client_timeout"}; static constexpr std::string_view name{"packet_client_timeout"};
std::string event_name; std::string event_name;
std::string function_name; std::string function_name;

View File

@ -32,8 +32,8 @@ struct polling_item_begin final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
item_name(std::move(item_name_)) {} item_name(std::move(item_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"polling_item_begin"}; static constexpr std::string_view name{"polling_item_begin"};
std::string function_name; std::string function_name;
std::string item_name; std::string item_name;

View File

@ -32,8 +32,8 @@ struct polling_item_end final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
item_name(std::move(item_name_)) {} item_name(std::move(item_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"polling_item_end"}; static constexpr std::string_view name{"polling_item_end"};
std::string function_name; std::string function_name;
std::string item_name; std::string item_name;

View File

@ -35,8 +35,8 @@ struct provider_invalid_version final : public i_event {
required_version(std::move(required_version_)), required_version(std::move(required_version_)),
returned_version(std::move(returned_version_)) {} returned_version(std::move(returned_version_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"provider_invalid_version"}; static constexpr std::string_view name{"provider_invalid_version"};
std::string function_name; std::string function_name;
std::string required_version; std::string required_version;

View File

@ -34,8 +34,8 @@ struct provider_offline final : public i_event {
host_name_or_ip(std::move(host_name_or_ip_)), host_name_or_ip(std::move(host_name_or_ip_)),
port(port_) {} port(port_) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"provider_offline"}; static constexpr std::string_view name{"provider_offline"};
std::string function_name; std::string function_name;
std::string host_name_or_ip; std::string host_name_or_ip;

View File

@ -34,8 +34,8 @@ struct provider_upload_begin final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"provider_upload_begin"}; static constexpr std::string_view name{"provider_upload_begin"};
std::string api_path; std::string api_path;
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct provider_upload_end final : public i_event {
function_name(std::string(function_name_)), function_name(std::string(function_name_)),
source_path(std::move(source_path_)) {} source_path(std::move(source_path_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"provider_upload_end"}; static constexpr std::string_view name{"provider_upload_end"};
std::string api_path; std::string api_path;
api_error error{}; api_error error{};

View File

@ -35,8 +35,8 @@ struct remote_server_event final : public i_event {
error(error_), error(error_),
function_name(std::string{function_name_}) {} function_name(std::string{function_name_}) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"remote_server_event"}; static constexpr std::string_view name{"remote_server_event"};
std::string api_path; std::string api_path;
packet::error_type error{}; packet::error_type error{};

View File

@ -31,8 +31,8 @@ struct repertory_exception final : public i_event {
repertory_exception(std::string_view function_name_, std::string msg_) repertory_exception(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {} : function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::error}; static constexpr event_level level{event_level::error};
static constexpr const std::string_view name{"repertory_exception"}; static constexpr std::string_view name{"repertory_exception"};
std::string function_name; std::string function_name;
std::string msg; std::string msg;

View File

@ -33,8 +33,8 @@ struct service_start_begin final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
service_name(std::move(service_name_)) {} service_name(std::move(service_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"service_start_begin"}; static constexpr std::string_view name{"service_start_begin"};
std::string function_name; std::string function_name;
std::string service_name; std::string service_name;

View File

@ -32,8 +32,8 @@ struct service_start_end final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
service_name(std::move(service_name_)) {} service_name(std::move(service_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"service_start_end"}; static constexpr std::string_view name{"service_start_end"};
std::string function_name; std::string function_name;
std::string service_name; std::string service_name;

View File

@ -32,8 +32,8 @@ struct service_stop_begin final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
service_name(std::move(service_name_)) {} service_name(std::move(service_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"service_stop_begin"}; static constexpr std::string_view name{"service_stop_begin"};
std::string function_name; std::string function_name;
std::string service_name; std::string service_name;

View File

@ -32,8 +32,8 @@ struct service_stop_end final : public i_event {
: function_name(std::string(function_name_)), : function_name(std::string(function_name_)),
service_name(std::move(service_name_)) {} service_name(std::move(service_name_)) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"service_stop_end"}; static constexpr std::string_view name{"service_stop_end"};
std::string function_name; std::string function_name;
std::string service_name; std::string service_name;

View File

@ -31,8 +31,8 @@ struct trace_log final : public i_event {
trace_log(std::string_view function_name_, std::string msg_) trace_log(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {} : function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::trace}; static constexpr event_level level{event_level::trace};
static constexpr const std::string_view name{"trace_log"}; static constexpr std::string_view name{"trace_log"};
std::string function_name; std::string function_name;
std::string msg; std::string msg;

View File

@ -31,8 +31,8 @@ struct unmount_requested final : public i_event {
unmount_requested(std::string_view function_name_) unmount_requested(std::string_view function_name_)
: function_name(std::string(function_name_)) {} : function_name(std::string(function_name_)) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"unmount_requested"}; static constexpr std::string_view name{"unmount_requested"};
std::string function_name; std::string function_name;

View File

@ -35,8 +35,8 @@ struct unmount_result final : public i_event {
mount_location(std::move(mount_location_)), mount_location(std::move(mount_location_)),
result(result_) {} result(result_) {}
static constexpr const event_level level{event_level::info}; static constexpr event_level level{event_level::info};
static constexpr const std::string_view name{"unmount_result"}; static constexpr std::string_view name{"unmount_result"};
std::string function_name; std::string function_name;
std::string mount_location; std::string mount_location;

View File

@ -31,8 +31,8 @@ struct warn_log final : public i_event {
warn_log(std::string_view function_name_, std::string msg_) warn_log(std::string_view function_name_, std::string msg_)
: function_name(std::string(function_name_)), msg(std::move(msg_)) {} : function_name(std::string(function_name_)), msg(std::move(msg_)) {}
static constexpr const event_level level{event_level::warn}; static constexpr event_level level{event_level::warn};
static constexpr const std::string_view name{"warn_log"}; static constexpr std::string_view name{"warn_log"};
std::string function_name; std::string function_name;
std::string msg; std::string msg;

View File

@ -35,8 +35,8 @@ struct winfsp_event final : public i_event {
error(error_), error(error_),
function_name(std::string{function_name_}) {} function_name(std::string{function_name_}) {}
static constexpr const event_level level{event_level::debug}; static constexpr event_level level{event_level::debug};
static constexpr const std::string_view name{"winfsp_event"}; static constexpr std::string_view name{"winfsp_event"};
std::string api_path; std::string api_path;
NTSTATUS error{}; NTSTATUS error{};

View File

@ -29,7 +29,7 @@ class app_config;
class cache_size_mgr final { class cache_size_mgr final {
private: private:
static constexpr const std::chrono::seconds cache_wait_secs{ static constexpr std::chrono::seconds cache_wait_secs{
5s, 5s,
}; };

View File

@ -40,7 +40,7 @@ class file_manager final : public i_file_manager, public i_upload_manager {
E_CONSUMER(); E_CONSUMER();
private: private:
static constexpr const std::chrono::seconds queue_wait_secs{ static constexpr std::chrono::seconds queue_wait_secs{
5s, 5s,
}; };

View File

@ -48,7 +48,7 @@ public:
-> ring_buffer_base & = delete; -> ring_buffer_base & = delete;
public: public:
static constexpr const auto min_ring_size{5U}; static constexpr auto min_ring_size{5U};
private: private:
boost::dynamic_bitset<> read_state_; boost::dynamic_bitset<> read_state_;

View File

@ -84,6 +84,8 @@ private:
void remove_deleted_files(stop_type &stop_requested); void remove_deleted_files(stop_type &stop_requested);
void remove_expired_files();
public: public:
[[nodiscard]] auto check_version(std::string &required_version, [[nodiscard]] auto check_version(std::string &required_version,
std::string &returned_version) const std::string &returned_version) const

View File

@ -30,8 +30,13 @@ class app_config;
class server { class server {
public: public:
explicit server(app_config &config); explicit server(app_config &config);
server(const server &) = delete;
server(server &&) = delete;
virtual ~server() { stop(); } auto operator=(const server &) -> server & = delete;
auto operator=(server &&) -> server & = delete;
virtual ~server();
private: private:
app_config &config_; app_config &config_;

View File

@ -24,19 +24,20 @@
#include "types/repertory.hpp" #include "types/repertory.hpp"
inline constexpr const auto PACKET_SERVICE_FUSE{1U}; inline constexpr auto PACKET_SERVICE_FUSE{1U};
inline constexpr const auto PACKET_SERVICE_WINFSP{2U}; inline constexpr auto PACKET_SERVICE_WINFSP{2U};
#if defined(_WIN32) #if defined(_WIN32)
inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP}; inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP};
#else // !defined(_WIN32) #else // !defined(_WIN32)
inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE}; inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE};
#endif // defined(_WIN32) #endif // defined(_WIN32)
constexpr const auto default_remote_client_pool_size{20U}; inline constexpr auto default_remote_directory_page_size{std::size_t(100U)};
constexpr const auto default_remote_max_connections{20U}; inline constexpr auto default_remote_client_pool_size{20U};
constexpr const auto default_remote_receive_timeout_ms{120U * 1000U}; inline constexpr auto default_remote_max_connections{20U};
constexpr const auto default_remote_send_timeout_ms{30U * 1000U}; inline constexpr auto default_remote_receive_timeout_ms{120U * 1000U};
inline constexpr auto default_remote_send_timeout_ms{30U * 1000U};
namespace repertory::remote { namespace repertory::remote {
struct remote_config final { struct remote_config final {
@ -217,8 +218,8 @@ struct statfs_x final : public statfs {
#if !defined(_WIN32) #if !defined(_WIN32)
[[nodiscard]] auto create_open_flags(std::uint32_t flags) -> open_flags; [[nodiscard]] auto create_open_flags(std::uint32_t flags) -> open_flags;
[[nodiscard]] auto [[nodiscard]] auto create_os_open_flags(const open_flags &flags)
create_os_open_flags(const open_flags &flags) -> std::uint32_t; -> std::uint32_t;
#endif // !defined(_WIN32) #endif // !defined(_WIN32)
} // namespace repertory::remote } // namespace repertory::remote

View File

@ -23,32 +23,36 @@
#define REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_ #define REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_
namespace repertory { namespace repertory {
constexpr const auto default_api_password_size{48U}; inline constexpr auto default_api_password_size{48U};
constexpr const auto default_download_timeout_secs{30U}; inline constexpr auto default_download_timeout_secs{30U};
constexpr const auto default_eviction_delay_mins{1U}; inline constexpr auto default_eviction_delay_mins{1U};
constexpr const auto default_high_freq_interval_secs{std::uint16_t{30U}}; inline constexpr auto default_high_freq_interval_secs{std::uint16_t{30U}};
constexpr const auto default_low_freq_interval_secs{std::uint16_t(60U * 60U)}; inline constexpr auto default_low_freq_interval_secs{
constexpr const auto default_max_cache_size_bytes{ std::uint16_t(60U * 60U),
};
inline constexpr auto default_max_cache_size_bytes{
std::uint64_t(20ULL * 1024ULL * 1024ULL * 1024ULL), std::uint64_t(20ULL * 1024ULL * 1024ULL * 1024ULL),
}; };
constexpr const auto default_max_upload_count{5U}; inline constexpr auto default_max_upload_count{5U};
constexpr const auto default_med_freq_interval_secs{std::uint16_t{2U * 60U}}; inline constexpr auto default_med_freq_interval_secs{
constexpr const auto default_online_check_retry_secs{60U}; std::uint16_t{2U * 60U},
constexpr const auto default_retry_read_count{6U}; };
constexpr const auto default_ring_buffer_file_size{512U}; inline constexpr auto default_online_check_retry_secs{60U};
constexpr const auto default_task_wait_ms{100U}; inline constexpr auto default_retry_read_count{6U};
constexpr const auto default_timeout_ms{60000U}; inline constexpr auto default_ring_buffer_file_size{512U};
constexpr const auto default_ui_mgmt_port{std::uint16_t{30000U}}; inline constexpr auto default_task_wait_ms{100U};
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)}; inline constexpr auto default_timeout_ms{60000U};
constexpr const auto max_s3_object_name_length{1024U}; inline constexpr auto default_ui_mgmt_port{std::uint16_t{30000U}};
constexpr const auto min_cache_size_bytes{ inline constexpr auto max_ring_buffer_file_size{std::uint16_t(1024U)};
inline constexpr auto max_s3_object_name_length{1024U};
inline constexpr auto min_cache_size_bytes{
std::uint64_t(100ULL * 1024ULL * 1024ULL), std::uint64_t(100ULL * 1024ULL * 1024ULL),
}; };
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)}; inline constexpr auto min_download_timeout_secs{std::uint8_t(5U)};
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)}; inline constexpr auto min_online_check_retry_secs{std::uint16_t(15U)};
constexpr const auto min_retry_read_count{std::uint16_t(2U)}; inline constexpr auto min_retry_read_count{std::uint16_t(2U)};
constexpr const auto min_ring_buffer_file_size{std::uint16_t(64U)}; inline constexpr auto min_ring_buffer_file_size{std::uint16_t(64U)};
constexpr const auto min_task_wait_ms{std::uint16_t(50U)}; inline constexpr auto min_task_wait_ms{std::uint16_t(50U)};
template <typename data_t> class atomic final { template <typename data_t> class atomic final {
public: public:
@ -139,28 +143,28 @@ public:
[[nodiscard]] operator data_t() const { return load(); } [[nodiscard]] operator data_t() const { return load(); }
}; };
inline constexpr const auto max_time{ inline constexpr auto max_time{
std::numeric_limits<std::uint64_t>::max(), std::numeric_limits<std::uint64_t>::max(),
}; };
inline constexpr const std::string META_ACCESSED{"accessed"}; inline constexpr std::string META_ACCESSED{"accessed"};
inline constexpr const std::string META_ATTRIBUTES{"attributes"}; inline constexpr std::string META_ATTRIBUTES{"attributes"};
inline constexpr const std::string META_BACKUP{"backup"}; inline constexpr std::string META_BACKUP{"backup"};
inline constexpr const std::string META_CHANGED{"changed"}; inline constexpr std::string META_CHANGED{"changed"};
inline constexpr const std::string META_CREATION{"creation"}; inline constexpr std::string META_CREATION{"creation"};
inline constexpr const std::string META_DIRECTORY{"directory"}; inline constexpr std::string META_DIRECTORY{"directory"};
inline constexpr const std::string META_GID{"gid"}; inline constexpr std::string META_GID{"gid"};
inline constexpr const std::string META_KEY{"key"}; inline constexpr std::string META_KEY{"key"};
inline constexpr const std::string META_MODE{"mode"}; inline constexpr std::string META_MODE{"mode"};
inline constexpr const std::string META_MODIFIED{"modified"}; inline constexpr std::string META_MODIFIED{"modified"};
inline constexpr const std::string META_OSXFLAGS{"flags"}; inline constexpr std::string META_OSXFLAGS{"flags"};
inline constexpr const std::string META_PINNED{"pinned"}; inline constexpr std::string META_PINNED{"pinned"};
inline constexpr const std::string META_SIZE{"size"}; inline constexpr std::string META_SIZE{"size"};
inline constexpr const std::string META_SOURCE{"source"}; inline constexpr std::string META_SOURCE{"source"};
inline constexpr const std::string META_UID{"uid"}; inline constexpr std::string META_UID{"uid"};
inline constexpr const std::string META_WRITTEN{"written"}; inline constexpr std::string META_WRITTEN{"written"};
inline constexpr const std::array<std::string, 16U> META_USED_NAMES = { inline constexpr std::array<std::string, 16U> META_USED_NAMES = {
META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED, META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED,
META_CREATION, META_DIRECTORY, META_GID, META_KEY, META_CREATION, META_DIRECTORY, META_GID, META_KEY,
META_MODE, META_MODIFIED, META_OSXFLAGS, META_PINNED, META_MODE, META_MODIFIED, META_OSXFLAGS, META_PINNED,
@ -283,11 +287,13 @@ enum class exit_code : std::int32_t {
init_failed = -18, init_failed = -18,
ui_mount_failed = -19, ui_mount_failed = -19,
exception = -20, exception = -20,
provider_offline = -21
}; };
enum http_error_codes : std::int32_t { enum http_error_codes : std::int32_t {
ok = 200, ok = 200,
multiple_choices = 300, multiple_choices = 300,
bad_request = 400,
unauthorized = 401, unauthorized = 401,
not_found = 404, not_found = 404,
internal_error = 500, internal_error = 500,
@ -465,66 +471,58 @@ using api_item_added_callback = std::function<api_error(bool, api_file &)>;
using directory_item_list = std::vector<directory_item>; using directory_item_list = std::vector<directory_item>;
using meta_provider_callback = std::function<void(directory_item &)>; using meta_provider_callback = std::function<void(directory_item &)>;
inline constexpr const auto JSON_ACCESS_KEY{"AccessKey"}; inline constexpr auto JSON_ACCESS_KEY{"AccessKey"};
inline constexpr const auto JSON_AGENT_STRING{"AgentString"}; inline constexpr auto JSON_AGENT_STRING{"AgentString"};
inline constexpr const auto JSON_API_PARENT{"ApiParent"}; inline constexpr auto JSON_API_PARENT{"ApiParent"};
inline constexpr const auto JSON_API_PASSWORD{"ApiPassword"}; inline constexpr auto JSON_API_PASSWORD{"ApiPassword"};
inline constexpr const auto JSON_API_PATH{"ApiPath"}; inline constexpr auto JSON_API_PATH{"ApiPath"};
inline constexpr const auto JSON_API_PORT{"ApiPort"}; inline constexpr auto JSON_API_PORT{"ApiPort"};
inline constexpr const auto JSON_API_USER{"ApiUser"}; inline constexpr auto JSON_API_USER{"ApiUser"};
inline constexpr const auto JSON_BUCKET{"Bucket"}; inline constexpr auto JSON_BUCKET{"Bucket"};
inline constexpr const auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"}; inline constexpr auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"};
inline constexpr const auto JSON_DATABASE_TYPE{"DatabaseType"}; inline constexpr auto JSON_DATABASE_TYPE{"DatabaseType"};
inline constexpr const auto JSON_DIRECTORY{"Directory"}; inline constexpr auto JSON_DIRECTORY{"Directory"};
inline constexpr const auto JSON_DOWNLOAD_TIMEOUT_SECS{ inline constexpr auto JSON_DOWNLOAD_TIMEOUT_SECS{"DownloadTimeoutSeconds"};
"DownloadTimeoutSeconds"}; inline constexpr auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"};
inline constexpr const auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"}; inline constexpr auto JSON_ENABLE_DOWNLOAD_TIMEOUT{"EnableDownloadTimeout"};
inline constexpr const auto JSON_ENABLE_DOWNLOAD_TIMEOUT{ inline constexpr auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"};
"EnableDownloadTimeout"}; inline constexpr auto JSON_ENABLE_REMOTE_MOUNT{"Enable"};
inline constexpr const auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"}; inline constexpr auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"};
inline constexpr const auto JSON_ENABLE_REMOTE_MOUNT{"Enable"}; inline constexpr auto JSON_ENCRYPT_CONFIG{"EncryptConfig"};
inline constexpr const auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"}; inline constexpr auto JSON_EVENT_LEVEL{"EventLevel"};
inline constexpr const auto JSON_ENCRYPT_CONFIG{"EncryptConfig"}; inline constexpr auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"};
inline constexpr const auto JSON_EVENT_LEVEL{"EventLevel"}; inline constexpr auto JSON_EVICTION_USE_ACCESS_TIME{"EvictionUseAccessedTime"};
inline constexpr const auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"}; inline constexpr auto JSON_HIGH_FREQ_INTERVAL_SECS{"HighFreqIntervalSeconds"};
inline constexpr const auto JSON_EVICTION_USE_ACCESS_TIME{ inline constexpr auto JSON_HOST_CONFIG{"HostConfig"};
"EvictionUseAccessedTime"}; inline constexpr auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"};
inline constexpr const auto JSON_HIGH_FREQ_INTERVAL_SECS{ inline constexpr auto JSON_LOW_FREQ_INTERVAL_SECS{"LowFreqIntervalSeconds"};
"HighFreqIntervalSeconds"}; inline constexpr auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"};
inline constexpr const auto JSON_HOST_CONFIG{"HostConfig"}; inline constexpr auto JSON_MAX_CONNECTIONS{"MaxConnections"};
inline constexpr const auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"}; inline constexpr auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"};
inline constexpr const auto JSON_LOW_FREQ_INTERVAL_SECS{ inline constexpr auto JSON_MED_FREQ_INTERVAL_SECS{"MedFreqIntervalSeconds"};
"LowFreqIntervalSeconds"}; inline constexpr auto JSON_META{"Meta"};
inline constexpr const auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"}; inline constexpr auto JSON_MOUNT_LOCATIONS{"MountLocations"};
inline constexpr const auto JSON_MAX_CONNECTIONS{"MaxConnections"}; inline constexpr auto JSON_ONLINE_CHECK_RETRY_SECS{"OnlineCheckRetrySeconds"};
inline constexpr const auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"}; inline constexpr auto JSON_PATH{"Path"};
inline constexpr const auto JSON_MED_FREQ_INTERVAL_SECS{ inline constexpr auto JSON_PREFERRED_DOWNLOAD_TYPE{"PreferredDownloadType"};
"MedFreqIntervalSeconds"}; inline constexpr auto JSON_PROTOCOL{"Protocol"};
inline constexpr const auto JSON_META{"Meta"}; inline constexpr auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"};
inline constexpr const auto JSON_MOUNT_LOCATIONS{"MountLocations"}; inline constexpr auto JSON_REGION{"Region"};
inline constexpr const auto JSON_ONLINE_CHECK_RETRY_SECS{ inline constexpr auto JSON_REMOTE_CONFIG{"RemoteConfig"};
"OnlineCheckRetrySeconds"}; inline constexpr auto JSON_REMOTE_MOUNT{"RemoteMount"};
inline constexpr const auto JSON_PATH{"Path"}; inline constexpr auto JSON_RETRY_READ_COUNT{"RetryReadCount"};
inline constexpr const auto JSON_PREFERRED_DOWNLOAD_TYPE{ inline constexpr auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"};
"PreferredDownloadType"}; inline constexpr auto JSON_S3_CONFIG{"S3Config"};
inline constexpr const auto JSON_PROTOCOL{"Protocol"}; inline constexpr auto JSON_SECRET_KEY{"SecretKey"};
inline constexpr const auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"}; inline constexpr auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"};
inline constexpr const auto JSON_REGION{"Region"}; inline constexpr auto JSON_SIA_CONFIG{"SiaConfig"};
inline constexpr const auto JSON_REMOTE_CONFIG{"RemoteConfig"}; inline constexpr auto JSON_SIZE{"Size"};
inline constexpr const auto JSON_REMOTE_MOUNT{"RemoteMount"}; inline constexpr auto JSON_TASK_WAIT_MS{"TaskWaitMs"};
inline constexpr const auto JSON_RETRY_READ_COUNT{"RetryReadCount"}; inline constexpr auto JSON_TIMEOUT_MS{"TimeoutMs"};
inline constexpr const auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"}; inline constexpr auto JSON_URL{"URL"};
inline constexpr const auto JSON_S3_CONFIG{"S3Config"}; inline constexpr auto JSON_USE_PATH_STYLE{"UsePathStyle"};
inline constexpr const auto JSON_SECRET_KEY{"SecretKey"}; inline constexpr auto JSON_USE_REGION_IN_URL{"UseRegionInURL"};
inline constexpr const auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"}; inline constexpr auto JSON_VERSION{"Version"};
inline constexpr const auto JSON_SIA_CONFIG{"SiaConfig"};
inline constexpr const auto JSON_SIZE{"Size"};
inline constexpr const auto JSON_TASK_WAIT_MS{"TaskWaitMs"};
inline constexpr const auto JSON_TIMEOUT_MS{"TimeoutMs"};
inline constexpr const auto JSON_URL{"URL"};
inline constexpr const auto JSON_USE_PATH_STYLE{"UsePathStyle"};
inline constexpr const auto JSON_USE_REGION_IN_URL{"UseRegionInURL"};
inline constexpr const auto JSON_VERSION{"Version"};
} // namespace repertory } // namespace repertory
NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_JSON_NAMESPACE_BEGIN

View File

@ -50,15 +50,15 @@ using list_objects_result = std::vector<directory_item>;
struct head_object_result { struct head_object_result {
std::uint64_t content_length{}; std::uint64_t content_length{};
std::string content_type{}; std::string content_type;
std::uint64_t last_modified{}; std::uint64_t last_modified;
inline auto from_headers(http_headers headers) -> head_object_result & { auto from_headers(http_headers headers) -> head_object_result & {
content_length = utils::string::to_uint64(headers["content-length"]); content_length = utils::string::to_uint64(headers["content-length"]);
content_type = headers["content-type"]; content_type = headers["content-type"];
auto date = headers["last-modified"]; auto date = headers["last-modified"];
if (not date.empty()) { if (not date.empty()) {
struct tm tm1 {}; struct tm tm1{};
// Mon, 17 Dec 2012 02:14:10 GMT // Mon, 17 Dec 2012 02:14:10 GMT
#if defined(_WIN32) #if defined(_WIN32)
utils::time::strptime(date.c_str(), "%a, %d %b %Y %H:%M:%S %Z", &tm1); utils::time::strptime(date.c_str(), "%a, %d %b %Y %H:%M:%S %Z", &tm1);

View File

@ -28,35 +28,36 @@ namespace repertory::utils::cli {
using option = std::array<std::string, 2>; using option = std::array<std::string, 2>;
namespace options { namespace options {
static const option check_version_option = {"-cv", "--check_version"}; inline const option check_version_option = {"-cv", "--check_version"};
static const option display_config_option = {"-dc", "--display_config"}; inline const option display_config_option = {"-dc", "--display_config"};
static const option data_directory_option = {"-dd", "--data_directory"}; inline const option data_directory_option = {"-dd", "--data_directory"};
static const option encrypt_option = {"-en", "--encrypt"}; inline const option encrypt_option = {"-en", "--encrypt"};
static const option drive_information_option = {"-di", "--drive_information"}; inline const option drive_information_option = {"-di", "--drive_information"};
static const option name_option = {"-na", "--name"}; inline const option name_option = {"-na", "--name"};
static const option s3_option = {"-s3", "--s3"}; inline const option s3_option = {"-s3", "--s3"};
static const option generate_config_option = {"-gc", "--generate_config"}; inline const option generate_config_option = {"-gc", "--generate_config"};
static const option get_option = {"-get", "--get"}; inline const option get_option = {"-get", "--get"};
static const option get_directory_items_option = {"-gdi", inline const option get_directory_items_option = {"-gdi",
"--get_directory_items"}; "--get_directory_items"};
static const option get_pinned_files_option = {"-gpf", "--get_pinned_files"}; inline const option get_pinned_files_option = {"-gpf", "--get_pinned_files"};
static const option help_option = {"-h", "--help"}; inline const option help_option = {"-h", "--help"};
static const option hidden_option = {"-hidden", "--hidden"}; inline const option hidden_option = {"-hidden", "--hidden"};
static const option open_files_option = {"-of", "--open_files"}; inline const option open_files_option = {"-of", "--open_files"};
static const option pin_file_option = {"-pf", "--pin_file"}; inline const option pin_file_option = {"-pf", "--pin_file"};
static const option pinned_status_option = {"-ps", "--pinned_status"}; inline const option pinned_status_option = {"-ps", "--pinned_status"};
static const option password_option = {"-pw", "--password"}; inline const option password_option = {"-pw", "--password"};
static const option remote_mount_option = {"-rm", "--remote_mount"}; inline const option remote_mount_option = {"-rm", "--remote_mount"};
static const option set_option = {"-set", "--set"}; inline const option set_option = {"-set", "--set"};
static const option status_option = {"-status", "--status"}; inline const option status_option = {"-status", "--status"};
static const option ui_option = {"-ui", "--ui"}; inline const option test_option = {"-test", "--test"};
static const option ui_port_option = {"-up", "--ui_port"}; inline const option ui_option = {"-ui", "--ui"};
static const option unmount_option = {"-unmount", "--unmount"}; inline const option ui_port_option = {"-up", "--ui_port"};
static const option unpin_file_option = {"-uf", "--unpin_file"}; inline const option unmount_option = {"-unmount", "--unmount"};
static const option user_option = {"-us", "--user"}; inline const option unpin_file_option = {"-uf", "--unpin_file"};
static const option version_option = {"-V", "--version"}; inline const option user_option = {"-us", "--user"};
inline const option version_option = {"-V", "--version"};
static const std::vector<option> option_list = { inline const std::vector<option> option_list = {
check_version_option, check_version_option,
display_config_option, display_config_option,
data_directory_option, data_directory_option,
@ -77,6 +78,7 @@ static const std::vector<option> option_list = {
remote_mount_option, remote_mount_option,
set_option, set_option,
status_option, status_option,
test_option,
ui_option, ui_option,
ui_port_option, ui_port_option,
unmount_option, unmount_option,

View File

@ -62,8 +62,8 @@ curl_comm::curl_comm(s3_config cfg)
auto curl_comm::construct_url(CURL *curl, const std::string &relative_path, auto curl_comm::construct_url(CURL *curl, const std::string &relative_path,
const host_config &cfg) -> std::string { const host_config &cfg) -> std::string {
static constexpr const auto http = 80U; static constexpr auto http{80U};
static constexpr const auto https = 443U; static constexpr auto https{443U};
auto custom_port = (((cfg.protocol == "http") && auto custom_port = (((cfg.protocol == "http") &&
(cfg.api_port == http || cfg.api_port == 0U)) || (cfg.api_port == http || cfg.api_port == 0U)) ||
@ -102,8 +102,7 @@ auto curl_comm::reset_curl(CURL *curl_handle) -> CURL * {
return curl_handle; return curl_handle;
} }
auto curl_comm::create_host_config(const s3_config &cfg, bool use_s3_path_style) auto curl_comm::create_host_config(const s3_config &cfg) -> host_config {
-> host_config {
host_config host_cfg{}; host_config host_cfg{};
host_cfg.api_password = cfg.secret_key; host_cfg.api_password = cfg.secret_key;
host_cfg.api_user = cfg.access_key; host_cfg.api_user = cfg.access_key;
@ -118,70 +117,61 @@ auto curl_comm::create_host_config(const s3_config &cfg, bool use_s3_path_style)
} }
} }
if (not use_s3_path_style) { if (not cfg.use_path_style) {
host_cfg.host_name_or_ip = cfg.bucket + '.' + host_cfg.host_name_or_ip; host_cfg.host_name_or_ip = cfg.bucket + '.' + host_cfg.host_name_or_ip;
} }
host_cfg.protocol = cfg.url.substr(0U, pos); host_cfg.protocol = cfg.url.substr(0U, pos);
if (use_s3_path_style) { if (cfg.use_path_style) {
host_cfg.path = '/' + cfg.bucket; host_cfg.path = '/' + cfg.bucket;
} }
return host_cfg; return host_cfg;
} }
void curl_comm::enable_s3_path_style(bool enable) {
use_s3_path_style_ = enable;
}
auto curl_comm::make_request(const curl::requests::http_delete &del, auto curl_comm::make_request(const curl::requests::http_delete &del,
long &response_code, long &response_code,
stop_type &stop_requested) const -> bool { stop_type &stop_requested) const -> bool {
return make_request( return make_request(s3_config_.has_value()
s3_config_.has_value() ? create_host_config(s3_config_.value())
? create_host_config(s3_config_.value(), use_s3_path_style_) : host_config_.value_or(host_config{}),
: host_config_.value_or(host_config{}), del, response_code, stop_requested);
del, response_code, stop_requested);
} }
auto curl_comm::make_request(const curl::requests::http_get &get, auto curl_comm::make_request(const curl::requests::http_get &get,
long &response_code, long &response_code,
stop_type &stop_requested) const -> bool { stop_type &stop_requested) const -> bool {
return make_request( return make_request(s3_config_.has_value()
s3_config_.has_value() ? create_host_config(s3_config_.value())
? create_host_config(s3_config_.value(), use_s3_path_style_) : host_config_.value_or(host_config{}),
: host_config_.value_or(host_config{}), get, response_code, stop_requested);
get, response_code, stop_requested);
} }
auto curl_comm::make_request(const curl::requests::http_head &head, auto curl_comm::make_request(const curl::requests::http_head &head,
long &response_code, long &response_code,
stop_type &stop_requested) const -> bool { stop_type &stop_requested) const -> bool {
return make_request( return make_request(s3_config_.has_value()
s3_config_.has_value() ? create_host_config(s3_config_.value())
? create_host_config(s3_config_.value(), use_s3_path_style_) : host_config_.value_or(host_config{}),
: host_config_.value_or(host_config{}), head, response_code, stop_requested);
head, response_code, stop_requested);
} }
auto curl_comm::make_request(const curl::requests::http_post &post, auto curl_comm::make_request(const curl::requests::http_post &post,
long &response_code, long &response_code,
stop_type &stop_requested) const -> bool { stop_type &stop_requested) const -> bool {
return make_request( return make_request(s3_config_.has_value()
s3_config_.has_value() ? create_host_config(s3_config_.value())
? create_host_config(s3_config_.value(), use_s3_path_style_) : host_config_.value_or(host_config{}),
: host_config_.value_or(host_config{}), post, response_code, stop_requested);
post, response_code, stop_requested);
} }
auto curl_comm::make_request(const curl::requests::http_put_file &put_file, auto curl_comm::make_request(const curl::requests::http_put_file &put_file,
long &response_code, long &response_code,
stop_type &stop_requested) const -> bool { stop_type &stop_requested) const -> bool {
return make_request( return make_request(s3_config_.has_value()
s3_config_.has_value() ? create_host_config(s3_config_.value())
? create_host_config(s3_config_.value(), use_s3_path_style_) : host_config_.value_or(host_config{}),
: host_config_.value_or(host_config{}), put_file, response_code, stop_requested);
put_file, response_code, stop_requested);
} }
auto curl_comm::url_encode(CURL *curl, const std::string &data, auto curl_comm::url_encode(CURL *curl, const std::string &data,

View File

@ -39,7 +39,7 @@ multi_request::~multi_request() {
} }
void multi_request::get_result(CURLcode &curl_code, long &http_code) { void multi_request::get_result(CURLcode &curl_code, long &http_code) {
static constexpr const auto timeout_ms = 100; static constexpr auto timeout_ms{100};
curl_code = CURLcode::CURLE_ABORTED_BY_CALLBACK; curl_code = CURLcode::CURLE_ABORTED_BY_CALLBACK;
http_code = -1; http_code = -1;

View File

@ -173,7 +173,7 @@ auto packet_client::send(std::string_view method, packet &request,
request.encode_top(PACKET_SERVICE_FLAGS); request.encode_top(PACKET_SERVICE_FLAGS);
request.encode_top(std::string{project_get_version()}); request.encode_top(std::string{project_get_version()});
static constexpr const std::uint8_t max_attempts{5U}; static constexpr std::uint8_t max_attempts{5U};
for (std::uint8_t i = 1U; for (std::uint8_t i = 1U;
allow_connections_ && not success && (i <= max_attempts); i++) { allow_connections_ && not success && (i <= max_attempts); i++) {
auto current_client = get_client(); auto current_client = get_client();

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)

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