初步实现功能

This commit is contained in:
shell committed 2026-07-30 03:08:08 +08:00
1 parent f23c6a3fbb
commit f0b6efb126
15 files changed
+783 -708

No files matched your search

+11 -15
View File
@@ -4,38 +4,34 @@
#ifndef SEADISK_SEAFILE_FILE_SYSTEM_HPP
#define SEADISK_SEAFILE_FILE_SYSTEM_HPP
#include <memory>
#include <string>
#include <winfsp/winfsp.h>
#include "seafile/api/seafile_api.hpp"
#include "seafile/api/token_type.hpp"
#include "seafile/api/cached_seafile_api.hpp"
#include "seafile/cache/cache.hpp"
#include "seafile/fs/seafile_store.hpp"
#include "seafile/fs/storage/repo_entry.hpp"
#include "seafile/fs/storage/repo_info.hpp"
namespace seafile::fs
{
class SeafileFileSystem final
{
using SeafileException = api::SeafileException;
using TokenType = api::TokenType;
using ISeaFileApi = api::ISeaFileApi;
using RepoEntry = api::RepoEntry;
using RepoInfo = storage::RepoInfo;
using RepoEntry = storage::RepoEntry;
std::string repo_id;
std::shared_ptr<ISeaFileApi> api;
std::unique_ptr<SeafileStore> store;
std::wstring volume_label;
public:
explicit SeafileFileSystem(const std::string& server,
const std::wstring& volume_label) : volume_label(volume_label)
explicit SeafileFileSystem(std::unique_ptr<SeafileStore> store,
const std::wstring& volume_label)
: store(std::move(store)), volume_label(volume_label)
{
this->api = std::make_shared<api::CachedSeafileApi>(
std::make_shared<api::SeaFileApi>(server)
);
}
tl::expected<void, SeafileException> initialize(const std::string& username, const std::string& password);
tl::expected<void, SeafileException> initialize();
SeafileFileSystem(const SeafileFileSystem&) = delete;