清理旧数据操作无效问题修复
This commit is contained in:
1 parent
7296b3096a
commit
c451a077b2
7 files changed
+84
-48
No files matched your search
@@ -6,6 +6,7 @@
|
||||
#define SEADISK_SETTING_HPP
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <tl/expected.hpp>
|
||||
|
||||
namespace seafile::fs
|
||||
{
|
||||
@@ -18,6 +19,10 @@ namespace seafile::fs
|
||||
std::string mount_label;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT(Setting, server, user, password, mount_point, mount_label);
|
||||
|
||||
static auto load(const std::string& path) -> tl::expected<Setting, std::exception>;
|
||||
|
||||
static auto load(const std::filesystem::path& path) -> tl::expected<Setting, std::exception>;
|
||||
};
|
||||
}
|
||||
#endif //SEADISK_SETTING_HPP
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Created by Shell on 2026/7/30.
|
||||
//
|
||||
|
||||
#ifndef SEADISK_UNITS_HPP
|
||||
#define SEADISK_UNITS_HPP
|
||||
#include <cstddef>
|
||||
|
||||
namespace seafile::literals {
|
||||
constexpr std::size_t operator"" _B(unsigned long long v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
constexpr std::size_t operator"" _KB(unsigned long long v) {
|
||||
return v * 1024ULL;
|
||||
}
|
||||
|
||||
constexpr std::size_t operator"" _MB(unsigned long long v) {
|
||||
return v * 1024ULL * 1024ULL;
|
||||
}
|
||||
|
||||
constexpr std::size_t operator"" _GB(unsigned long long v) {
|
||||
return v * 1024ULL * 1024ULL * 1024ULL;
|
||||
}
|
||||
}
|
||||
#endif //SEADISK_UNITS_HPP
|
||||
Reference in new issue
Block a user