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) {