From ff5917ffbdfaf4a8213a7f88f58e705de7cff61b Mon Sep 17 00:00:00 2001 From: shell Date: Sun, 2 Aug 2026 21:31:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/seafile/fs/seafile_store.hpp | 5 +++-- include/seafile/literals/units.hpp | 9 ++++----- src/seafile/fs/seafile_store.cpp | 6 ++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/include/seafile/fs/seafile_store.hpp b/include/seafile/fs/seafile_store.hpp index ae20b86..bdc7816 100644 --- a/include/seafile/fs/seafile_store.hpp +++ b/include/seafile/fs/seafile_store.hpp @@ -65,7 +65,7 @@ namespace seafile::fs [[nodiscard]] tl::expected accountInfo() const; /// 同步用户信息 - [[nodiscard]] tl::expected syncUserInfo(); + [[nodiscard]] tl::expected syncUserInfo() const; /// 同步repo信息 [[nodiscard]] tl::expected, api::SeafileException> syncRepos(); @@ -76,6 +76,7 @@ namespace seafile::fs static std::filesystem::path storePath(); /// 获取路径信息 + /// @param repo_id repo id /// @param path 路径 /// @return 路径信息 tl::expected findRepoEntry( @@ -85,7 +86,7 @@ namespace seafile::fs tl::expected findRepoByName(const std::string& name); tl::expected fetchAndStoreRepoDir( - const std::string& repo_id, const std::string& parent_path); + const std::string& repo_id, const std::string& parent_path) const; std::vector queryDirectoryChildren( const std::string& repo_id, const std::string& parent_path); diff --git a/include/seafile/literals/units.hpp b/include/seafile/literals/units.hpp index ebb6acf..a51df13 100644 --- a/include/seafile/literals/units.hpp +++ b/include/seafile/literals/units.hpp @@ -4,22 +4,21 @@ #ifndef SEADISK_UNITS_HPP #define SEADISK_UNITS_HPP -#include namespace seafile::literals { - constexpr std::size_t operator"" _B(unsigned long long v) { + constexpr std::size_t operator ""_B(unsigned long long v) { return v; } - constexpr std::size_t operator"" _KB(unsigned long long v) { + constexpr std::size_t operator ""_KB(unsigned long long v) { return v * 1024ULL; } - constexpr std::size_t operator"" _MB(unsigned long long v) { + constexpr std::size_t operator ""_MB(unsigned long long v) { return v * 1024ULL * 1024ULL; } - constexpr std::size_t operator"" _GB(unsigned long long v) { + constexpr std::size_t operator ""_GB(unsigned long long v) { return v * 1024ULL * 1024ULL * 1024ULL; } } diff --git a/src/seafile/fs/seafile_store.cpp b/src/seafile/fs/seafile_store.cpp index 1409ca4..f07af0d 100644 --- a/src/seafile/fs/seafile_store.cpp +++ b/src/seafile/fs/seafile_store.cpp @@ -301,8 +301,7 @@ namespace seafile::fs return this->sync(); } - tl::expected SeafileStore::syncUserInfo() - { + tl::expected SeafileStore::syncUserInfo() const { const auto user_info = this->api.accountInfo(); if (!user_info) { @@ -388,8 +387,7 @@ namespace seafile::fs } tl::expected SeafileStore::fetchAndStoreRepoDir( - const std::string& repo_id, const std::string& parent_path) - { + const std::string& repo_id, const std::string& parent_path) const { const auto entries = this->api.repoDir(repo_id, parent_path); if (!entries) {