初步实现
This commit is contained in:
1 parent
aace751d01
commit
6e60886fd3
8 files changed
+451
-120
No files matched your search
@@ -9,9 +9,12 @@
|
||||
|
||||
#include "seafile/seafile_api.hpp"
|
||||
#include "seafile/token_type.hpp"
|
||||
#include "seafile/fs/file_context.hpp"
|
||||
|
||||
namespace seafile::fs {
|
||||
class SeafileFileSystem final {
|
||||
namespace seafile::fs
|
||||
{
|
||||
class SeafileFileSystem final
|
||||
{
|
||||
std::string repo_id;
|
||||
std::string token;
|
||||
TokenType token_type = TokenType::TOKEN;
|
||||
@@ -19,47 +22,61 @@ namespace seafile::fs {
|
||||
std::wstring mount_point;
|
||||
|
||||
public:
|
||||
explicit SeafileFileSystem(const std::string &server,
|
||||
const std::wstring &mount_point) : api(server), mount_point(mount_point) {
|
||||
explicit SeafileFileSystem(const std::string& server,
|
||||
const std::wstring& mount_point) : api(server), mount_point(mount_point)
|
||||
{
|
||||
}
|
||||
|
||||
void auth(const std::string &username, const std::string &password);
|
||||
void auth(const std::string& username, const std::string& password);
|
||||
|
||||
SeafileFileSystem(const SeafileFileSystem &) = delete;
|
||||
SeafileFileSystem(const SeafileFileSystem&) = delete;
|
||||
|
||||
SeafileFileSystem(SeafileFileSystem &&) = delete;
|
||||
SeafileFileSystem(SeafileFileSystem&&) = delete;
|
||||
|
||||
SeafileFileSystem &operator=(const SeafileFileSystem &) = delete;
|
||||
SeafileFileSystem& operator=(const SeafileFileSystem&) = delete;
|
||||
|
||||
SeafileFileSystem &operator=(SeafileFileSystem &&) = delete;
|
||||
SeafileFileSystem& operator=(SeafileFileSystem&&) = delete;
|
||||
|
||||
NTSTATUS GetVolumeInfo(FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||
NTSTATUS GetVolumeInfo(FSP_FSCTL_VOLUME_INFO* VolumeInfo);
|
||||
|
||||
NTSTATUS SetVolumeLabel_(PWSTR VolumeLabel,
|
||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||
FSP_FSCTL_VOLUME_INFO* VolumeInfo);
|
||||
|
||||
NTSTATUS GetSecurityByName(PWSTR FileName,
|
||||
PUINT32 PFileAttributes,
|
||||
PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||
SIZE_T *PSecurityDescriptorSize);
|
||||
SIZE_T* PSecurityDescriptorSize);
|
||||
|
||||
NTSTATUS Create(PWSTR FileName, UINT32 CreateOptions,
|
||||
UINT32 GrantedAccess, UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||
UINT64 AllocationSize, PVOID* PFileContext, FSP_FSCTL_FILE_INFO* FileInfo);
|
||||
|
||||
NTSTATUS Open(
|
||||
PWSTR FileName,
|
||||
UINT32 CreateOptions,
|
||||
UINT32 GrantedAccess,
|
||||
PVOID *PFileContext,
|
||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||
PVOID* PFileContext,
|
||||
FSP_FSCTL_FILE_INFO* FileInfo);
|
||||
|
||||
NTSTATUS Read(PVOID FileContext, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||
PULONG PBytesTransferred);
|
||||
|
||||
NTSTATUS GetFileInfo(HANDLE Handle, FSP_FSCTL_FILE_INFO *FileInfo);
|
||||
NTSTATUS GetFileInfo(HANDLE Handle, FSP_FSCTL_FILE_INFO* FileInfo);
|
||||
|
||||
|
||||
VOID Close(PVOID FileContext0);
|
||||
|
||||
NTSTATUS ReadDirectory(PVOID FileContext0, PWSTR Pattern, PWSTR Marker,
|
||||
VOID Cleanup(PVOID FileContext, PWSTR FileName, ULONG Flags);
|
||||
|
||||
NTSTATUS Overwrite(
|
||||
PVOID FileContext, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes, UINT64 AllocationSize,
|
||||
FSP_FSCTL_FILE_INFO* FileInfo);
|
||||
|
||||
NTSTATUS ReadDirectory(PVOID FileContext, PWSTR Pattern, PWSTR Marker,
|
||||
PVOID Buffer, ULONG BufferLength, PULONG PBytesTransferred);
|
||||
|
||||
NTSTATUS GetDirInfoByName(PVOID FileContext, PWSTR FileName,
|
||||
FSP_FSCTL_DIR_INFO* DirInfo);
|
||||
};
|
||||
}
|
||||
#endif //SEADISK_SEAFILE_FILE_SYSTEM_HPP
|
||||
Reference in new issue
Block a user