Compare commits
218 Commits
v2.0.6-rel
...
11c1029e26
Author | SHA1 | Date | |
---|---|---|---|
11c1029e26 | |||
ab8b74eec3 | |||
5397d3d780 | |||
3079ad977e | |||
92d914a2d5 | |||
6fd9d15c81 | |||
9fdc0c172d | |||
051e9e1130 | |||
8d2c6b77b8 | |||
db46aa43ac | |||
aac056237d | |||
2a7013331f | |||
cf74c43432 | |||
759d464c48 | |||
7a4b08d69e | |||
23f2f35170 | |||
280a8123ec | |||
f3081f3930 | |||
b7d2ac3304 | |||
26358b1e67 | |||
feeef3a044 | |||
e013cbbdbb | |||
7c8b44bf69 | |||
f7b829f71c | |||
412e03898d | |||
c1c5c3f0f1 | |||
47f5b82b4e | |||
ebee5ec857 | |||
bfe7b8915d | |||
8547fb7d43 | |||
4f2ff33226 | |||
600b658109 | |||
374eb67f6b | |||
7848dcebe4 | |||
a34443ed94 | |||
ff985e724d | |||
1ee478ca71 | |||
807a6e90f8 | |||
694d4d4662 | |||
ebdc4877a8 | |||
993356dec6 | |||
dea69815ef | |||
5da7b6a51a | |||
ad5a1cd5ff | |||
33e9208190 | |||
3d25364540 | |||
b00d219f34 | |||
f1a0b6add1 | |||
3b4767290b | |||
eb26f59059 | |||
efcb319d8c | |||
52e7f675fc | |||
78e9c95054 | |||
8fa3ccf97c | |||
1311d665b5 | |||
62e45894b8 | |||
094aec0afb | |||
3b46a48078 | |||
8c53a07d64 | |||
03485935b7 | |||
4b3582cbb0 | |||
8272ec2f8a | |||
7309ca477a | |||
e8ef11cef4 | |||
80b77daa8a | |||
cb75efd96f | |||
631a1bc914 | |||
5064ec3f9a | |||
7c072f98dd | |||
d732bfb224 | |||
4241adb4d3 | |||
e1c35624f6 | |||
9b75618fb3 | |||
6464c01d8b | |||
58db36d628 | |||
f39c6550f2 | |||
400c97cebd | |||
a2ad258b7c | |||
c4b4fe83fb | |||
262fccf9a6 | |||
50898488f0 | |||
1acb3311b1 | |||
3fd3f85cc9 | |||
cbbd586347 | |||
57a591c51e | |||
29fb395758 | |||
b3f87e2828 | |||
7e06f810ea | |||
02e568b77a | |||
8b2bafc9f3 | |||
97e5f17049 | |||
124dc62250 | |||
5da4d4e940 | |||
b507643d23 | |||
1e25fb57f1 | |||
4d8e59f97f | |||
881778e485 | |||
3efb2b817f | |||
21d02534e5 | |||
1b11e500f3 | |||
f57bbdbb50 | |||
1c65f51ef4 | |||
f44bb6bcfc | |||
57d9884510 | |||
5da036e979 | |||
daa8b9df24 | |||
fe2a1b96b2 | |||
be678e8f9c | |||
b5ae3e4ed1 | |||
89a2d5866a | |||
5264d17ae8 | |||
1718464c60 | |||
85756ddd8c | |||
e8240948b7 | |||
77088e6608 | |||
ddbebef850 | |||
7cf636b8ed | |||
754dfc49db | |||
63b2d0e741 | |||
96ac72ae21 | |||
0bbf6b5942 | |||
74ef36956d | |||
bbe065819c | |||
3493054f1a | |||
743281497c | |||
eaa6a6f92e | |||
a25dd8178e | |||
71463bfee4 | |||
270df62dbe | |||
5bd7ded7d9 | |||
b5048a422f | |||
c27528fe73 | |||
c3978562d5 | |||
637892cff1 | |||
998a3d9d83 | |||
8ed8822625 | |||
196abaebcc | |||
653e8000ff | |||
ea362211aa | |||
a4a9d069d3 | |||
9cb7f9accf | |||
4e5454efb5 | |||
a8c3f31298 | |||
f3093c27cd | |||
4526a9d860 | |||
a1ada5aa8c | |||
1ae8b8b793 | |||
f44cc99a82 | |||
75657bec58 | |||
4fef036f10 | |||
ecb9783f4e | |||
bdf85908ca | |||
9cb3cdabb0 | |||
6cf082dfa7 | |||
1a140d4dfd | |||
1cc8571a04 | |||
cf8c631938 | |||
4cba2a16f9 | |||
7c5f074d5a | |||
a251cf6abf | |||
31f7a47889 | |||
23de2af98d | |||
2446f024ef | |||
45ddd528b2 | |||
36908f7da9 | |||
1a11d55782 | |||
e344eddbcb | |||
09da7a29a9 | |||
5b5ac0937c | |||
c69818fed6 | |||
81712e7a99 | |||
75d2d39e7c | |||
ccc4a30ad5 | |||
a9bb12015a | |||
474f90ee33 | |||
ae7d5fe284 | |||
bf700b9d59 | |||
0d4b3f5e7e | |||
67076458f0 | |||
a8479eefd1 | |||
e1eda99a72 | |||
ed4a4f0742 | |||
84e89d3b83 | |||
5e3efde376 | |||
f28e17f3e5 | |||
699ecafc22 | |||
247cc301ea | |||
bc43338127 | |||
4e86f2a7de | |||
b9fe2746e3 | |||
4fe9d09f0a | |||
777db300e1 | |||
62a303e856 | |||
ae573af89d | |||
0c41a3309e | |||
4cb3e22308 | |||
9d7d36922f | |||
3190c5f133 | |||
5fadb796d1 | |||
4a213e5ca5 | |||
9fea962563 | |||
ac6c333df3 | |||
4bbff47b6f | |||
f01daa4296 | |||
96c2f8ee1e | |||
9eb3e7a22d | |||
3c2c783683 | |||
2e24f9bb44 | |||
6bb3351cb8 | |||
6086a0ea12 | |||
b4b688d3b9 | |||
43bf3c0cb2 | |||
26897c256b | |||
a788563db6 | |||
9fb1c747a6 | |||
5982978879 | |||
5ca4584416 | |||
3eca1af971 |
@ -3,7 +3,6 @@ _mkgmtime
|
||||
_sh_denyno
|
||||
_sh_denyrd
|
||||
_sh_denyrw
|
||||
_spawnv
|
||||
aarch64
|
||||
advapi32
|
||||
armv8
|
||||
@ -17,7 +16,6 @@ bugprone
|
||||
cflags
|
||||
chrono
|
||||
cmake_current_source_dir
|
||||
coinit_apartmentthreaded
|
||||
comdlg32
|
||||
cppcoreguidelines
|
||||
cppdbg
|
||||
@ -116,7 +114,6 @@ googletest
|
||||
gpath
|
||||
gtest_version
|
||||
has_setxattr
|
||||
hkey
|
||||
httpapi
|
||||
httplib
|
||||
icudata
|
||||
@ -124,7 +121,6 @@ icui18n
|
||||
icuuc
|
||||
iostreams
|
||||
iphlpapi
|
||||
ipstream
|
||||
jthread
|
||||
libbitcoin
|
||||
libbitcoinsystem
|
||||
@ -146,7 +142,6 @@ libuuid_include_dirs
|
||||
libvlc
|
||||
linkflags
|
||||
localappdata
|
||||
lpbyte
|
||||
lptr
|
||||
lpwstr
|
||||
markdownlint
|
||||
@ -159,10 +154,8 @@ mtune
|
||||
musl-libc
|
||||
nana
|
||||
ncrypt
|
||||
nlohmann
|
||||
nlohmann_json
|
||||
nmakeprg
|
||||
nohup
|
||||
nominmax
|
||||
ntstatus
|
||||
nullptr
|
||||
@ -170,7 +163,6 @@ nuspell_version
|
||||
oleaut32
|
||||
openal_version
|
||||
openssldir
|
||||
pistream
|
||||
pkgconfig
|
||||
plarge_integer
|
||||
plex
|
||||
@ -200,7 +192,6 @@ secp256k1
|
||||
secur32
|
||||
sfml_project
|
||||
shlwapi
|
||||
skynet
|
||||
source_subdir
|
||||
spdlog
|
||||
spdlog_project
|
||||
|
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -1,4 +0,0 @@
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
36
.vimspector.json
Normal file
36
.vimspector.json
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"configurations": {
|
||||
"UnixDebug": {
|
||||
"adapter": "vscode-cpptools",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/build/debug/repertory",
|
||||
"args": ["-f", "/home/sgraves/mnt"],
|
||||
"cwd": "${workspaceRoot}/build/debug",
|
||||
"environment": [],
|
||||
"externalConsole": true,
|
||||
"MIMode": "gdb",
|
||||
"stopAtEntry": true,
|
||||
"logging": {
|
||||
"engineLogging": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"UnixDebugTest": {
|
||||
"adapter": "vscode-cpptools",
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/build/debug/unittests",
|
||||
"args": ["--gtest_filter=file_manager.can_close_after_download_timeout"],
|
||||
"cwd": "${workspaceRoot}/build",
|
||||
"environment": [],
|
||||
"externalConsole": true,
|
||||
"MIMode": "gdb",
|
||||
"stopAtEntry": true,
|
||||
"logging": {
|
||||
"engineLogging": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
69
CHANGELOG.md
69
CHANGELOG.md
@ -1,75 +1,7 @@
|
||||
# Changelog
|
||||
|
||||
## v2.0.6-release
|
||||
|
||||
### Issues
|
||||
|
||||
* ~~\#12 [Unit Test] Complete all providers unit tests~~
|
||||
* ~~\#21 [Unit Test] Complete WinFSP unit tests~~
|
||||
* ~~\#22 [Unit Test] Complete FUSE unit tests~~
|
||||
* ~~\#33 Complete initial v2.0 documentation~~
|
||||
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
|
||||
* \#43 [bug] Directories are not importing properly for Sia
|
||||
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
||||
* \#45 [bug] Windows-to-Linux remote mount is not handling attempts to remove a non-empty directory properly
|
||||
* \#46 [bug] Changes to maximum cache size should be updated live
|
||||
* \#47 [bug] Windows-to-Linux remote mount is allowing directory rename when directory is not empty
|
||||
* \#48 [bug] Windows-to-Linux remote mount overlapped I/O is not detecting EOF for read operations
|
||||
* \#49 [ui] Implement provider test button
|
||||
|
||||
### Changes from v2.0.5-rc
|
||||
|
||||
* Drive letters in UI should always be lowercase
|
||||
* Fixed WinFSP directory rename for non-empty directories
|
||||
* Migrated to v2 error handling
|
||||
|
||||
## v2.0.5-rc
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#39 Create management portal in Flutter
|
||||
|
||||
### Changes from v2.0.4-rc
|
||||
|
||||
* Continue documentation updates
|
||||
* Fixed `-status` command erasing active mount information
|
||||
* Fixed overlapping HTTP REST API port's
|
||||
* Refactored/fixed instance locking
|
||||
* Removed passwords and secret key values from API calls
|
||||
* Renamed setting `ApiAuth` to `ApiPassword`
|
||||
* Require `--name,-na` option for encryption provider
|
||||
|
||||
## v2.0.4-rc
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* `renterd` v2.0.0+ is now required. Prior versions will fail to mount.
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#35 [bug] Low frequency check is set to '0' instead of 1 hour by default
|
||||
* \#36 [bug] Max cache size bytes is set to '0' by default
|
||||
|
||||
### Changes from v2.0.3-rc
|
||||
|
||||
* Added Sia API version check prior to mounting
|
||||
* Added back `-cv` (check version) CLI option
|
||||
* Continue documentation updates
|
||||
* Fixed setting `ApiAuth` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.ApiUser` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.Path` via `set_value_by_name`
|
||||
* Fixed setting `HostConfig.Protocol` via `set_value_by_name`
|
||||
* Improved ring buffer read-ahead
|
||||
* Integrated `renterd` version 2.0.0
|
||||
* Prefer using local cache file when opening files
|
||||
* Refactored `app_config` unit tests
|
||||
* Refactored polling to be more accurate on scheduling tasks
|
||||
|
||||
## v2.0.3-rc
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### Issues
|
||||
|
||||
* \#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories
|
||||
@ -93,7 +25,6 @@
|
||||
|
||||
## v2.0.2-rc
|
||||
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
### BREAKING CHANGES
|
||||
|
||||
* Refactored `config.json` - will need to verify configuration settings prior to mounting
|
||||
|
@ -58,10 +58,6 @@ if(PROJECT_IS_MINGW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (PROJECT_ENABLE_V2_ERRORS)
|
||||
add_definitions(-DPROJECT_ENABLE_V2_ERRORS)
|
||||
endif()
|
||||
|
||||
include(cmake/settings.cmake)
|
||||
|
||||
include(cmake/flags.cmake)
|
||||
@ -147,7 +143,6 @@ endif()
|
||||
-DPROJECT_COPYRIGHT=${PROJECT_COPYRIGHT}
|
||||
-DPROJECT_DESC=${PROJECT_DESC}
|
||||
-DPROJECT_DIST_DIR=${PROJECT_DIST_DIR}
|
||||
-DPROJECT_ENABLE_V2_ERRORS=${PROJECT_ENABLE_V2_ERRORS}
|
||||
-DPROJECT_ENABLE_WIN32_LONG_PATH_NAMES=${PROJECT_ENABLE_WIN32_LONG_PATH_NAMES}
|
||||
-DPROJECT_ENABLE_BOOST=${PROJECT_ENABLE_BOOST}
|
||||
-DPROJECT_ENABLE_CPP_HTTPLIB=${PROJECT_ENABLE_CPP_HTTPLIB}
|
||||
|
486
README.md
486
README.md
@ -3,431 +3,145 @@
|
||||
Repertory allows you to mount S3 and Sia via FUSE on Linux or via WinFSP
|
||||
on Windows.
|
||||
|
||||
## Contents
|
||||
|
||||
1. [Details and Features](#details-and-features)
|
||||
2. [Minimum Requirements](#minimum-requirements)
|
||||
1. [Supported Operating Systems](#supported-operating-systems)
|
||||
3. [GUI](#gui)
|
||||
4. [Usage](#usage)
|
||||
1. [Important Options](#important-options)
|
||||
2. [Sia](#sia)
|
||||
* [Sia Initial Configuration](#sia-initial-configuration)
|
||||
* [Sia Mounting](#sia-mounting)
|
||||
* [Sia Configuration File](#sia-configuration-file)
|
||||
3. [S3](#s3)
|
||||
* [S3 Initial Configuration](#s3-initial-configuration)
|
||||
* [S3 Mounting](#s3-mounting)
|
||||
* [S3 Configuration File](#s3-configuration-file)
|
||||
5. [Data Directories](#data-directories)
|
||||
1. [Linux Directories](#linux-directories)
|
||||
2. [Windows Directories](#windows-directories)
|
||||
6. [Remote Mounting](#remote-mounting)
|
||||
1. [Server Setup](#server-setup)
|
||||
* [Remote Mount Configuration File Section](#remote-mount-configuration-file-section)
|
||||
2. [Client Setup](#client-setup)
|
||||
* [Client Remote Mounting](#client-remote-mounting)
|
||||
* [Remote Mount Configuration File](#remote-mount-configuration-file)
|
||||
7. [Compiling](#compiling)
|
||||
1. [Linux Compilation](#linux-compilation)
|
||||
2. [Windows Setup](#windows-compilation)
|
||||
8. [Credits](#credits)
|
||||
9. [Developer Public Key](#developer-public-key)
|
||||
10. [Consult the Wiki for additional information](https://git.fifthgrid.com/BlockStorage/repertory/wiki)
|
||||
|
||||
## Details and Features
|
||||
|
||||
* Optimized for [Plex Media Server](https://www.plex.tv/)
|
||||
* Remote mounting of `repertory` instances on Linux and Windows
|
||||
* Single application to mount S3 and/or Sia
|
||||
* Remote mounting of Repertory instances on Linux and Windows
|
||||
* Securely share your mounts over TCP/IP via `XChaCha20-Poly1305` with other systems on your network or over the internet.
|
||||
* Cross-platform support (Linux 64-bit, Linux arm64/aarch64, Windows 64-bit)
|
||||
* Optionally encrypt file names and file data via `XChaCha20-Poly1305` in S3 mounts
|
||||
|
||||
## Minimum Requirements
|
||||
|
||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
|
||||
* Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||
* Windows requires the following dependencies to be installed:
|
||||
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
|
||||
* Only 64-bit operating systems are supported
|
||||
* By default, Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||
* Windows requires the following dependencies to be installed:
|
||||
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||
|
||||
### Supported Operating Systems
|
||||
|
||||
Only 64-bit operating systems are supported
|
||||
## Supported Operating Systems
|
||||
|
||||
* Linux `arm64/aarch64`
|
||||
* Linux `amd64`
|
||||
* Windows 64-bit 10, 11
|
||||
|
||||
## GUI
|
||||
|
||||
As of `v2.0.5-rc`, mounts can be managed using the `Repertory Management Portal`.
|
||||
To launch the portal, execute the following command:
|
||||
|
||||
* `repertory -ui`
|
||||
* The default username is `repertory`
|
||||
* The default password is `repertory`
|
||||
|
||||
After first launch, `ui.json` will be created in the appropriate data directory.
|
||||
See [Data Directories](#data-directories).
|
||||
You should modify this file directly or use the portal to change the default
|
||||
username and password.
|
||||
|
||||
### Screenshot
|
||||
|
||||
<a href="https://ibb.co/fVyJqnbF"><img src="https://i.ibb.co/fVyJqnbF/repertory-portal.png" alt="repertory-portal" border="0"></a>
|
||||
|
||||
## Usage
|
||||
|
||||
### Important Options
|
||||
### Sia
|
||||
|
||||
* Initial Configuration
|
||||
* Sia steps:
|
||||
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
||||
* To use `default` as the bucket name and configuration name:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* To use a different bucket name with `default` as the configuration name:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory -set SiaConfig.Bucket '<my bucket>'`
|
||||
* For all other configurations:
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -dc`
|
||||
* `repertory --name '<my config nam>' -dc`
|
||||
* Mounting on Linux:
|
||||
* `repertory /mnt/location`
|
||||
* `repertory --name '<my config nam>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory --name default /mnt/location`
|
||||
* Mounting on Windows:
|
||||
* `repertory t:`
|
||||
* `repertory --name '<my config nam>' t:`
|
||||
* Example:
|
||||
* `repertory --name default t:`
|
||||
|
||||
### S3
|
||||
|
||||
* Initial Configuration
|
||||
* S3 steps:
|
||||
* Set the appropriate base URL:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'`
|
||||
* Set the appropriate bucket name:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'`
|
||||
* Set the appropriate access key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'`
|
||||
* Set the appropriate secret key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'`
|
||||
* For Sia and most local S3 gateway instances, enable path style URL's:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true`
|
||||
* Optional steps:
|
||||
* Set the appropriate region. Default is set to `any`:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'`
|
||||
* Enable encrypted file names and file data. Set a strong, random encryption token and be sure to store it in a secure backup location:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'`
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -s3 --name '<my config name>' -dc`
|
||||
* Mounting on Linux:
|
||||
* `repertory -s3 --name '<my config name>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio /mnt/location`
|
||||
* Mounting on Windows:
|
||||
* `repertory -s3 --name '<my config name>' t:`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio t:`
|
||||
|
||||
### Notable Options
|
||||
|
||||
* `--help`
|
||||
* Display all mount utility options
|
||||
|
||||
* `-f`
|
||||
* Keep process in foreground on Linux.
|
||||
|
||||
* `--name, -na [name]`
|
||||
* Identifies a unique configuration name to support multiple mounts.
|
||||
* The `--name` option can be set to any valid value allowed as a file name for your filesystem.
|
||||
* For Sia, the bucket name will be set to the same value if it is empty in the configuration file.
|
||||
* If the `--name` option is not specified, `default` will be used.
|
||||
* For S3, the `--name` option is required and does not affect the bucket name.
|
||||
|
||||
* `-dc`
|
||||
* Display mount configuration
|
||||
* For Sia, `--name` is optional
|
||||
* For S3, the `-s3` option is required along with `--name`
|
||||
|
||||
### Sia
|
||||
|
||||
#### Sia Initial Configuration
|
||||
|
||||
* Required steps:
|
||||
* Set the appropriate bucket name and `renterd` API password in `repertory` configuration:
|
||||
* To use `default` as the bucket name and configuration name, you only need to set the `renterd` API password:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* To specify a different bucket name while using `default` as the configuration name:
|
||||
* `repertory -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory -set SiaConfig.Bucket '<my bucket>'`
|
||||
* For all other configurations:
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiPassword '<my password>'`
|
||||
* `repertory --name '<my config name>' -set SiaConfig.Bucket '<my bucket name>'`
|
||||
|
||||
* Optional steps:
|
||||
* Set a user name used during `renterd` basic authentication:
|
||||
* `repertory -set HostConfig.ApiUser '<my user>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiUser '<my user>'`
|
||||
* Set a custom agent string (default `Sia-Agent`):
|
||||
* `repertory -set HostConfig.AgentString '<my agent>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.AgentString '<my agent>'`
|
||||
* Set the host name or IP of the `renterd` instance (default `localhost`):
|
||||
* `repertory -set HostConfig.HostNameOrIp '<my host name>'`
|
||||
* `repertory --name '<my config name>' -set HostConfig.HostNameOrIp '<my host name>'`
|
||||
* Set the `renterd` API port (default `9980`):
|
||||
* `repertory -set HostConfig.ApiPort 9981`
|
||||
* `repertory --name '<my config name>' -set HostConfig.ApiPort 9981`
|
||||
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -dc`
|
||||
* `repertory --name '<my config name>' -dc`
|
||||
* Example:
|
||||
* `repertory --name default -dc`
|
||||
|
||||
#### Sia Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory /mnt/location`
|
||||
* `repertory --name '<my config name>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory --name default /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory t:`
|
||||
* `repertory --name '<my config name>' t:`
|
||||
* Example:
|
||||
* `repertory --name default t:`
|
||||
|
||||
#### Sia Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10000,
|
||||
"ApiUser": "repertory",
|
||||
"DatabaseType": "rocksdb",
|
||||
"DownloadTimeoutSeconds": 30,
|
||||
"EnableDownloadTimeout": true,
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"EvictionDelayMinutes": 1,
|
||||
"EvictionUseAccessedTime": false,
|
||||
"HighFreqIntervalSeconds": 30,
|
||||
"HostConfig": {
|
||||
"AgentString": "Sia-Agent",
|
||||
"ApiPassword": "<renterd api password>",
|
||||
"ApiPort": 9980,
|
||||
"ApiUser": "",
|
||||
"HostNameOrIp": "localhost",
|
||||
"Path": "",
|
||||
"Protocol": "http",
|
||||
"TimeoutMs": 60000
|
||||
},
|
||||
"LowFreqIntervalSeconds": 3600,
|
||||
"MaxCacheSizeBytes": 21474836480,
|
||||
"MaxUploadCount": 5,
|
||||
"MedFreqIntervalSeconds": 120,
|
||||
"OnlineCheckRetrySeconds": 60,
|
||||
"PreferredDownloadType": "default",
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20000,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": false,
|
||||
"EncryptionToken": ""
|
||||
},
|
||||
"RetryReadCount": 6,
|
||||
"RingBufferFileSize": 512,
|
||||
"SiaConfig": {
|
||||
"Bucket": "default"
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
|
||||
### S3
|
||||
|
||||
#### S3 Initial Configuration
|
||||
|
||||
* Required steps:
|
||||
* Set the appropriate base URL:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.URL '<my url>'`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio -set S3Config.URL 'http://localhost:9000'`
|
||||
* Set the appropriate bucket name:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Bucket '<my bucket name>'`
|
||||
* Set the appropriate access key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.AccessKey '<my access key>'`
|
||||
* Set the appropriate secret key:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.SecretKey '<my secret key>'`
|
||||
* For Sia and most local S3 gateway instances, enable path style URL's:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.UsePathStyle true`
|
||||
|
||||
* Optional steps:
|
||||
* Set an appropriate region. Default is set to `any`:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.Region '<my region>'`
|
||||
* Enable encrypted file names and file data. Set a strong, random encryption token and be sure to store it in a secure backup location:
|
||||
* `repertory -s3 --name '<my config name>' -set S3Config.EncryptionToken '<my strong password>'`
|
||||
|
||||
* To verify/view all configuration options:
|
||||
* `repertory -s3 --name '<my config name>' -dc`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio -dc`
|
||||
|
||||
#### S3 Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory -s3 --name '<my config name>' /mnt/location`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory -s3 --name '<my config name>' t:`
|
||||
* Example:
|
||||
* `repertory -s3 --name minio t:`
|
||||
|
||||
#### S3 Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10100,
|
||||
"ApiUser": "repertory",
|
||||
"DatabaseType": "rocksdb",
|
||||
"DownloadTimeoutSeconds": 30,
|
||||
"EnableDownloadTimeout": true,
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"EvictionDelayMinutes": 1,
|
||||
"EvictionUseAccessedTime": false,
|
||||
"HighFreqIntervalSeconds": 30,
|
||||
"LowFreqIntervalSeconds": 3600,
|
||||
"MaxCacheSizeBytes": 21474836480,
|
||||
"MaxUploadCount": 5,
|
||||
"MedFreqIntervalSeconds": 120,
|
||||
"OnlineCheckRetrySeconds": 60,
|
||||
"PreferredDownloadType": "default",
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20100,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": false,
|
||||
"EncryptionToken": ""
|
||||
},
|
||||
"RetryReadCount": 6,
|
||||
"RingBufferFileSize": 512,
|
||||
"S3Config": {
|
||||
"AccessKey": "<my access key>",
|
||||
"Bucket": "<my bucket name>",
|
||||
"EncryptionToken": "",
|
||||
"Region": "any",
|
||||
"SecretKey": "<my secret key>",
|
||||
"TimeoutMs": 60000,
|
||||
"URL": "http://localhost:9000",
|
||||
"UsePathStyle": true,
|
||||
"UseRegionInURL": false
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
|
||||
### Data Directories
|
||||
|
||||
#### Linux Directories
|
||||
|
||||
* `~/.local/repertory2/s3`
|
||||
* `~/.local/repertory2/sia`
|
||||
|
||||
#### Windows Directories
|
||||
|
||||
* `%LOCALAPPDATA%\repertory2\s3`
|
||||
* `%LOCALAPPDATA%\repertory2\sia`
|
||||
* Examples:
|
||||
* `C:\Users\Tom\AppData\Local\repertory2\s3`
|
||||
* `C:\Users\Tom\AppData\Local\repertory2\sia`
|
||||
* IMPORTANT:
|
||||
* It is highly recommended to exclude this folder from any anti-virus/anti-malware applications as severe performance issues may arise.
|
||||
* Excluding the mounted drive letter is also highly recommended.
|
||||
* Linux
|
||||
* `~/.local/repertory2`
|
||||
* Windows
|
||||
* `%LOCALAPPDATA%\repertory2`
|
||||
* Example:
|
||||
* `C:\Users\Tom\AppData\Local\repertory2`
|
||||
* IMPORTANT:
|
||||
* It is highly recommended to exclude this folder from any anti-virus/anti-malware applications as severe performance issues may arise.
|
||||
* Excluding the mounted drive letter is also highly recommended.
|
||||
|
||||
## Remote Mounting
|
||||
|
||||
`repertory` allows local mounts to be shared with other computers on your network
|
||||
or over the internet. This option is referred to as remote mounting.
|
||||
|
||||
### Server Setup
|
||||
|
||||
The following steps must be performed on the mount you wish to share with
|
||||
other systems. Changes to configuration will not take affect while a mount is
|
||||
active, so it is recommended to unmount beforehand.
|
||||
|
||||
* Required steps:
|
||||
* Enable remote mount:
|
||||
* Sia
|
||||
* `repertory -set RemoteMount.Enable true`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.Enable true`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.Enable true`
|
||||
* Set a secure encryption token:
|
||||
* Sia:
|
||||
* `repertory -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.EncryptionToken '<my secure password>'`
|
||||
|
||||
* Optional steps:
|
||||
* Change the port clients will use to connect to your mount:
|
||||
* Sia:
|
||||
* `repertory -set RemoteMount.ApiPort 20000`
|
||||
* `repertory --name '<my config name>' -set RemoteMount.ApiPort 20000`
|
||||
* S3:
|
||||
* `repertory -s3 --name '<my config name>' -set RemoteMount.ApiPort 20000`
|
||||
|
||||
* IMPORTANT:
|
||||
* Be sure to configure your firewall to allow incoming TCP connections on the port configured in `RemoteMount.ApiPort`.
|
||||
|
||||
#### Remote Mount Configuration File Section
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"RemoteMount": {
|
||||
"ApiPort": 20000,
|
||||
"ClientPoolSize": 20,
|
||||
"Enable": true,
|
||||
"EncryptionToken": "<my secure password>"
|
||||
},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
### Client Setup
|
||||
|
||||
Client configuration is provider agnostic, so there's no need to specify `-s3`
|
||||
for S3 providers.
|
||||
|
||||
* Required steps:
|
||||
* Set the encryption token to the same value configured during server setup:
|
||||
* `repertory -rm <host name or IP>:<port> -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
* Replace `<host name or IP>` with the host name or IP of the server
|
||||
* Replace `<port>` with the value of `RemoteMount.ApiPort` used in the server configuration
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
* `repertory -rm my.host.com:20000 -set RemoteConfig.EncryptionToken '<my secure password>'`
|
||||
|
||||
#### Client Remote Mounting
|
||||
|
||||
* Linux:
|
||||
* `repertory -rm <host name or IP>:<port> /mnt/location`
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 /mnt/location`
|
||||
|
||||
* Windows:
|
||||
* `repertory -rm <host name or IP>:<port> t:`
|
||||
* Example:
|
||||
* `repertory -rm 192.168.1.10:20000 t:`
|
||||
|
||||
#### Remote Mount Configuration File
|
||||
|
||||
```json
|
||||
{
|
||||
"ApiPassword": "<random generated rpc password>",
|
||||
"ApiPort": 10010,
|
||||
"ApiUser": "repertory",
|
||||
"EnableDriveEvents": false,
|
||||
"EventLevel": "info",
|
||||
"RemoteConfig": {
|
||||
"ApiPort": 20000,
|
||||
"EncryptionToken": "<my secure password>",
|
||||
"HostNameOrIp": "192.168.1.10",
|
||||
"MaxConnections": 20,
|
||||
"ReceiveTimeoutMs": 120000,
|
||||
"SendTimeoutMs": 30000
|
||||
},
|
||||
"TaskWaitMs": 100,
|
||||
"Version": 1
|
||||
}
|
||||
```
|
||||
`Repertory` allows local mounts to be shared with other computers on your network.
|
||||
This option is referred to as remote mounting. Instructions TBD.
|
||||
|
||||
## Compiling
|
||||
|
||||
Successful compilation will result in all files required for execution to be placed
|
||||
in the `dist/` directory
|
||||
|
||||
### Linux Compilation
|
||||
|
||||
* Ensure `docker` is installed
|
||||
* For x86_64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh`
|
||||
* Release: `scripts/make_unix.sh x86_64 Release`
|
||||
* Debug: `scripts/make_unix.sh x86_64 Debug`
|
||||
|
||||
* For aarch64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh aarch64`
|
||||
* Release: `scripts/make_unix.sh aarch64 Release`
|
||||
* Debug: `scripts/make_unix.sh aarch64 Debug`
|
||||
|
||||
### Windows Compilation
|
||||
|
||||
* OFFICIAL: Cross-compiling on Linux
|
||||
* Successful compilation will result in all required files being placed in the `dist/` directory
|
||||
* Linux
|
||||
* Ensure `docker` is installed
|
||||
* RelWithDebInfo: `scripts/make_win32.sh`
|
||||
* Release: `scripts/make_win32.sh x86_64 Release`
|
||||
* Debug: `scripts/make_win32.sh x86_64 Debug`
|
||||
|
||||
* UNOFFICIAL: Compiling on Windows
|
||||
* Ensure latest [MSYS2](https://www.msys2.org/) is installed
|
||||
* RelWithDebInfo: `scripts\make_win32.cmd`
|
||||
* Release: `scripts\make_win32.cmd x86_64 Release`
|
||||
* Debug: `scripts\make_win32.cmd x86_64 Debug`
|
||||
* For x86_64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh`
|
||||
* Release: `scripts/make_unix.sh x86_64 Release`
|
||||
* Debug: `scripts/make_unix.sh x86_64 Debug`
|
||||
* For aarch64:
|
||||
* RelWithDebInfo: `scripts/make_unix.sh aarch64`
|
||||
* Release: `scripts/make_unix.sh aarch64 Release`
|
||||
* Debug: `scripts/make_unix.sh aarch64 Debug`
|
||||
* Windows
|
||||
* OFFICIAL: Cross-compiling on Linux
|
||||
* Ensure `docker` is installed
|
||||
* RelWithDebInfo: `scripts/make_win32.sh`
|
||||
* Release: `scripts/make_win32.sh x86_64 Release`
|
||||
* Debug: `scripts/make_win32.sh x86_64 Debug`
|
||||
* UNOFFICIAL: Compiling on Windows
|
||||
* Ensure latest [MSYS2](https://www.msys2.org/) is installed
|
||||
* RelWithDebInfo: `scripts\make_win32.cmd`
|
||||
* Release: `scripts\make_win32.cmd x86_64 Release`
|
||||
* Debug: `scripts\make_win32.cmd x86_64 Debug`
|
||||
|
||||
## Credits
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
|
||||
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
|
||||
set(BINUTILS_HASH b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365)
|
||||
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||
set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866)
|
||||
set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699)
|
||||
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
|
||||
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
|
||||
set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
|
||||
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
|
||||
set(CPP_HTTPLIB_HASH 405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00)
|
||||
set(CURL_HASH 5a231145114589491fc52da118f9c7ef8abee885d1cb1ced99c7290e9a352f07)
|
||||
set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2)
|
||||
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
|
||||
set(GTEST_HASH 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926)
|
||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
||||
set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406)
|
||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||
set(MINGW_HASH cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f)
|
||||
set(OPENSSL_HASH 344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0)
|
||||
set(MINGW_HASH 30e5aad2c48dd318150f79cff47661232c4175876d6b4d6b270961cf2b49a48b)
|
||||
set(OPENSSL_HASH e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf)
|
||||
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
||||
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
|
||||
set(ROCKSDB_HASH 3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28)
|
||||
set(SPDLOG_HASH 7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d)
|
||||
set(SQLITE_HASH 6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3)
|
||||
set(PUGIXML_HASH 2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015)
|
||||
set(ROCKSDB_HASH 9b810c81731835fda0d4bbdb51d3199d901fa4395733ab63752d297da84c5a47)
|
||||
set(SPDLOG_HASH 9962648c9b4f1a7bbc76fd8d9172555bad1871fdb14ff4f842ef87949682caa5)
|
||||
set(SQLITE_HASH 77823cb110929c2bcb0f5d48e4833b5c59a8a6e40cdea3936b99e199dbbe5784)
|
||||
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
||||
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
||||
|
@ -120,11 +120,11 @@ if(PROJECT_ENABLE_BOOST)
|
||||
--with-libraries=atomic,chrono,date_time,filesystem,iostreams,locale,log,program_options,random,regex,serialization,system,test,thread
|
||||
BUILD_COMMAND
|
||||
./b2
|
||||
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
-j1
|
||||
${BOOST_BUILD_ARGS}
|
||||
INSTALL_COMMAND
|
||||
./b2
|
||||
-j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
-j1
|
||||
${BOOST_BUILD_ARGS}
|
||||
install
|
||||
)
|
||||
|
@ -15,13 +15,10 @@ if(PROJECT_ENABLE_CPP_HTTPLIB)
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=ON
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
|
||||
-DHTTPLIB_REQUIRE_ZLIB=ON
|
||||
-DHTTPLIB_REQUIRE_BROTLI=OFF
|
||||
-DHTTPLIB_TEST=OFF
|
||||
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF
|
||||
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=ON
|
||||
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON
|
||||
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,8 @@ if(PROJECT_ENABLE_CURL)
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/curl-${CURL_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${CURL_HASH}
|
||||
LIST_SEPARATOR |
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
CMAKE_ARGS
|
||||
${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_CURL_EXE=OFF
|
||||
-DBUILD_LIBCURL_DOCS=OFF
|
||||
-DBUILD_MISC_DOCS=OFF
|
||||
@ -29,7 +28,6 @@ if(PROJECT_ENABLE_CURL)
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
-DBUILD_TESTING=OFF
|
||||
-DCURL_BROTLI=OFF
|
||||
-DCURL_CA_BUNDLE=./cacert.pem
|
||||
-DCURL_CA_FALLBACK=ON
|
||||
-DCURL_DISABLE_LDAP=ON
|
||||
|
@ -9,8 +9,6 @@ if(PROJECT_ENABLE_ROCKSDB)
|
||||
URL ${PROJECT_3RD_PARTY_DIR}/rocksdb-${ROCKSDB_VERSION}.tar.gz
|
||||
URL_HASH SHA256=${ROCKSDB_HASH}
|
||||
LIST_SEPARATOR |
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} --build . -- -j$ENV{CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
CMAKE_ARGS ${PROJECT_EXTERNAL_CMAKE_FLAGS}
|
||||
-DBUILD_SHARED_LIBS=OFF
|
||||
-DBUILD_STATIC_LIBS=ON
|
||||
@ -33,4 +31,4 @@ if(PROJECT_ENABLE_ROCKSDB)
|
||||
|
||||
list(APPEND PROJECT_DEPENDENCIES rocksdb_project)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
@ -2,7 +2,7 @@ if(PROJECT_ENABLE_SQLITE)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_SQLITE)
|
||||
if (PROJECT_IS_MINGW AND NOT PROJECT_IS_MINGW_UNIX)
|
||||
pkg_check_modules(SQLITE3 REQUIRED sqlite3)
|
||||
pkg_check_modules(SQLITE3 REQUIRED sqlite3>=${SQLITE2_VERSION})
|
||||
include_directories(SYSTEM BEFORE ${SQLITE3_INCLUDE_DIRS})
|
||||
link_libraries(${SQLITE3_LIBRARIES})
|
||||
else()
|
||||
|
@ -1,27 +1,28 @@
|
||||
set(BINUTILS_VERSION 2.44)
|
||||
set(BINUTILS_VERSION 2.43)
|
||||
set(BOOST_MAJOR_VERSION 1)
|
||||
set(BOOST_MINOR_VERSION 88)
|
||||
set(BOOST_MINOR_VERSION 87)
|
||||
set(BOOST_PATCH_VERSION 0)
|
||||
set(BOOST2_MAJOR_VERSION 1)
|
||||
set(BOOST2_MINOR_VERSION 76)
|
||||
set(BOOST2_PATCH_VERSION 0)
|
||||
set(CPP_HTTPLIB_VERSION 0.20.0)
|
||||
set(CURL_VERSION 8.13.0)
|
||||
set(CURL2_VERSION 8_13_0)
|
||||
set(EXPAT_VERSION 2.7.1)
|
||||
set(EXPAT2_VERSION 2_7_1)
|
||||
set(GCC_VERSION 15.1.0)
|
||||
set(GTEST_VERSION 1.16.0)
|
||||
set(CPP_HTTPLIB_VERSION 0.18.1)
|
||||
set(CURL_VERSION 8.11.0)
|
||||
set(CURL2_VERSION 8_11_0)
|
||||
set(EXPAT_VERSION 2.6.4)
|
||||
set(EXPAT2_VERSION 2_6_4)
|
||||
set(GCC_VERSION 14.2.0)
|
||||
set(GTEST_VERSION 1.15.2)
|
||||
set(ICU_VERSION 76-1)
|
||||
set(JSON_VERSION 3.12.0)
|
||||
set(JSON_VERSION 3.11.3)
|
||||
set(LIBSODIUM_VERSION 1.0.20)
|
||||
set(MESA_VERSION 23.3.3)
|
||||
set(MINGW_VERSION 12.0.0)
|
||||
set(OPENSSL_VERSION 3.5.0)
|
||||
set(OPENSSL_VERSION 3.4.0)
|
||||
set(PKG_CONFIG_VERSION 0.29.2)
|
||||
set(PUGIXML_VERSION 1.15)
|
||||
set(ROCKSDB_VERSION 10.0.1)
|
||||
set(SPDLOG_VERSION 1.15.2)
|
||||
set(SQLITE_VERSION 3490100)
|
||||
set(SQLITE2_VERSION 3.49.1)
|
||||
set(PUGIXML_VERSION 1.14)
|
||||
set(ROCKSDB_VERSION 9.7.4)
|
||||
set(SPDLOG_VERSION 1.15.0)
|
||||
set(SQLITE_VERSION 3460100)
|
||||
set(SQLITE2_VERSION 3.46.1)
|
||||
set(STDUUID_VERSION 1.2.3)
|
||||
set(ZLIB_VERSION 1.3.1)
|
||||
|
@ -10,7 +10,7 @@ PROJECT_DESC="Mount utility for Sia and S3"
|
||||
|
||||
PROJECT_MAJOR_VERSION=2
|
||||
PROJECT_MINOR_VERSION=0
|
||||
PROJECT_REVISION_VERSION=6
|
||||
PROJECT_REVISION_VERSION=3
|
||||
PROJECT_RELEASE_NUM=0
|
||||
PROJECT_RELEASE_ITER=rc
|
||||
|
||||
@ -19,9 +19,6 @@ PROJECT_APP_LIST=(${PROJECT_NAME})
|
||||
PROJECT_PRIVATE_KEY=${DEVELOPER_PRIVATE_KEY}
|
||||
PROJECT_PUBLIC_KEY=${DEVELOPER_PUBLIC_KEY}
|
||||
|
||||
PROJECT_FLUTTER_BASE_HREF="/ui/"
|
||||
|
||||
PROJECT_ENABLE_V2_ERRORS=ON
|
||||
PROJECT_ENABLE_WIN32_LONG_PATH_NAMES=OFF
|
||||
|
||||
PROJECT_ENABLE_BACKWARD_CPP=OFF
|
||||
|
@ -1,5 +1,4 @@
|
||||
#comment
|
||||
FROM arm64v8/alpine:3.21.3
|
||||
FROM arm64v8/alpine:3.21.0
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -31,7 +30,6 @@ RUN apk add \
|
||||
gflags \
|
||||
gflags-dev \
|
||||
git \
|
||||
git-lfs \
|
||||
icu-dev \
|
||||
icu-libs \
|
||||
icu-static \
|
||||
|
@ -1,5 +1,4 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
FROM alpine:3.21.0
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
@ -31,7 +30,6 @@ RUN apk add \
|
||||
gflags \
|
||||
gflags-dev \
|
||||
git \
|
||||
git-lfs \
|
||||
icu-dev \
|
||||
icu-libs \
|
||||
icu-static \
|
||||
|
@ -1,48 +0,0 @@
|
||||
FROM debian:latest
|
||||
|
||||
ARG UID=0
|
||||
ARG GID=0
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y \
|
||||
bash \
|
||||
curl \
|
||||
fonts-droid-fallback \
|
||||
gdb \
|
||||
git \
|
||||
lib32stdc++6 \
|
||||
libgconf-2-4 \
|
||||
libglu1-mesa \
|
||||
libstdc++6 \
|
||||
python3 \
|
||||
unzip \
|
||||
wget
|
||||
RUN apt-get clean
|
||||
|
||||
RUN git clone https://github.com/flutter/flutter.git /flutter
|
||||
RUN git config --system --add safe.directory /flutter
|
||||
|
||||
ENV PATH="/flutter/bin:/flutter/bin/cache/dart-sdk/bin:${PATH}"
|
||||
|
||||
RUN flutter doctor -v
|
||||
RUN flutter channel master
|
||||
RUN flutter upgrade
|
||||
RUN flutter --disable-analytics
|
||||
|
||||
RUN flutter config --no-analytics
|
||||
RUN flutter config --enable-web
|
||||
RUN flutter config --no-cli-animations
|
||||
|
||||
RUN mkdir /nonexistent
|
||||
RUN chown -R $UID:$GID /nonexistent
|
||||
|
||||
RUN mkdir /.config
|
||||
RUN chown -R $UID:$GID /.config
|
||||
|
||||
RUN mkdir /.dart-tool
|
||||
RUN chown -R $UID:$GID /.dart-tool
|
||||
|
||||
RUN mkdir /.pub-cache
|
||||
RUN chown -R $UID:$GID /.pub-cache
|
||||
|
||||
RUN chown -R $UID:$GID /flutter
|
@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
FROM alpine:3.21.0
|
||||
|
||||
RUN apk update
|
||||
RUN apk upgrade
|
||||
@ -18,7 +18,6 @@ RUN apk add \
|
||||
gcc \
|
||||
gettext \
|
||||
git \
|
||||
git-lfs \
|
||||
gmp \
|
||||
gmp-dev \
|
||||
gperf \
|
||||
@ -351,9 +350,9 @@ RUN cd /3rd_party/mingw64 && sha256sum -c ./expat-${MY_EXPAT_VERSION}.tar.gz.sha
|
||||
|
||||
ARG FONTCONFIG_VERSION
|
||||
ENV MY_FONTCONFIG_VERSION=${FONTCONFIG_VERSION}
|
||||
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz.sha256 && cd - \
|
||||
&& tar xvJf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.xz \
|
||||
RUN if [ -f "/3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz" ]; then \
|
||||
cd /3rd_party && sha256sum -c ./fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz.sha256 && cd - \
|
||||
&& tar xvzf /3rd_party/fontconfig-${MY_FONTCONFIG_VERSION}.tar.gz \
|
||||
&& cd fontconfig-${MY_FONTCONFIG_VERSION} \
|
||||
&& meson setup \
|
||||
--cross-file ${MY_TOOLCHAIN_FILE_MESON} \
|
||||
@ -680,7 +679,6 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
|
||||
-DCMAKE_CXX_STANDARD=${MY_CXX_STANDARD} \
|
||||
-DCMAKE_INSTALL_PREFIX=${MY_MINGW_DIR} \
|
||||
-DCMAKE_TOOLCHAIN_FILE=${MY_TOOLCHAIN_FILE_CMAKE} \
|
||||
-DCURL_BROTLI=OFF \
|
||||
-DCURL_CA_BUNDLE=./cacert.pem \
|
||||
-DCURL_CA_FALLBACK=ON \
|
||||
-DCURL_DISABLE_LDAP=ON \
|
||||
@ -716,9 +714,6 @@ RUN if [ -f "/3rd_party/cpp-httplib-${MY_CPP_HTTPLIB_VERSION}.tar.gz" ]; then \
|
||||
-DHTTPLIB_REQUIRE_OPENSSL=ON \
|
||||
-DHTTPLIB_REQUIRE_ZLIB=ON \
|
||||
-DHTTPLIB_TEST=OFF \
|
||||
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
|
||||
-DHTTPLIB_USE_OPENSSL_IF_AVAILABLE=YES \
|
||||
-DHTTPLIB_USE_ZLIB_IF_AVAILABLE=ON \
|
||||
&& make -j${MY_NUM_JOBS} \
|
||||
&& make install \
|
||||
&& cd ${MY_WORKDIR} \
|
||||
|
@ -31,27 +31,26 @@ private:
|
||||
static stop_type stop_requested;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto default_agent_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
[[nodiscard]] static auto
|
||||
default_agent_name(const provider_type &prov) -> std::string;
|
||||
|
||||
[[nodiscard]] static auto default_api_port(const provider_type &prov)
|
||||
-> std::uint16_t;
|
||||
[[nodiscard]] static auto
|
||||
default_api_port(const provider_type &prov) -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto default_data_directory(const provider_type &prov)
|
||||
-> std::string;
|
||||
[[nodiscard]] static auto
|
||||
default_data_directory(const provider_type &prov) -> std::string;
|
||||
|
||||
[[nodiscard]] static auto default_remote_api_port(const provider_type &prov)
|
||||
-> std::uint16_t;
|
||||
[[nodiscard]] static auto
|
||||
default_remote_api_port(const provider_type &prov) -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto default_rpc_port() -> std::uint16_t;
|
||||
[[nodiscard]] static auto
|
||||
default_rpc_port(const provider_type &prov) -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] static auto get_provider_display_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
[[nodiscard]] static auto
|
||||
get_provider_display_name(const provider_type &prov) -> std::string;
|
||||
|
||||
[[nodiscard]] static auto get_provider_name(const provider_type &prov)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto get_root_data_directory() -> std::string;
|
||||
[[nodiscard]] static auto
|
||||
get_provider_name(const provider_type &prov) -> std::string;
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto get_stop_requested() -> bool;
|
||||
@ -72,7 +71,7 @@ public:
|
||||
|
||||
private:
|
||||
provider_type prov_;
|
||||
atomic<std::string> api_password_;
|
||||
atomic<std::string> api_auth_;
|
||||
std::atomic<std::uint16_t> api_port_;
|
||||
atomic<std::string> api_user_;
|
||||
std::atomic<bool> config_changed_;
|
||||
@ -92,6 +91,7 @@ private:
|
||||
std::atomic<std::uint8_t> max_upload_count_;
|
||||
std::atomic<std::uint16_t> med_freq_interval_secs_;
|
||||
std::atomic<std::uint16_t> online_check_retry_secs_;
|
||||
std::atomic<std::uint16_t> orphaned_file_retention_days_;
|
||||
std::atomic<download_type> preferred_download_type_;
|
||||
std::atomic<std::uint16_t> retry_read_count_;
|
||||
std::atomic<std::uint16_t> ring_buffer_file_size_;
|
||||
@ -122,7 +122,7 @@ private:
|
||||
auto set_value(dest &dst, const source &src) -> bool;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_api_password() const -> std::string;
|
||||
[[nodiscard]] auto get_api_auth() const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_api_port() const -> std::uint16_t;
|
||||
|
||||
@ -172,6 +172,8 @@ public:
|
||||
|
||||
[[nodiscard]] auto get_online_check_retry_secs() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_orphaned_file_retention_days() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_preferred_download_type() const -> download_type;
|
||||
|
||||
[[nodiscard]] auto get_provider_type() const -> provider_type;
|
||||
@ -190,17 +192,14 @@ public:
|
||||
|
||||
[[nodiscard]] auto get_task_wait_ms() const -> std::uint16_t;
|
||||
|
||||
[[nodiscard]] auto get_value_by_name(const std::string &name) const
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] auto get_raw_value_by_name(const std::string &name) const
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
get_value_by_name(const std::string &name) const -> std::string;
|
||||
|
||||
[[nodiscard]] auto get_version() const -> std::uint64_t;
|
||||
|
||||
void save();
|
||||
|
||||
void set_api_password(const std::string &value);
|
||||
void set_api_auth(const std::string &value);
|
||||
|
||||
void set_api_port(std::uint16_t value);
|
||||
|
||||
@ -240,6 +239,8 @@ public:
|
||||
|
||||
void set_online_check_retry_secs(std::uint16_t value);
|
||||
|
||||
void set_orphaned_file_retention_days(std::uint16_t value);
|
||||
|
||||
void set_preferred_download_type(const download_type &value);
|
||||
|
||||
void set_remote_config(remote::remote_config value);
|
||||
|
@ -53,6 +53,9 @@ private:
|
||||
std::optional<host_config> host_config_;
|
||||
std::optional<s3_config> s3_config_;
|
||||
|
||||
private:
|
||||
bool use_s3_path_style_{false};
|
||||
|
||||
public:
|
||||
[[nodiscard]] static auto create_curl() -> CURL *;
|
||||
|
||||
@ -64,7 +67,8 @@ public:
|
||||
const host_config &cfg)
|
||||
-> std::string;
|
||||
|
||||
[[nodiscard]] static auto create_host_config(const s3_config &cfg)
|
||||
[[nodiscard]] static auto create_host_config(const s3_config &cfg,
|
||||
bool use_s3_path_style)
|
||||
-> host_config;
|
||||
|
||||
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
|
||||
@ -221,7 +225,8 @@ public:
|
||||
}
|
||||
|
||||
if (curl_code != CURLE_OK) {
|
||||
event_system::instance().raise<curl_error>(curl_code, function_name, url);
|
||||
event_system::instance().raise<curl_error>(curl_code, function_name,
|
||||
url);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -233,6 +238,8 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
void enable_s3_path_style(bool enable) override;
|
||||
|
||||
[[nodiscard]] auto make_request(const curl::requests::http_delete &del,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
|
@ -34,29 +34,28 @@ struct i_http_comm {
|
||||
INTERFACE_SETUP(i_http_comm);
|
||||
|
||||
public:
|
||||
virtual void enable_s3_path_style(bool enable) = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
make_request(const curl::requests::http_delete &del, long &response_code,
|
||||
stop_type &stop_requested) const -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto make_request(const curl::requests::http_get &get,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
make_request(const curl::requests::http_get &get, long &response_code,
|
||||
stop_type &stop_requested) const -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto make_request(const curl::requests::http_head &head,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
make_request(const curl::requests::http_head &head, long &response_code,
|
||||
stop_type &stop_requested) const -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto make_request(const curl::requests::http_post &post,
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const
|
||||
-> bool = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
make_request(const curl::requests::http_post &post, long &response_code,
|
||||
stop_type &stop_requested) const -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
make_request(const curl::requests::http_put_file &put_file,
|
||||
long &response_code, stop_type &stop_requested) const
|
||||
-> bool = 0;
|
||||
long &response_code,
|
||||
stop_type &stop_requested) const -> bool = 0;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
|
@ -94,7 +94,7 @@ private:
|
||||
bool shutdown_ = false;
|
||||
|
||||
private:
|
||||
static constexpr auto min_pool_size = 10U;
|
||||
static constexpr const auto min_pool_size = 10U;
|
||||
|
||||
public:
|
||||
void execute(const std::string &client_id, std::uint64_t thread_id,
|
||||
|
@ -54,13 +54,12 @@ REPERTORY_IGNORE_WARNINGS_DISABLE()
|
||||
using namespace std::chrono_literals;
|
||||
using json = nlohmann::json;
|
||||
|
||||
inline constexpr std::string_view REPERTORY{"repertory"};
|
||||
inline constexpr std::string_view REPERTORY_DATA_NAME{"repertory2"};
|
||||
inline constexpr std::wstring_view REPERTORY_W{L"repertory"};
|
||||
inline constexpr const std::string_view REPERTORY = "repertory";
|
||||
inline constexpr const std::wstring_view REPERTORY_W = L"repertory";
|
||||
|
||||
inline constexpr std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
|
||||
inline constexpr std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"};
|
||||
inline constexpr std::string_view RENTERD_MIN_VERSION{"2.0.0"};
|
||||
inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION = 0ULL;
|
||||
inline constexpr const std::string_view REPERTORY_DATA_NAME = "repertory2";
|
||||
inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION = "2.0.0";
|
||||
|
||||
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE
|
||||
|
||||
@ -222,27 +221,44 @@ using WCHAR = wchar_t;
|
||||
|
||||
#define MAX_PATH 260
|
||||
|
||||
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L}
|
||||
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L}
|
||||
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L}
|
||||
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L}
|
||||
#define STATUS_END_OF_FILE std::uint32_t{0xC0000011L}
|
||||
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL}
|
||||
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L}
|
||||
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL}
|
||||
#define STATUS_INTERNAL_ERROR std::uint32_t{0xC00000E5L}
|
||||
#define STATUS_INVALID_ADDRESS std::uint32_t{0xC0000141L}
|
||||
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L}
|
||||
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL}
|
||||
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL}
|
||||
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L}
|
||||
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L}
|
||||
#define STATUS_OBJECT_NAME_COLLISION std::uint32_t{0xC0000035L}
|
||||
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L}
|
||||
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L}
|
||||
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L}
|
||||
#define STATUS_SUCCESS std::uint32_t{0U}
|
||||
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L}
|
||||
#define STATUS_SUCCESS \
|
||||
std::uint32_t { 0U }
|
||||
#define STATUS_ACCESS_DENIED \
|
||||
std::uint32_t { 0xC0000022L }
|
||||
#define STATUS_DEVICE_BUSY \
|
||||
std::uint32_t { 0x80000011L }
|
||||
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES \
|
||||
std::uint32_t { 0xC0000468L }
|
||||
#define STATUS_DIRECTORY_NOT_EMPTY \
|
||||
std::uint32_t { 0xC0000101L }
|
||||
#define STATUS_FILE_IS_A_DIRECTORY \
|
||||
std::uint32_t { 0xC00000BAL }
|
||||
#define STATUS_FILE_TOO_LARGE \
|
||||
std::uint32_t { 0xC0000904L }
|
||||
#define STATUS_INSUFFICIENT_RESOURCES \
|
||||
std::uint32_t { 0xC000009AL }
|
||||
#define STATUS_INTERNAL_ERROR \
|
||||
std::uint32_t { 0xC00000E5L }
|
||||
#define STATUS_INVALID_ADDRESS \
|
||||
std::uint32_t { 0xC0000141L }
|
||||
#define STATUS_INVALID_HANDLE \
|
||||
std::uint32_t { 0xC0000006L }
|
||||
#define STATUS_INVALID_IMAGE_FORMAT \
|
||||
std::uint32_t { 0xC000007BL }
|
||||
#define STATUS_INVALID_PARAMETER \
|
||||
std::uint32_t { 0xC000000DL }
|
||||
#define STATUS_NO_MEMORY \
|
||||
std::uint32_t { 0xC0000017L }
|
||||
#define STATUS_NOT_IMPLEMENTED \
|
||||
std::uint32_t { 0xC0000002L }
|
||||
#define STATUS_OBJECT_NAME_EXISTS \
|
||||
std::uint32_t { 0x40000000L }
|
||||
#define STATUS_OBJECT_NAME_NOT_FOUND \
|
||||
std::uint32_t { 0xC0000034L }
|
||||
#define STATUS_OBJECT_PATH_INVALID \
|
||||
std::uint32_t { 0xC0000039L }
|
||||
#define STATUS_UNEXPECTED_IO_ERROR \
|
||||
std::uint32_t { 0xC00000E9L }
|
||||
|
||||
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \
|
||||
((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)
|
||||
|
@ -50,14 +50,14 @@ public:
|
||||
[[nodiscard]] auto fill_buffer(const remote::file_offset &offset,
|
||||
fuse_fill_dir_t filler_function, void *buffer,
|
||||
populate_stat_callback populate_stat) -> int;
|
||||
#endif // !defined(_WIN32)
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto get(std::size_t offset, std::string &item) -> int;
|
||||
|
||||
[[nodiscard]] auto get_count() const -> std::size_t { return items_.size(); }
|
||||
|
||||
[[nodiscard]] auto get_directory_item(std::size_t offset, directory_item &di)
|
||||
-> api_error;
|
||||
[[nodiscard]] auto get_directory_item(std::size_t offset,
|
||||
directory_item &di) -> api_error;
|
||||
|
||||
[[nodiscard]] auto get_directory_item(const std::string &api_path,
|
||||
directory_item &di) -> api_error;
|
||||
@ -71,8 +71,8 @@ public:
|
||||
auto operator=(const directory_iterator &iterator) noexcept
|
||||
-> directory_iterator &;
|
||||
|
||||
auto operator=(directory_iterator &&iterator) noexcept
|
||||
-> directory_iterator &;
|
||||
auto
|
||||
operator=(directory_iterator &&iterator) noexcept -> directory_iterator &;
|
||||
|
||||
auto operator=(directory_item_list list) noexcept -> directory_iterator &;
|
||||
};
|
||||
|
@ -61,7 +61,7 @@ private:
|
||||
static auto instance() -> fuse_base &;
|
||||
|
||||
private:
|
||||
struct fuse_operations fuse_ops_{};
|
||||
struct fuse_operations fuse_ops_ {};
|
||||
|
||||
private:
|
||||
[[nodiscard]] auto
|
||||
@ -78,9 +78,9 @@ private:
|
||||
static void execute_void_callback(std::string_view function_name,
|
||||
const std::function<void()> &cb);
|
||||
|
||||
static auto execute_void_pointer_callback(std::string_view function_name,
|
||||
const std::function<void *()> &cb)
|
||||
-> void *;
|
||||
static auto
|
||||
execute_void_pointer_callback(std::string_view function_name,
|
||||
const std::function<void *()> &cb) -> void *;
|
||||
|
||||
void raise_fuse_event(std::string_view function_name,
|
||||
std::string_view api_path, int ret,
|
||||
@ -91,22 +91,22 @@ private:
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto chflags_(const char *path, uint32_t flags) -> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto chmod_(const char *path, mode_t mode,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto chmod_(const char *path, mode_t mode) -> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] static auto chown_(const char *path, uid_t uid, gid_t gid)
|
||||
-> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#else
|
||||
[[nodiscard]] static auto chown_(const char *path, uid_t uid,
|
||||
gid_t gid) -> int;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto create_(const char *path, mode_t mode,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
@ -114,19 +114,19 @@ private:
|
||||
static void destroy_(void *ptr);
|
||||
|
||||
[[nodiscard]] static auto fallocate_(const char *path, int mode, off_t offset,
|
||||
off_t length, struct fuse_file_info *fi)
|
||||
-> int;
|
||||
off_t length,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
|
||||
#if FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] static auto fgetattr_(const char *path, struct stat *st,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#endif // FUSE_USE_VERSION < 30
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto fsetattr_x_(const char *path,
|
||||
struct setattr_x *attr,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] static auto fsync_(const char *path, int datasync,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
@ -137,27 +137,27 @@ private:
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto getattr_(const char *path, struct stat *st,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto getattr_(const char *path, struct stat *st) -> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto getxtimes_(const char *path,
|
||||
struct timespec *bkuptime,
|
||||
struct timespec *crtime) -> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto init_(struct fuse_conn_info *conn,
|
||||
struct fuse_config *cfg) -> void *;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto init_(struct fuse_conn_info *conn) -> void *;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto mkdir_(const char *path, mode_t mode) -> int;
|
||||
|
||||
[[nodiscard]] static auto open_(const char *path, struct fuse_file_info *fi)
|
||||
-> int;
|
||||
[[nodiscard]] static auto open_(const char *path,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
|
||||
[[nodiscard]] static auto opendir_(const char *path,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
@ -171,12 +171,12 @@ private:
|
||||
fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset, struct fuse_file_info *fi,
|
||||
fuse_readdir_flags flags) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto readdir_(const char *path, void *buf,
|
||||
fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset, struct fuse_file_info *fi)
|
||||
-> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
off_t offset,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto release_(const char *path,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
@ -187,9 +187,9 @@ private:
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto rename_(const char *from, const char *to,
|
||||
unsigned int flags) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto rename_(const char *from, const char *to) -> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto rmdir_(const char *path) -> int;
|
||||
|
||||
@ -199,36 +199,35 @@ private:
|
||||
char *value, size_t size,
|
||||
uint32_t position) -> int;
|
||||
|
||||
#else // !defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] static auto getxattr_(const char *path, const char *name,
|
||||
char *value, size_t size) -> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] static auto listxattr_(const char *path, char *buffer,
|
||||
size_t size) -> int;
|
||||
|
||||
[[nodiscard]] static auto removexattr_(const char *path, const char *name)
|
||||
-> int;
|
||||
[[nodiscard]] static auto removexattr_(const char *path,
|
||||
const char *name) -> int;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto setxattr_(const char *path, const char *name,
|
||||
const char *value, size_t size, int flags,
|
||||
uint32_t position) -> int;
|
||||
|
||||
#else // !defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] static auto setxattr_(const char *path, const char *name,
|
||||
const char *value, size_t size, int flags)
|
||||
-> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // defined(HAS_SETXATTR)
|
||||
const char *value, size_t size,
|
||||
int flags) -> int;
|
||||
#endif // __APPLE__
|
||||
#endif // HAS_SETXATTR
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto setattr_x_(const char *path, struct setattr_x *attr)
|
||||
-> int;
|
||||
[[nodiscard]] static auto setattr_x_(const char *path,
|
||||
struct setattr_x *attr) -> int;
|
||||
|
||||
[[nodiscard]] static auto setbkuptime_(const char *path,
|
||||
const struct timespec *bkuptime)
|
||||
-> int;
|
||||
[[nodiscard]] static auto
|
||||
setbkuptime_(const char *path, const struct timespec *bkuptime) -> int;
|
||||
|
||||
[[nodiscard]] static auto setchgtime_(const char *path,
|
||||
const struct timespec *chgtime) -> int;
|
||||
@ -238,20 +237,20 @@ private:
|
||||
|
||||
[[nodiscard]] static auto setvolname_(const char *volname) -> int;
|
||||
|
||||
[[nodiscard]] static auto statfs_x_(const char *path, struct statfs *stbuf)
|
||||
-> int;
|
||||
[[nodiscard]] static auto statfs_x_(const char *path,
|
||||
struct statfs *stbuf) -> int;
|
||||
|
||||
#else // !defined(__APPLE__)
|
||||
[[nodiscard]] static auto statfs_(const char *path, struct statvfs *stbuf)
|
||||
-> int;
|
||||
#endif // defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] static auto statfs_(const char *path,
|
||||
struct statvfs *stbuf) -> int;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] static auto truncate_(const char *path, off_t size,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto truncate_(const char *path, off_t size) -> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto unlink_(const char *path) -> int;
|
||||
|
||||
@ -259,18 +258,18 @@ private:
|
||||
[[nodiscard]] static auto utimens_(const char *path,
|
||||
const struct timespec tv[2],
|
||||
struct fuse_file_info *fi) -> int;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] static auto utimens_(const char *path,
|
||||
const struct timespec tv[2]) -> int;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] static auto write_(const char *path, const char *buffer,
|
||||
size_t write_size, off_t write_offset,
|
||||
struct fuse_file_info *fi) -> int;
|
||||
|
||||
protected:
|
||||
[[nodiscard]] virtual auto access_impl(std::string /*api_path*/, int /*mask*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto access_impl(std::string /*api_path*/,
|
||||
int /*mask*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -279,40 +278,37 @@ protected:
|
||||
uint32_t /*flags*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
|
||||
mode_t /*mode*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
chmod_impl(std::string /*api_path*/, mode_t /*mode*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else //FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] virtual auto chmod_impl(std::string /*api_path*/,
|
||||
mode_t /*mode*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
|
||||
gid_t /*gid*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
chown_impl(std::string /*api_path*/, uid_t /*uid*/, gid_t /*gid*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] virtual auto chown_impl(std::string /*api_path*/, uid_t /*uid*/,
|
||||
gid_t /*gid*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto create_impl(std::string /*api_path*/,
|
||||
mode_t /*mode*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
create_impl(std::string /*api_path*/, mode_t /*mode*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -320,87 +316,81 @@ protected:
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/,
|
||||
off_t /*length*/, struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
off_t /*length*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto fgetattr_impl(std::string /*api_path*/,
|
||||
struct stat * /*st*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
fgetattr_impl(std::string /*api_path*/, struct stat * /*st*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] virtual auto fsetattr_x_impl(std::string /*api_path*/,
|
||||
struct setattr_x * /*attr*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
fsetattr_x_impl(std::string /*api_path*/, struct setattr_x * /*attr*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] virtual auto fsync_impl(std::string /*api_path*/,
|
||||
int /*datasync*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
fsync_impl(std::string /*api_path*/, int /*datasync*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
#if FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] virtual auto ftruncate_impl(std::string /*api_path*/,
|
||||
off_t /*size*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
ftruncate_impl(std::string /*api_path*/, off_t /*size*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION < 30
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
|
||||
struct stat * /*st*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
getattr_impl(std::string /*api_path*/, struct stat * /*st*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] virtual auto getattr_impl(std::string /*api_path*/,
|
||||
struct stat * /*st*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] virtual auto getxtimes_impl(std::string /*api_path*/,
|
||||
struct timespec * /*bkuptime*/,
|
||||
struct timespec * /*crtime*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
getxtimes_impl(std::string /*api_path*/, struct timespec * /*bkuptime*/,
|
||||
struct timespec * /*crtime*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
virtual auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
|
||||
-> void *;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
virtual auto init_impl(struct fuse_conn_info *conn,
|
||||
struct fuse_config *cfg) -> void *;
|
||||
#else
|
||||
virtual auto init_impl(struct fuse_conn_info *conn) -> void *;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto mkdir_impl(std::string /*api_path*/,
|
||||
mode_t /*mode*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto open_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
open_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto opendir_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
opendir_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -415,28 +405,28 @@ protected:
|
||||
[[nodiscard]] virtual auto
|
||||
readdir_impl(std::string /*api_path*/, void * /*buf*/,
|
||||
fuse_fill_dir_t /*fuse_fill_dir*/, off_t /*offset*/,
|
||||
struct fuse_file_info * /*fi*/, fuse_readdir_flags /*flags*/)
|
||||
-> api_error {
|
||||
struct fuse_file_info * /*fi*/,
|
||||
fuse_readdir_flags /*flags*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] virtual auto
|
||||
readdir_impl(std::string /*api_path*/, void * /*buf*/,
|
||||
fuse_fill_dir_t /*fuse_fill_dir*/, off_t /*offset*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto release_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
release_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto releasedir_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
releasedir_impl(std::string /*api_path*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -446,13 +436,13 @@ protected:
|
||||
unsigned int /*flags*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] virtual auto rename_impl(std::string /*from_api_path*/,
|
||||
std::string /*to_api_path*/)
|
||||
-> api_error {
|
||||
#else
|
||||
[[nodiscard]] virtual auto
|
||||
rename_impl(std::string /*from_api_path*/,
|
||||
std::string /*to_api_path*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto rmdir_impl(std::string /*api_path*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
@ -466,14 +456,14 @@ protected:
|
||||
int & /*attribute_size*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // !defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] virtual auto
|
||||
getxattr_impl(std::string /*api_path*/, const char * /*name*/,
|
||||
char * /*value*/, size_t /*size*/, int & /*attribute_size*/)
|
||||
-> api_error {
|
||||
char * /*value*/, size_t /*size*/,
|
||||
int & /*attribute_size*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
listxattr_impl(std::string /*api_path*/, char * /*buffer*/, size_t /*size*/,
|
||||
@ -481,9 +471,9 @@ protected:
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto removexattr_impl(std::string /*api_path*/,
|
||||
const char * /*name*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
removexattr_impl(std::string /*api_path*/,
|
||||
const char * /*name*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -495,20 +485,21 @@ protected:
|
||||
uint32_t /*position*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // !defined (__APPLE__)
|
||||
[[nodiscard]] virtual auto
|
||||
setxattr_impl(std::string /*api_path*/, const char * /*name*/,
|
||||
const char * /*value*/, size_t /*size*/, int /*flags*/)
|
||||
-> api_error {
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] virtual auto setxattr_impl(std::string /*api_path*/,
|
||||
const char * /*name*/,
|
||||
const char * /*value*/,
|
||||
size_t /*size*/,
|
||||
int /*flags*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined (__APPLE__)
|
||||
#endif // defined(HAS_SETXATTR)
|
||||
#endif // __APPLE__
|
||||
#endif // HAS_SETXATTR
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] virtual auto setattr_x_impl(std::string /*api_path*/,
|
||||
struct setattr_x * /*attr*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
setattr_x_impl(std::string /*api_path*/,
|
||||
struct setattr_x * /*attr*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -519,74 +510,72 @@ protected:
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
setchgtime_impl(std::string /*api_path*/, const struct timespec * /*chgtime*/)
|
||||
-> api_error {
|
||||
setchgtime_impl(std::string /*api_path*/,
|
||||
const struct timespec * /*chgtime*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto setcrtime_impl(std::string /*api_path*/,
|
||||
const struct timespec * /*crtime*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
setcrtime_impl(std::string /*api_path*/,
|
||||
const struct timespec * /*crtime*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto setvolname_impl(const char * /*volname*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
setvolname_impl(const char * /*volname*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
[[nodiscard]] virtual auto statfs_x_impl(std::string /*api_path*/,
|
||||
struct statfs * /*stbuf*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
statfs_x_impl(std::string /*api_path*/,
|
||||
struct statfs * /*stbuf*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // !defined(__APPLE__)
|
||||
[[nodiscard]] virtual auto statfs_impl(std::string /*api_path*/,
|
||||
struct statvfs * /*stbuf*/)
|
||||
-> api_error {
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] virtual auto
|
||||
statfs_impl(std::string /*api_path*/,
|
||||
struct statvfs * /*stbuf*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
|
||||
off_t /*size*/,
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
truncate_impl(std::string /*api_path*/, off_t /*size*/,
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
#else
|
||||
[[nodiscard]] virtual auto truncate_impl(std::string /*api_path*/,
|
||||
off_t /*size*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto unlink_impl(std::string /*api_path*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
unlink_impl(std::string /*api_path*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
|
||||
const struct timespec /*tv*/[2],
|
||||
struct fuse_file_info * /*fi*/)
|
||||
-> api_error {
|
||||
[[nodiscard]] virtual auto
|
||||
utimens_impl(std::string /*api_path*/, const struct timespec /*tv*/[2],
|
||||
struct fuse_file_info * /*fi*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] virtual auto utimens_impl(std::string /*api_path*/,
|
||||
const struct timespec /*tv*/[2])
|
||||
-> api_error {
|
||||
#else
|
||||
[[nodiscard]] virtual auto
|
||||
utimens_impl(std::string /*api_path*/,
|
||||
const struct timespec /*tv*/[2]) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
write_impl(std::string /*api_path*/, const char * /*buffer*/,
|
||||
size_t /*write_size*/, off_t /*write_offset*/,
|
||||
struct fuse_file_info * /*fi*/, std::size_t & /*bytes_written*/)
|
||||
-> api_error {
|
||||
struct fuse_file_info * /*fi*/,
|
||||
std::size_t & /*bytes_written*/) -> api_error {
|
||||
return api_error::not_implemented;
|
||||
}
|
||||
|
||||
@ -614,5 +603,5 @@ public:
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // !defined(_WIN32)
|
||||
#endif // _WIN32
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_BASE_HPP_
|
||||
|
@ -73,95 +73,92 @@ private:
|
||||
|
||||
protected:
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto chflags_impl(std::string api_path, uint32_t flags)
|
||||
-> api_error override;
|
||||
#endif // defined(__APPLE__{}
|
||||
[[nodiscard]] auto chflags_impl(std::string api_path,
|
||||
uint32_t flags) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chmod_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chmod_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
chown_impl(std::string api_path, uid_t uid, gid_t gid,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid,
|
||||
gid_t gid) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto create_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
create_impl(std::string api_path, mode_t mode,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
void destroy_impl(void *ptr) override;
|
||||
|
||||
[[nodiscard]] auto fallocate_impl(std::string api_path, int mode,
|
||||
off_t offset, off_t length,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
fallocate_impl(std::string api_path, int mode, off_t offset, off_t length,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto fgetattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
fgetattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto fsetattr_x_impl(std::string api_path,
|
||||
struct setattr_x *attr,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#endif // defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
fsetattr_x_impl(std::string api_path, struct setattr_x *attr,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] auto fsync_impl(std::string api_path, int datasync,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
fsync_impl(std::string api_path, int datasync,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto
|
||||
ftruncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
getattr_impl(std::string api_path, struct stat *unix_st,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto getattr_impl(std::string api_path,
|
||||
struct stat *unix_st) -> api_error override;
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto getxtimes_impl(std::string api_path,
|
||||
struct timespec *bkuptime,
|
||||
struct timespec *crtime)
|
||||
-> api_error override;
|
||||
#endif // defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
getxtimes_impl(std::string api_path, struct timespec *bkuptime,
|
||||
struct timespec *crtime) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
auto init_impl(struct fuse_conn_info *conn, struct fuse_config *cfg)
|
||||
-> void * override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
auto init_impl(struct fuse_conn_info *conn,
|
||||
struct fuse_config *cfg) -> void * override;
|
||||
#else
|
||||
auto init_impl(struct fuse_conn_info *conn) -> void * override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto mkdir_impl(std::string api_path, mode_t mode)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto mkdir_impl(std::string api_path,
|
||||
mode_t mode) -> api_error override;
|
||||
|
||||
void notify_fuse_main_exit(int &ret) override;
|
||||
|
||||
[[nodiscard]] auto open_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
open_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto opendir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
opendir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto read_impl(std::string api_path, char *buffer,
|
||||
size_t read_size, off_t read_offset,
|
||||
@ -169,124 +166,121 @@ protected:
|
||||
std::size_t &bytes_read) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
|
||||
fuse_fill_dir_t fuse_fill_dir, off_t offset,
|
||||
struct fuse_file_info *file_info,
|
||||
fuse_readdir_flags flags)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
|
||||
fuse_fill_dir_t fuse_fill_dir, off_t offset,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset, struct fuse_file_info *file_info,
|
||||
fuse_readdir_flags flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
readdir_impl(std::string api_path, void *buf, fuse_fill_dir_t fuse_fill_dir,
|
||||
off_t offset,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto release_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
release_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto releasedir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
releasedir_impl(std::string api_path,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path, unsigned int flags)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
std::string to_api_path,
|
||||
unsigned int flags) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto rename_impl(std::string from_api_path,
|
||||
std::string to_api_path) -> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto rmdir_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if defined(HAS_SETXATTR)
|
||||
[[nodiscard]] auto getxattr_common(std::string api_path, const char *name,
|
||||
char *value, size_t size,
|
||||
int &attribute_size, uint32_t *position)
|
||||
-> api_error;
|
||||
int &attribute_size,
|
||||
uint32_t *position) -> api_error;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
|
||||
char *value, size_t size, uint32_t position,
|
||||
int &attribute_size) -> api_error override;
|
||||
#else // !defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto getxattr_impl(std::string api_path, const char *name,
|
||||
char *value, size_t size,
|
||||
int &attribute_size) -> api_error override;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] auto listxattr_impl(std::string api_path, char *buffer,
|
||||
size_t size, int &required_size,
|
||||
bool &return_size) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto removexattr_impl(std::string api_path, const char *name)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto removexattr_impl(std::string api_path,
|
||||
const char *name) -> api_error override;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
|
||||
const char *value, size_t size, int flags,
|
||||
uint32_t position) -> api_error override;
|
||||
#else // !defined(__APPLE__)
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto setxattr_impl(std::string api_path, const char *name,
|
||||
const char *value, size_t size, int flags)
|
||||
-> api_error override;
|
||||
#endif // defined(__APPLE__)
|
||||
#endif // defined(HAS_SETXATTR{}
|
||||
const char *value, size_t size,
|
||||
int flags) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
#endif // HAS_SETXATTR
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto setattr_x_impl(std::string api_path,
|
||||
struct setattr_x *attr)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
setattr_x_impl(std::string api_path,
|
||||
struct setattr_x *attr) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto setbkuptime_impl(std::string api_path,
|
||||
const struct timespec *bkuptime)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
setbkuptime_impl(std::string api_path,
|
||||
const struct timespec *bkuptime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto setchgtime_impl(std::string api_path,
|
||||
const struct timespec *chgtime)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
setchgtime_impl(std::string api_path,
|
||||
const struct timespec *chgtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto setcrtime_impl(std::string api_path,
|
||||
const struct timespec *crtime)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
setcrtime_impl(std::string api_path,
|
||||
const struct timespec *crtime) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto setvolname_impl(const char *volname) -> api_error override;
|
||||
|
||||
[[nodiscard]] auto statfs_x_impl(std::string api_path, struct statfs *stbuf)
|
||||
-> api_error override;
|
||||
#else // !defined(__APPLE__)
|
||||
[[nodiscard]] auto statfs_impl(std::string api_path, struct statvfs *stbuf)
|
||||
-> api_error override;
|
||||
#endif // defined(__APPLE__)
|
||||
[[nodiscard]] auto statfs_x_impl(std::string api_path,
|
||||
struct statfs *stbuf) -> api_error override;
|
||||
#else // __APPLE__
|
||||
[[nodiscard]] auto statfs_impl(std::string api_path,
|
||||
struct statvfs *stbuf) -> api_error override;
|
||||
#endif // __APPLE__
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size)
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
truncate_impl(std::string api_path, off_t size,
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto truncate_impl(std::string api_path,
|
||||
off_t size) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto unlink_impl(std::string api_path) -> api_error override;
|
||||
|
||||
#if FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto utimens_impl(std::string api_path,
|
||||
const struct timespec tv[2],
|
||||
struct fuse_file_info *file_info)
|
||||
-> api_error override;
|
||||
#else // FUSE_USE_VERSION < 30
|
||||
[[nodiscard]] auto utimens_impl(std::string api_path,
|
||||
const struct timespec tv[2])
|
||||
-> api_error override;
|
||||
#endif // FUSE_USE_VERSION >= 30
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path, const struct timespec tv[2],
|
||||
struct fuse_file_info *file_info) -> api_error override;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
utimens_impl(std::string api_path,
|
||||
const struct timespec tv[2]) -> api_error override;
|
||||
#endif
|
||||
|
||||
[[nodiscard]] auto write_impl(std::string api_path, const char *buffer,
|
||||
size_t write_size, off_t write_offset,
|
||||
struct fuse_file_info *file_info,
|
||||
std::size_t &bytes_written)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
write_impl(std::string api_path, const char *buffer, size_t write_size,
|
||||
off_t write_offset, struct fuse_file_info *file_info,
|
||||
std::size_t &bytes_written) -> api_error override;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto get_directory_item_count(const std::string &api_path) const
|
||||
@ -295,17 +289,16 @@ public:
|
||||
[[nodiscard]] auto get_directory_items(const std::string &api_path) const
|
||||
-> directory_item_list override;
|
||||
|
||||
[[nodiscard]] auto get_file_size(const std::string &api_path) const
|
||||
-> std::uint64_t override;
|
||||
[[nodiscard]] auto
|
||||
get_file_size(const std::string &api_path) const -> std::uint64_t override;
|
||||
|
||||
[[nodiscard]] auto get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const -> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_item_meta(const std::string &api_path,
|
||||
const std::string &name,
|
||||
std::string &value) const
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
get_item_meta(const std::string &api_path, const std::string &name,
|
||||
std::string &value) const -> api_error override;
|
||||
|
||||
[[nodiscard]] auto get_total_drive_space() const -> std::uint64_t override;
|
||||
|
||||
@ -316,24 +309,21 @@ public:
|
||||
void get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label) const override;
|
||||
|
||||
[[nodiscard]] auto is_processing(const std::string &api_path) const
|
||||
-> bool override;
|
||||
[[nodiscard]] auto
|
||||
is_processing(const std::string &api_path) const -> bool override;
|
||||
|
||||
[[nodiscard]] auto rename_directory(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> int override;
|
||||
[[nodiscard]] auto
|
||||
rename_directory(const std::string &from_api_path,
|
||||
const std::string &to_api_path) -> int override;
|
||||
|
||||
[[nodiscard]] auto rename_file(const std::string &from_api_path,
|
||||
const std::string &to_api_path, bool overwrite)
|
||||
-> int override;
|
||||
const std::string &to_api_path,
|
||||
bool overwrite) -> int override;
|
||||
|
||||
void set_item_meta(const std::string &api_path, const std::string &key,
|
||||
const std::string &value) override;
|
||||
|
||||
void set_item_meta(const std::string &api_path,
|
||||
const api_meta_map &meta) override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // !defined(_WIN32)
|
||||
#endif // _WIN32
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_HPP_
|
||||
|
@ -43,17 +43,16 @@ public:
|
||||
auto operator=(fuse_drive_base &&) -> fuse_drive_base & = delete;
|
||||
|
||||
protected:
|
||||
[[nodiscard]] auto access_impl(std::string api_path, int mask)
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto access_impl(std::string api_path,
|
||||
int mask) -> api_error override;
|
||||
|
||||
protected:
|
||||
[[nodiscard]] auto check_access(const std::string &api_path, int mask) const
|
||||
-> api_error;
|
||||
[[nodiscard]] auto check_access(const std::string &api_path,
|
||||
int mask) const -> api_error;
|
||||
|
||||
[[nodiscard]] auto
|
||||
check_and_perform(const std::string &api_path, int parent_mask,
|
||||
const std::function<api_error(api_meta_map &meta)> &action)
|
||||
-> api_error;
|
||||
[[nodiscard]] auto check_and_perform(
|
||||
const std::string &api_path, int parent_mask,
|
||||
const std::function<api_error(api_meta_map &meta)> &action) -> api_error;
|
||||
|
||||
[[nodiscard]] auto get_current_gid() const -> gid_t;
|
||||
|
||||
@ -63,63 +62,58 @@ protected:
|
||||
|
||||
[[nodiscard]] auto get_effective_uid() const -> uid_t;
|
||||
|
||||
[[nodiscard]] static auto check_open_flags(int flags, int mask,
|
||||
const api_error &fail_error)
|
||||
-> api_error;
|
||||
[[nodiscard]] static auto
|
||||
check_open_flags(int flags, int mask,
|
||||
const api_error &fail_error) -> api_error;
|
||||
|
||||
[[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error;
|
||||
|
||||
[[nodiscard]] static auto check_readable(int flags,
|
||||
const api_error &fail_error)
|
||||
-> api_error;
|
||||
[[nodiscard]] static auto
|
||||
check_readable(int flags, const api_error &fail_error) -> api_error;
|
||||
|
||||
[[nodiscard]] static auto check_writeable(int flags,
|
||||
const api_error &fail_error)
|
||||
-> api_error;
|
||||
[[nodiscard]] static auto
|
||||
check_writeable(int flags, const api_error &fail_error) -> api_error;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] static auto get_flags_from_meta(const api_meta_map &meta)
|
||||
-> __uint32_t;
|
||||
#endif // defined(__APPLE__)
|
||||
[[nodiscard]] static auto
|
||||
get_flags_from_meta(const api_meta_map &meta) -> __uint32_t;
|
||||
#endif // __APPLE__
|
||||
|
||||
[[nodiscard]] static auto get_gid_from_meta(const api_meta_map &meta)
|
||||
-> gid_t;
|
||||
[[nodiscard]] static auto
|
||||
get_gid_from_meta(const api_meta_map &meta) -> gid_t;
|
||||
|
||||
[[nodiscard]] static auto get_mode_from_meta(const api_meta_map &meta)
|
||||
-> mode_t;
|
||||
[[nodiscard]] static auto
|
||||
get_mode_from_meta(const api_meta_map &meta) -> mode_t;
|
||||
|
||||
static void get_timespec_from_meta(const api_meta_map &meta,
|
||||
const std::string &name,
|
||||
struct timespec &ts);
|
||||
|
||||
[[nodiscard]] static auto get_uid_from_meta(const api_meta_map &meta)
|
||||
-> uid_t;
|
||||
[[nodiscard]] static auto
|
||||
get_uid_from_meta(const api_meta_map &meta) -> uid_t;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto parse_xattr_parameters(const char *name,
|
||||
const uint32_t &position,
|
||||
std::string &attribute_name,
|
||||
const std::string &api_path)
|
||||
-> api_error;
|
||||
#else // !defined(__APPLE__)
|
||||
[[nodiscard]] auto parse_xattr_parameters(const char *name,
|
||||
std::string &attribute_name,
|
||||
const std::string &api_path)
|
||||
-> api_error;
|
||||
#endif // defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
parse_xattr_parameters(const char *name, const uint32_t &position,
|
||||
std::string &attribute_name,
|
||||
const std::string &api_path) -> api_error;
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
parse_xattr_parameters(const char *name, std::string &attribute_name,
|
||||
const std::string &api_path) -> api_error;
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
[[nodiscard]] auto
|
||||
parse_xattr_parameters(const char *name, const char *value, size_t size,
|
||||
const uint32_t &position, std::string &attribute_name,
|
||||
const std::string &api_path) -> api_error;
|
||||
#else // !defined(__APPLE__)
|
||||
[[nodiscard]] auto parse_xattr_parameters(const char *name, const char *value,
|
||||
size_t size,
|
||||
std::string &attribute_name,
|
||||
const std::string &api_path)
|
||||
-> api_error;
|
||||
#endif // defined(__APPLE__)
|
||||
#else
|
||||
[[nodiscard]] auto
|
||||
parse_xattr_parameters(const char *name, const char *value, size_t size,
|
||||
std::string &attribute_name,
|
||||
const std::string &api_path) -> api_error;
|
||||
#endif
|
||||
|
||||
static void populate_stat(const std::string &api_path,
|
||||
std::uint64_t size_or_count,
|
||||
@ -131,13 +125,13 @@ protected:
|
||||
struct timespec &ts);
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto check_owner(const std::string &api_path) const
|
||||
-> api_error override;
|
||||
[[nodiscard]] auto
|
||||
check_owner(const std::string &api_path) const -> api_error override;
|
||||
|
||||
[[nodiscard]] auto check_parent_access(const std::string &api_path,
|
||||
int mask) const -> api_error override;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // !defined(_WIN32)
|
||||
#endif // _WIN32
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_FUSE_DRIVE_BASE_HPP_
|
||||
|
@ -30,32 +30,29 @@ class i_fuse_drive {
|
||||
INTERFACE_SETUP(i_fuse_drive);
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto check_owner(const std::string &api_path) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto check_parent_access(const std::string &api_path,
|
||||
int mask) const
|
||||
-> api_error = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
check_owner(const std::string &api_path) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_directory_item_count(const std::string &api_path) const
|
||||
-> std::uint64_t = 0;
|
||||
check_parent_access(const std::string &api_path,
|
||||
int mask) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_directory_item_count(
|
||||
const std::string &api_path) const -> std::uint64_t = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_directory_items(
|
||||
const std::string &api_path) const -> directory_item_list = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
get_directory_items(const std::string &api_path) const
|
||||
-> directory_item_list = 0;
|
||||
get_file_size(const std::string &api_path) const -> std::uint64_t = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_file_size(const std::string &api_path) const
|
||||
-> std::uint64_t = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
|
||||
api_meta_map &meta) const
|
||||
-> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_item_meta(const std::string &api_path,
|
||||
const std::string &name,
|
||||
std::string &value) const
|
||||
-> api_error = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
get_item_meta(const std::string &api_path, const std::string &name,
|
||||
std::string &value) const -> api_error = 0;
|
||||
|
||||
[[nodiscard]] virtual auto get_total_drive_space() const -> std::uint64_t = 0;
|
||||
|
||||
@ -66,12 +63,12 @@ public:
|
||||
virtual void get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label) const = 0;
|
||||
|
||||
[[nodiscard]] virtual auto is_processing(const std::string &api_path) const
|
||||
-> bool = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
is_processing(const std::string &api_path) const -> bool = 0;
|
||||
|
||||
[[nodiscard]] virtual auto rename_directory(const std::string &from_api_path,
|
||||
const std::string &to_api_path)
|
||||
-> int = 0;
|
||||
[[nodiscard]] virtual auto
|
||||
rename_directory(const std::string &from_api_path,
|
||||
const std::string &to_api_path) -> int = 0;
|
||||
|
||||
[[nodiscard]] virtual auto rename_file(const std::string &from_api_path,
|
||||
const std::string &to_api_path,
|
||||
@ -80,11 +77,8 @@ public:
|
||||
virtual void set_item_meta(const std::string &api_path,
|
||||
const std::string &key,
|
||||
const std::string &value) = 0;
|
||||
|
||||
virtual void set_item_meta(const std::string &api_path,
|
||||
const api_meta_map &meta) = 0;
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // !defined(_WIN32)
|
||||
#endif
|
||||
#endif // REPERTORY_INCLUDE_DRIVES_FUSE_I_FUSE_DRIVE_HPP_
|
||||
|
@ -38,12 +38,10 @@ public:
|
||||
private:
|
||||
const app_config &config_;
|
||||
packet_client packet_client_;
|
||||
remote::user_id uid_{0};
|
||||
remote::group_id gid_{0};
|
||||
remote::user_id uid_ = 0;
|
||||
remote::group_id gid_ = 0;
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto check() -> packet::error_type;
|
||||
|
||||
[[nodiscard]] auto fuse_access(const char *path, const std::int32_t &mask)
|
||||
-> packet::error_type override;
|
||||
|
||||
@ -53,9 +51,9 @@ public:
|
||||
[[nodiscard]] auto fuse_chmod(const char *path, const remote::file_mode &mode)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_chown(const char *path, const remote::user_id &uid,
|
||||
const remote::group_id &gid)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_chown(const char *path, const remote::user_id &uid,
|
||||
const remote::group_id &gid) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_destroy() -> packet::error_type override;
|
||||
|
||||
@ -69,23 +67,21 @@ public:
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_fsetattr_x(const char *path,
|
||||
const remote::setattr_x &attr,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto fuse_fsetattr_x(
|
||||
const char *path, const remote::setattr_x &attr,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_fsync(const char *path, const std::int32_t &datasync,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_fsync(const char *path, const std::int32_t &datasync,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_ftruncate(const char *path,
|
||||
const remote::file_offset &size,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto fuse_ftruncate(
|
||||
const char *path, const remote::file_offset &size,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_getattr(const char *path, remote::stat &st,
|
||||
bool &directory)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_getattr(const char *path, remote::stat &st,
|
||||
bool &directory) -> packet::error_type override;
|
||||
|
||||
/*[[nodiscard]] packet::error_type fuse_getxattr(const char *path, const char
|
||||
*name, char *value, const remote::file_size &size) override ;
|
||||
@ -94,10 +90,9 @@ public:
|
||||
*name, char *value, const remote::file_size &size, std::uint32_t position)
|
||||
override ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_getxtimes(const char *path,
|
||||
remote::file_time &bkuptime,
|
||||
remote::file_time &crtime)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_getxtimes(const char *path, remote::file_time &bkuptime,
|
||||
remote::file_time &crtime) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_init() -> packet::error_type override;
|
||||
|
||||
@ -112,27 +107,25 @@ public:
|
||||
|
||||
[[nodiscard]] auto
|
||||
fuse_create(const char *path, const remote::file_mode &mode,
|
||||
const remote::open_flags &flags, remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
const remote::open_flags &flags,
|
||||
remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_open(const char *path,
|
||||
const remote::open_flags &flags,
|
||||
remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_open(const char *path, const remote::open_flags &flags,
|
||||
remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_read(const char *path, char *buffer,
|
||||
const remote::file_size &read_size,
|
||||
const remote::file_offset &read_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_read(const char *path, char *buffer, const remote::file_size &read_size,
|
||||
const remote::file_offset &read_offset,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_rename(const char *from, const char *to)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto fuse_rename(const char *from,
|
||||
const char *to) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fuse_readdir(const char *path, const remote::file_offset &offset,
|
||||
const remote::file_handle &handle, std::string &item_path)
|
||||
-> packet::error_type override;
|
||||
const remote::file_handle &handle,
|
||||
std::string &item_path) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_release(const char *path,
|
||||
const remote::file_handle &handle)
|
||||
@ -146,8 +139,8 @@ public:
|
||||
* char *name) override
|
||||
* ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_rmdir(const char *path)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_rmdir(const char *path) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
|
||||
-> packet::error_type override;
|
||||
@ -164,8 +157,8 @@ public:
|
||||
const remote::file_time &crtime)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setvolname(const char *volname)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_setvolname(const char *volname) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] /*packet::error_type fuse_setxattr(const char *path, const char
|
||||
*name, const char *value, const remote::file_size &size, const std::int32_t
|
||||
@ -176,48 +169,45 @@ public:
|
||||
std::int32_t &flags, std::uint32_t position) override ;*/
|
||||
|
||||
[[nodiscard]] auto
|
||||
fuse_statfs(const char *path, std::uint64_t frsize, remote::statfs &st)
|
||||
-> packet::error_type override;
|
||||
fuse_statfs(const char *path, std::uint64_t frsize,
|
||||
remote::statfs &st) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
remote::statfs_x &st)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
remote::statfs_x &st) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_truncate(const char *path,
|
||||
const remote::file_offset &size)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_truncate(const char *path,
|
||||
const remote::file_offset &size) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_unlink(const char *path)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_unlink(const char *path) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_utimens(const char *path, const remote::file_time *tv,
|
||||
std::uint64_t op0, std::uint64_t op1)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_utimens(const char *path, const remote::file_time *tv, std::uint64_t op0,
|
||||
std::uint64_t op1) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_write(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto
|
||||
fuse_write(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_write_base64(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto fuse_write_base64(
|
||||
const char *path, const char *buffer, const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
|
||||
json &json_data)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto json_create_directory_snapshot(
|
||||
const std::string &path, json &json_data) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto json_read_directory_snapshot(
|
||||
const std::string &path, const remote::file_handle &handle,
|
||||
std::uint32_t page, json &json_data) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
json_release_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
[[nodiscard]] auto json_release_directory_snapshot(
|
||||
const std::string &path,
|
||||
const remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
void set_fuse_uid_gid(const remote::user_id &uid,
|
||||
const remote::group_id &gid) override;
|
||||
|
@ -59,8 +59,7 @@ private:
|
||||
|
||||
static void populate_stat(const struct stat64 &unix_st, remote::stat &r_stat);
|
||||
|
||||
[[nodiscard]] auto update_to_windows_format(const std::string &root_api_path,
|
||||
json &item) -> json &;
|
||||
[[nodiscard]] auto update_to_windows_format(json &item) -> json &;
|
||||
|
||||
public:
|
||||
// FUSE Layer
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,92 +29,87 @@ class i_remote_instance : public virtual i_remote_json {
|
||||
INTERFACE_SETUP(i_remote_instance);
|
||||
|
||||
public:
|
||||
[[nodiscard]] virtual auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
virtual auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
|
||||
UINT32 flags, BOOLEAN &was_deleted)
|
||||
virtual auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags,
|
||||
BOOLEAN &was_deleted) -> packet::error_type = 0;
|
||||
|
||||
virtual auto winfsp_close(PVOID file_desc) -> packet::error_type = 0;
|
||||
|
||||
virtual auto winfsp_create(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, UINT32 file_attributes,
|
||||
UINT64 allocation_size, PVOID *file_desc,
|
||||
remote::file_info *file_info,
|
||||
std::string &normalized_name, BOOLEAN &exists)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_close(PVOID file_desc)
|
||||
virtual auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
|
||||
UINT32 file_attributes, UINT64 allocation_size,
|
||||
PVOID *file_desc, remote::file_info *file_info,
|
||||
std::string &normalized_name, BOOLEAN &exists)
|
||||
virtual auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_flush(PVOID file_desc,
|
||||
remote::file_info *file_info)
|
||||
virtual auto winfsp_get_file_info(PVOID file_desc,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_get_file_info(PVOID file_desc,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
virtual auto
|
||||
winfsp_get_security_by_name(PWSTR file_name, PUINT32 file_attributes,
|
||||
std::uint64_t *security_descriptor_size,
|
||||
std::wstring &str_descriptor)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_get_volume_info(UINT64 &total_size,
|
||||
UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
virtual auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_mounted(const std::wstring &location)
|
||||
virtual auto winfsp_mounted(const std::wstring &location)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
winfsp_open(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
|
||||
PVOID *file_desc, remote::file_info *file_info,
|
||||
std::string &normalized_name) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
winfsp_overwrite(PVOID file_desc, UINT32 file_attributes,
|
||||
BOOLEAN replace_file_attributes, UINT64 allocation_size,
|
||||
remote::file_info *file_info) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_read(PVOID file_desc, PVOID buffer,
|
||||
UINT64 offset, UINT32 length,
|
||||
PUINT32 bytes_transferred)
|
||||
virtual auto winfsp_open(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, PVOID *file_desc,
|
||||
remote::file_info *file_info,
|
||||
std::string &normalized_name)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_read_directory(PVOID file_desc,
|
||||
PWSTR pattern, PWSTR marker,
|
||||
json &itemList)
|
||||
virtual auto winfsp_overwrite(PVOID file_desc, UINT32 file_attributes,
|
||||
BOOLEAN replace_file_attributes,
|
||||
UINT64 allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_rename(PVOID file_desc, PWSTR file_name,
|
||||
PWSTR new_file_name,
|
||||
BOOLEAN replace_if_exists)
|
||||
virtual auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset,
|
||||
UINT32 length, PUINT32 bytes_transferred)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
winfsp_set_basic_info(PVOID file_desc, UINT32 file_attributes,
|
||||
UINT64 creation_time, UINT64 last_access_time,
|
||||
UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info) -> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_set_file_size(PVOID file_desc,
|
||||
UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
virtual auto winfsp_read_directory(PVOID file_desc, PWSTR pattern,
|
||||
PWSTR marker, json &itemList)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto winfsp_unmounted(const std::wstring &location)
|
||||
virtual auto winfsp_rename(PVOID file_desc, PWSTR file_name,
|
||||
PWSTR new_file_name, BOOLEAN replace_if_exists)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
[[nodiscard]] virtual auto
|
||||
winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
BOOLEAN write_to_end, BOOLEAN constrained_io,
|
||||
PUINT32 bytes_transferred, remote::file_info *file_info)
|
||||
virtual auto winfsp_set_basic_info(PVOID file_desc, UINT32 file_attributes,
|
||||
UINT64 creation_time,
|
||||
UINT64 last_access_time,
|
||||
UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
virtual auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
virtual auto winfsp_unmounted(const std::wstring &location)
|
||||
-> packet::error_type = 0;
|
||||
|
||||
virtual auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset,
|
||||
UINT32 length, BOOLEAN write_to_end,
|
||||
BOOLEAN constrained_io, PUINT32 bytes_transferred,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type = 0;
|
||||
};
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "comm/packet/packet_client.hpp"
|
||||
#include "drives/remote/remote_open_file_table.hpp"
|
||||
#include "drives/winfsp/remotewinfsp/i_remote_instance.hpp"
|
||||
#include "types/remote.hpp"
|
||||
|
||||
namespace repertory {
|
||||
class app_config;
|
||||
@ -44,105 +43,93 @@ private:
|
||||
#if defined(_WIN32)
|
||||
#define to_handle(x) (x)
|
||||
#else // !defined(_WIN32)
|
||||
[[nodiscard]] static auto to_handle(PVOID file_desc) -> native_handle;
|
||||
static auto to_handle(PVOID file_desc) -> native_handle;
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto check() -> packet::error_type;
|
||||
|
||||
[[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
|
||||
json &json_data)
|
||||
auto json_create_directory_snapshot(const std::string &path, json &json_data)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto json_read_directory_snapshot(
|
||||
const std::string &path, const remote::file_handle &handle,
|
||||
std::uint32_t page, json &json_data) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
json_release_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle)
|
||||
auto json_read_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle,
|
||||
std::uint32_t page, json &json_data)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
auto json_release_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
|
||||
UINT32 flags, BOOLEAN &was_deleted)
|
||||
auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_close(PVOID file_desc)
|
||||
auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags,
|
||||
BOOLEAN &was_deleted) -> packet::error_type override;
|
||||
|
||||
auto winfsp_close(PVOID file_desc) -> packet::error_type override;
|
||||
|
||||
auto winfsp_create(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, UINT32 attributes,
|
||||
UINT64 allocation_size, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name,
|
||||
BOOLEAN &exists) -> packet::error_type override;
|
||||
|
||||
auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
|
||||
UINT32 attributes, UINT64 allocation_size, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name,
|
||||
BOOLEAN &exists) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
|
||||
auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
auto winfsp_get_file_info(PVOID file_desc, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_file_info(PVOID file_desc,
|
||||
remote::file_info *file_info)
|
||||
auto winfsp_get_security_by_name(PWSTR file_name, PUINT32 attributes,
|
||||
std::uint64_t *descriptor_size,
|
||||
std::wstring &string_descriptor)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_security_by_name(
|
||||
PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size,
|
||||
std::wstring &string_descriptor) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_volume_info(UINT64 &total_size,
|
||||
UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_mounted(const std::wstring &location)
|
||||
auto winfsp_mounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, PVOID *file_desc,
|
||||
remote::file_info *file_info,
|
||||
std::string &normalized_name)
|
||||
auto winfsp_open(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
|
||||
BOOLEAN replace_attributes,
|
||||
UINT64 allocation_size,
|
||||
remote::file_info *file_info)
|
||||
auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
|
||||
BOOLEAN replace_attributes, UINT64 allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset,
|
||||
UINT32 length, PUINT32 bytes_transferred)
|
||||
auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
PUINT32 bytes_transferred) -> packet::error_type override;
|
||||
|
||||
auto winfsp_read_directory(PVOID file_desc, PWSTR pattern, PWSTR marker,
|
||||
json &itemList) -> packet::error_type override;
|
||||
|
||||
auto winfsp_rename(PVOID file_desc, PWSTR file_name, PWSTR new_file_name,
|
||||
BOOLEAN replace_if_exists) -> packet::error_type override;
|
||||
|
||||
auto winfsp_set_basic_info(PVOID file_desc, UINT32 attributes,
|
||||
UINT64 creation_time, UINT64 last_access_time,
|
||||
UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_read_directory(PVOID file_desc, PWSTR pattern,
|
||||
PWSTR marker, json &itemList)
|
||||
auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_rename(PVOID file_desc, PWSTR file_name,
|
||||
PWSTR new_file_name,
|
||||
BOOLEAN replace_if_exists)
|
||||
auto winfsp_unmounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_set_basic_info(
|
||||
PVOID file_desc, UINT32 attributes, UINT64 creation_time,
|
||||
UINT64 last_access_time, UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_unmounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
BOOLEAN write_to_end, BOOLEAN constrained_io,
|
||||
PUINT32 bytes_transferred, remote::file_info *file_info)
|
||||
auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
BOOLEAN write_to_end, BOOLEAN constrained_io,
|
||||
PUINT32 bytes_transferred, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
};
|
||||
} // namespace remote_winfsp
|
||||
|
@ -58,46 +58,41 @@ private:
|
||||
|
||||
public:
|
||||
// FUSE Layer
|
||||
[[nodiscard]] auto fuse_access(const char *path, const std::int32_t &mask)
|
||||
auto fuse_access(const char *path, const std::int32_t &mask)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_chflags(const char *path, std::uint32_t flags)
|
||||
auto fuse_chflags(const char *path, std::uint32_t flags)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_chmod(const char *path, const remote::file_mode &mode)
|
||||
auto fuse_chmod(const char *path, const remote::file_mode &mode)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_chown(const char *path, const remote::user_id &uid,
|
||||
const remote::group_id &gid)
|
||||
-> packet::error_type override;
|
||||
auto fuse_chown(const char *path, const remote::user_id &uid,
|
||||
const remote::group_id &gid) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_destroy() -> packet::error_type override;
|
||||
auto fuse_destroy() -> packet::error_type override;
|
||||
|
||||
/*packet::error_type fuse_fallocate(const char *path, const std::int32_t
|
||||
&mode, const remote::file_offset &offset, const remote::file_offset
|
||||
&length, const remote::file_handle &handle) override ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_fgetattr(const char *path, remote::stat &r_stat,
|
||||
bool &directory,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_fgetattr(const char *path, remote::stat &r_stat, bool &directory,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_fsetattr_x(const char *path,
|
||||
const remote::setattr_x &attr,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_fsetattr_x(const char *path, const remote::setattr_x &attr,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_fsync(const char *path, const std::int32_t &datasync,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_fsync(const char *path, const std::int32_t &datasync,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_ftruncate(const char *path,
|
||||
const remote::file_offset &size,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_ftruncate(const char *path, const remote::file_offset &size,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_getattr(const char *path, remote::stat &r_stat,
|
||||
bool &directory)
|
||||
auto fuse_getattr(const char *path, remote::stat &r_stat, bool &directory)
|
||||
-> packet::error_type override;
|
||||
|
||||
/*packet::error_type fuse_getxattr(const char *path, const char *name, char
|
||||
@ -106,90 +101,77 @@ public:
|
||||
packet::error_type fuse_getxattrOSX(const char *path, const char *name, char
|
||||
*value, const remote::file_size &size, std::uint32_t position) override ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_getxtimes(const char *path,
|
||||
remote::file_time &bkuptime,
|
||||
remote::file_time &crtime)
|
||||
-> packet::error_type override;
|
||||
auto fuse_getxtimes(const char *path, remote::file_time &bkuptime,
|
||||
remote::file_time &crtime) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_init() -> packet::error_type override;
|
||||
auto fuse_init() -> packet::error_type override;
|
||||
|
||||
/*packet::error_type fuse_listxattr(const char *path, char *buffer,
|
||||
const remote::file_size &size) override
|
||||
;*/
|
||||
|
||||
[[nodiscard]] auto fuse_mkdir(const char *path, const remote::file_mode &mode)
|
||||
auto fuse_mkdir(const char *path, const remote::file_mode &mode)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_opendir(const char *path, remote::file_handle &handle)
|
||||
auto fuse_opendir(const char *path, remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fuse_create(const char *path, const remote::file_mode &mode,
|
||||
const remote::open_flags &flags, remote::file_handle &handle)
|
||||
auto fuse_create(const char *path, const remote::file_mode &mode,
|
||||
const remote::open_flags &flags, remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_open(const char *path,
|
||||
const remote::open_flags &flags,
|
||||
remote::file_handle &handle)
|
||||
auto fuse_open(const char *path, const remote::open_flags &flags,
|
||||
remote::file_handle &handle) -> packet::error_type override;
|
||||
|
||||
auto fuse_read(const char *path, char *buffer,
|
||||
const remote::file_size &read_size,
|
||||
const remote::file_offset &read_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_read(const char *path, char *buffer,
|
||||
const remote::file_size &read_size,
|
||||
const remote::file_offset &read_offset,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_rename(const char *from, const char *to)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_rename(const char *from, const char *to)
|
||||
auto fuse_write(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_write(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_write_base64(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_write_base64(const char *path, const char *buffer,
|
||||
const remote::file_size &write_size,
|
||||
const remote::file_offset &write_offset,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_readdir(const char *path, const remote::file_offset &offset,
|
||||
const remote::file_handle &handle, std::string &item_path)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
fuse_readdir(const char *path, const remote::file_offset &offset,
|
||||
const remote::file_handle &handle, std::string &item_path)
|
||||
auto fuse_release(const char *path, const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_release(const char *path,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_releasedir(const char *path,
|
||||
const remote::file_handle &handle)
|
||||
auto fuse_releasedir(const char *path, const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
/*packet::error_type fuse_removexattr(const char *path, const char *name)
|
||||
* override ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_rmdir(const char *path)
|
||||
auto fuse_rmdir(const char *path) -> packet::error_type override;
|
||||
|
||||
auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setattr_x(const char *path, remote::setattr_x &attr)
|
||||
auto fuse_setbkuptime(const char *path, const remote::file_time &bkuptime)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setbkuptime(const char *path,
|
||||
const remote::file_time &bkuptime)
|
||||
auto fuse_setchgtime(const char *path, const remote::file_time &chgtime)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setchgtime(const char *path,
|
||||
const remote::file_time &chgtime)
|
||||
auto fuse_setcrtime(const char *path, const remote::file_time &crtime)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setcrtime(const char *path,
|
||||
const remote::file_time &crtime)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_setvolname(const char *volname)
|
||||
-> packet::error_type override;
|
||||
auto fuse_setvolname(const char *volname) -> packet::error_type override;
|
||||
|
||||
/*packet::error_type fuse_setxattr(const char *path, const char *name, const
|
||||
char *value, const remote::file_size &size, const std::int32_t &flags)
|
||||
@ -199,123 +181,109 @@ public:
|
||||
char *value, const remote::file_size &size, const std::int32_t &flags,
|
||||
std::uint32_t position) override ;*/
|
||||
|
||||
[[nodiscard]] auto fuse_statfs(const char *path, std::uint64_t frsize,
|
||||
remote::statfs &r_stat)
|
||||
auto fuse_statfs(const char *path, std::uint64_t frsize,
|
||||
remote::statfs &r_stat) -> packet::error_type override;
|
||||
|
||||
auto fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
remote::statfs_x &r_stat) -> packet::error_type override;
|
||||
|
||||
auto fuse_truncate(const char *path, const remote::file_offset &size)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
remote::statfs_x &r_stat)
|
||||
-> packet::error_type override;
|
||||
auto fuse_unlink(const char *path) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_truncate(const char *path,
|
||||
const remote::file_offset &size)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_unlink(const char *path)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto fuse_utimens(const char *path, const remote::file_time *tv,
|
||||
std::uint64_t op0, std::uint64_t op1)
|
||||
auto fuse_utimens(const char *path, const remote::file_time *tv,
|
||||
std::uint64_t op0, std::uint64_t op1)
|
||||
-> packet::error_type override;
|
||||
|
||||
void set_fuse_uid_gid(const remote::user_id & /* uid */,
|
||||
const remote::group_id & /* gid */) override {}
|
||||
|
||||
// JSON Layer
|
||||
[[nodiscard]] auto json_create_directory_snapshot(const std::string &path,
|
||||
json &json_data)
|
||||
auto json_create_directory_snapshot(const std::string &path, json &json_data)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto json_read_directory_snapshot(
|
||||
const std::string &path, const remote::file_handle &handle,
|
||||
std::uint32_t page, json &json_data) -> packet::error_type override;
|
||||
auto json_read_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle,
|
||||
std::uint32_t page, json &json_data)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
json_release_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle)
|
||||
auto json_release_directory_snapshot(const std::string &path,
|
||||
const remote::file_handle &handle)
|
||||
-> packet::error_type override;
|
||||
|
||||
// WinFSP Layer
|
||||
[[nodiscard]] auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
auto winfsp_can_delete(PVOID file_desc, PWSTR file_name)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_cleanup(PVOID file_desc, PWSTR file_name,
|
||||
UINT32 flags, BOOLEAN &was_deleted)
|
||||
auto winfsp_cleanup(PVOID file_desc, PWSTR file_name, UINT32 flags,
|
||||
BOOLEAN &was_deleted) -> packet::error_type override;
|
||||
|
||||
auto winfsp_close(PVOID file_desc) -> packet::error_type override;
|
||||
|
||||
auto winfsp_create(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, UINT32 attributes,
|
||||
UINT64 allocation_size, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name,
|
||||
BOOLEAN &exists) -> packet::error_type override;
|
||||
|
||||
auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_close(PVOID file_desc)
|
||||
auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
winfsp_create(PWSTR file_name, UINT32 create_options, UINT32 granted_access,
|
||||
UINT32 attributes, UINT64 allocation_size, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name,
|
||||
BOOLEAN &exists) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_flush(PVOID file_desc, remote::file_info *file_info)
|
||||
auto winfsp_get_file_info(PVOID file_desc, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_dir_buffer(PVOID file_desc, PVOID *&ptr)
|
||||
auto winfsp_get_security_by_name(PWSTR file_name, PUINT32 attributes,
|
||||
std::uint64_t *descriptor_size,
|
||||
std::wstring &string_descriptor)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_file_info(PVOID file_desc,
|
||||
remote::file_info *file_info)
|
||||
auto winfsp_get_volume_info(UINT64 &total_size, UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_security_by_name(
|
||||
PWSTR file_name, PUINT32 attributes, std::uint64_t *descriptor_size,
|
||||
std::wstring &string_descriptor) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_get_volume_info(UINT64 &total_size,
|
||||
UINT64 &free_size,
|
||||
std::string &volume_label)
|
||||
auto winfsp_mounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_mounted(const std::wstring &location)
|
||||
auto winfsp_open(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, PVOID *file_desc,
|
||||
remote::file_info *file_info, std::string &normalized_name)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_open(PWSTR file_name, UINT32 create_options,
|
||||
UINT32 granted_access, PVOID *file_desc,
|
||||
remote::file_info *file_info,
|
||||
std::string &normalized_name)
|
||||
auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
|
||||
BOOLEAN replace_attributes, UINT64 allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_overwrite(PVOID file_desc, UINT32 attributes,
|
||||
BOOLEAN replace_attributes,
|
||||
UINT64 allocation_size,
|
||||
remote::file_info *file_info)
|
||||
auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
PUINT32 bytes_transferred) -> packet::error_type override;
|
||||
|
||||
auto winfsp_read_directory(PVOID file_desc, PWSTR pattern, PWSTR marker,
|
||||
json &item_list) -> packet::error_type override;
|
||||
|
||||
auto winfsp_rename(PVOID file_desc, PWSTR file_name, PWSTR new_file_name,
|
||||
BOOLEAN replace_if_exists) -> packet::error_type override;
|
||||
|
||||
auto winfsp_set_basic_info(PVOID file_desc, UINT32 attributes,
|
||||
UINT64 creation_time, UINT64 last_access_time,
|
||||
UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_read(PVOID file_desc, PVOID buffer, UINT64 offset,
|
||||
UINT32 length, PUINT32 bytes_transferred)
|
||||
auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_read_directory(PVOID file_desc, PWSTR pattern,
|
||||
PWSTR marker, json &item_list)
|
||||
auto winfsp_unmounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_rename(PVOID file_desc, PWSTR file_name,
|
||||
PWSTR new_file_name,
|
||||
BOOLEAN replace_if_exists)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_set_basic_info(
|
||||
PVOID file_desc, UINT32 attributes, UINT64 creation_time,
|
||||
UINT64 last_access_time, UINT64 last_write_time, UINT64 change_time,
|
||||
remote::file_info *file_info) -> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_set_file_size(PVOID file_desc, UINT64 new_size,
|
||||
BOOLEAN set_allocation_size,
|
||||
remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto winfsp_unmounted(const std::wstring &location)
|
||||
-> packet::error_type override;
|
||||
|
||||
[[nodiscard]] auto
|
||||
winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
BOOLEAN write_to_end, BOOLEAN constrained_io,
|
||||
PUINT32 bytes_transferred, remote::file_info *file_info)
|
||||
auto winfsp_write(PVOID file_desc, PVOID buffer, UINT64 offset, UINT32 length,
|
||||
BOOLEAN write_to_end, BOOLEAN constrained_io,
|
||||
PUINT32 bytes_transferred, remote::file_info *file_info)
|
||||
-> packet::error_type override;
|
||||
};
|
||||
} // namespace remote_winfsp
|
||||
|
@ -35,8 +35,9 @@ public:
|
||||
~logging_consumer();
|
||||
|
||||
private:
|
||||
static constexpr std::uint8_t MAX_LOG_FILES{5U};
|
||||
static constexpr std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * 5ULL};
|
||||
static constexpr const std::uint8_t MAX_LOG_FILES{5U};
|
||||
static constexpr const std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL *
|
||||
5ULL};
|
||||
|
||||
private:
|
||||
static void process_event(const i_event &evt);
|
||||
|
@ -27,7 +27,7 @@ class i_event;
|
||||
|
||||
class event_system final {
|
||||
private:
|
||||
static constexpr std::uint8_t max_queue_retry{
|
||||
static constexpr const std::uint8_t max_queue_retry{
|
||||
30U,
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ private:
|
||||
std::thread::hardware_concurrency() * 4U,
|
||||
};
|
||||
|
||||
static constexpr std::chrono::seconds queue_wait_secs{
|
||||
static constexpr const std::chrono::seconds queue_wait_secs{
|
||||
5s,
|
||||
};
|
||||
|
||||
|
@ -33,8 +33,8 @@ struct curl_error final : public i_event {
|
||||
function_name(std::string{function_name_}),
|
||||
url(std::move(url_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"curl_error"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"curl_error"};
|
||||
|
||||
CURLcode code{};
|
||||
std::string function_name;
|
||||
|
@ -31,8 +31,8 @@ struct debug_log final : public i_event {
|
||||
debug_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"debug_log"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"debug_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@ -34,8 +34,8 @@ struct directory_remove_failed final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"directory_remove_failed"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"directory_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@ -32,8 +32,8 @@ struct directory_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"directory_removed"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"directory_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct directory_removed_externally final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"directory_removed_externally"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"directory_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -34,8 +34,8 @@ struct download_begin final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_begin"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_begin"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -35,8 +35,8 @@ struct download_end final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_end"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_end"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -35,8 +35,8 @@ struct download_progress final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
progress(progress_) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_progress"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_progress"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -35,8 +35,8 @@ struct download_restore_failed final : public i_event {
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"download_restore_failed"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_restore_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -34,8 +34,8 @@ struct download_restored final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_restored"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_restored"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -36,8 +36,8 @@ struct download_resume_add_failed final : public i_event {
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"download_resume_add_failed"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_resume_add_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -34,8 +34,8 @@ struct download_resume_added final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_resume_added"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_added"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -34,8 +34,8 @@ struct download_resume_removed final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_resume_removed"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -35,8 +35,8 @@ struct download_type_selected final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
type(type_) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_type_selected"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_type_selected"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@ -35,8 +35,8 @@ struct drive_mount_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"drive_mount_failed"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"drive_mount_failed"};
|
||||
|
||||
NTSTATUS error{};
|
||||
std::string function_name;
|
||||
|
@ -34,8 +34,8 @@ struct drive_mount_result final : public i_event {
|
||||
mount_location(std::move(mount_location_)),
|
||||
result(std::move(result_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_mount_result"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mount_result"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@ -32,8 +32,8 @@ struct drive_mounted final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_mounted"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@ -31,8 +31,8 @@ struct drive_stop_timed_out final : public i_event {
|
||||
drive_stop_timed_out(std::string_view function_name_)
|
||||
: function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"drive_stop_timed_out"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"drive_stop_timed_out"};
|
||||
|
||||
std::string function_name;
|
||||
|
||||
|
@ -33,8 +33,8 @@ struct drive_unmount_pending final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_unmount_pending"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmount_pending"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@ -32,8 +32,8 @@ struct drive_unmounted final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_unmounted"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@ -31,8 +31,8 @@ struct event_level_changed final : public i_event {
|
||||
event_level_changed(std::string_view function_name_, event_level new_level_)
|
||||
: function_name(std::string(function_name_)), new_level(new_level_) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"event_level_changed"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"event_level_changed"};
|
||||
|
||||
std::string function_name;
|
||||
event_level new_level{};
|
||||
|
@ -32,8 +32,8 @@ struct file_pinned final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_pinned"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_pinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -34,8 +34,8 @@ struct file_remove_failed final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"file_remove_failed"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"file_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@ -32,8 +32,8 @@ struct file_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"file_removed"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"file_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct file_removed_externally final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_removed_externally"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -32,8 +32,8 @@ struct file_unpinned final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_unpinned"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_unpinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -37,8 +37,8 @@ struct file_upload_completed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_upload_completed"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_upload_completed"};
|
||||
|
||||
std::string api_path;
|
||||
bool cancelled{};
|
||||
|
@ -35,8 +35,8 @@ struct file_upload_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_failed"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string error;
|
||||
|
@ -34,8 +34,8 @@ struct file_upload_not_found final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_not_found"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_not_found"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -34,8 +34,8 @@ struct file_upload_queued final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_upload_queued"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_upload_queued"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -32,8 +32,8 @@ struct file_upload_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"file_upload_removed"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"file_upload_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct file_upload_retry final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_retry"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_retry"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@ -35,8 +35,8 @@ struct filesystem_item_added final : public i_event {
|
||||
directory(directory_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"filesystem_item_added"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"filesystem_item_added"};
|
||||
|
||||
std::string api_parent;
|
||||
std::string api_path;
|
||||
|
@ -37,8 +37,8 @@ struct filesystem_item_closed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_closed"};
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_closed"};
|
||||
|
||||
std::string api_path;
|
||||
bool changed{};
|
||||
|
@ -35,8 +35,8 @@ struct filesystem_item_evicted final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"filesystem_item_evicted"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"filesystem_item_evicted"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -39,8 +39,8 @@ struct filesystem_item_handle_closed final : public i_event {
|
||||
handle(handle_),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_handle_closed"};
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_handle_closed"};
|
||||
|
||||
std::string api_path;
|
||||
bool changed{};
|
||||
|
@ -37,8 +37,8 @@ struct filesystem_item_handle_opened final : public i_event {
|
||||
handle(handle_),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_handle_opened"};
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_handle_opened"};
|
||||
|
||||
std::string api_path;
|
||||
bool directory{};
|
||||
|
@ -36,8 +36,8 @@ struct filesystem_item_opened final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_opened"};
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_opened"};
|
||||
|
||||
std::string api_path;
|
||||
bool directory{};
|
||||
|
@ -32,8 +32,8 @@ struct fuse_args_parsed final : public i_event {
|
||||
fuse_args_parsed(std::string_view args_, std::string_view function_name_)
|
||||
: args(std::move(args_)), function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"fuse_args_parsed"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"fuse_args_parsed"};
|
||||
|
||||
std::string args;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct fuse_event final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"fuse_event"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"fuse_event"};
|
||||
|
||||
std::string api_path;
|
||||
std::int32_t error{};
|
||||
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_INFO_LOG_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_INFO_LOG_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct info_log final : public i_event {
|
||||
info_log() = default;
|
||||
info_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"info_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|msg|{}", name, function_name, msg);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::info_log> {
|
||||
static void to_json(json &data, const repertory::info_log &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["msg"] = value.msg;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::info_log &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("msg").get_to<std::string>(value.msg);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_INFO_LOG_HPP_
|
@ -34,8 +34,8 @@ struct invalid_cache_size final : public i_event {
|
||||
function_name(std::string{function_name_}),
|
||||
invalid_size(invalid_size_) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"invalid_cache_size"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"invalid_cache_size"};
|
||||
|
||||
std::uint64_t cache_size{};
|
||||
std::string function_name;
|
||||
|
@ -32,8 +32,8 @@ struct item_timeout final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"item_timeout"};
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"item_timeout"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct max_cache_size_reached final : public i_event {
|
||||
function_name(std::string{function_name_}),
|
||||
max_cache_size(max_cache_size_) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"max_cache_size_reached"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"max_cache_size_reached"};
|
||||
|
||||
std::uint64_t cache_size{};
|
||||
std::string function_name;
|
||||
|
@ -33,8 +33,8 @@ struct orphaned_file_detected final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_file_detected"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_file_detected"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@ -36,8 +36,8 @@ struct orphaned_file_processing_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{
|
||||
"orphaned_file_processing_failed",
|
||||
};
|
||||
|
||||
|
@ -33,8 +33,8 @@ struct orphaned_source_file_detected final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_source_file_detected"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_source_file_detected"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@ -33,8 +33,8 @@ struct orphaned_source_file_removed final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_source_file_removed"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_source_file_removed"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@ -34,8 +34,8 @@ struct packet_client_timeout final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"packet_client_timeout"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"packet_client_timeout"};
|
||||
|
||||
std::string event_name;
|
||||
std::string function_name;
|
||||
|
@ -32,8 +32,8 @@ struct polling_item_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
item_name(std::move(item_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"polling_item_begin"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"polling_item_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string item_name;
|
||||
|
@ -32,8 +32,8 @@ struct polling_item_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
item_name(std::move(item_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"polling_item_end"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"polling_item_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string item_name;
|
||||
|
@ -1,78 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_PRODIVER_INVALID_VERSION_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_PRODIVER_INVALID_VERSION_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct provider_invalid_version final : public i_event {
|
||||
provider_invalid_version() = default;
|
||||
provider_invalid_version(std::string_view function_name_,
|
||||
std::string required_version_,
|
||||
std::string returned_version_)
|
||||
: function_name(std::string(function_name_)),
|
||||
required_version(std::move(required_version_)),
|
||||
returned_version(std::move(returned_version_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"provider_invalid_version"};
|
||||
|
||||
std::string function_name;
|
||||
std::string required_version;
|
||||
std::string returned_version;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|required|{}|returned|{}", name,
|
||||
function_name, required_version, returned_version);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::provider_invalid_version> {
|
||||
static void to_json(json &data,
|
||||
const repertory::provider_invalid_version &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["required_version"] = value.required_version;
|
||||
data["returned_version"] = value.returned_version;
|
||||
}
|
||||
|
||||
static void from_json(const json &data,
|
||||
repertory::provider_invalid_version &value) {
|
||||
data.at("function_name").get_to(value.function_name);
|
||||
data.at("required_version").get_to(value.required_version);
|
||||
data.at("returned_version").get_to(value.returned_version);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_PRODIVER_INVALID_VERSION_HPP_
|
@ -34,8 +34,8 @@ struct provider_offline final : public i_event {
|
||||
host_name_or_ip(std::move(host_name_or_ip_)),
|
||||
port(port_) {}
|
||||
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"provider_offline"};
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"provider_offline"};
|
||||
|
||||
std::string function_name;
|
||||
std::string host_name_or_ip;
|
||||
|
@ -34,8 +34,8 @@ struct provider_upload_begin final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"provider_upload_begin"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"provider_upload_begin"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@ -35,8 +35,8 @@ struct provider_upload_end final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"provider_upload_end"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"provider_upload_end"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@ -35,8 +35,8 @@ struct remote_server_event final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"remote_server_event"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"remote_server_event"};
|
||||
|
||||
std::string api_path;
|
||||
packet::error_type error{};
|
||||
|
@ -31,8 +31,8 @@ struct repertory_exception final : public i_event {
|
||||
repertory_exception(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"repertory_exception"};
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"repertory_exception"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@ -33,8 +33,8 @@ struct service_start_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_start_begin"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_start_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@ -32,8 +32,8 @@ struct service_start_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_start_end"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_start_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@ -32,8 +32,8 @@ struct service_stop_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_stop_begin"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_stop_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@ -32,8 +32,8 @@ struct service_stop_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_stop_end"};
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_stop_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_EVENTS_TYPES_TRACE_LOG_HPP_
|
||||
#define REPERTORY_INCLUDE_EVENTS_TYPES_TRACE_LOG_HPP_
|
||||
|
||||
#include "events/i_event.hpp"
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
namespace repertory {
|
||||
struct trace_log final : public i_event {
|
||||
trace_log() = default;
|
||||
trace_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"trace_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
return level;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_name() const -> std::string_view override {
|
||||
return name;
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|msg|{}", name, function_name, msg);
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
template <> struct adl_serializer<repertory::trace_log> {
|
||||
static void to_json(json &data, const repertory::trace_log &value) {
|
||||
data["function_name"] = value.function_name;
|
||||
data["msg"] = value.msg;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::trace_log &value) {
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("msg").get_to<std::string>(value.msg);
|
||||
}
|
||||
};
|
||||
NLOHMANN_JSON_NAMESPACE_END
|
||||
|
||||
#endif // REPERTORY_INCLUDE_EVENTS_TYPES_TRACE_LOG_HPP_
|
@ -31,8 +31,8 @@ struct unmount_requested final : public i_event {
|
||||
unmount_requested(std::string_view function_name_)
|
||||
: function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"unmount_requested"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"unmount_requested"};
|
||||
|
||||
std::string function_name;
|
||||
|
||||
|
@ -35,8 +35,8 @@ struct unmount_result final : public i_event {
|
||||
mount_location(std::move(mount_location_)),
|
||||
result(result_) {}
|
||||
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"unmount_result"};
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"unmount_result"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user