winfsp unit tests and fixes

This commit is contained in:
2024-11-07 12:32:07 -06:00
parent 2df84f53ed
commit 69d190e485
7 changed files with 163 additions and 78 deletions

View File

@ -40,25 +40,25 @@ public:
[[nodiscard]] virtual auto get_filesystem_item() const -> filesystem_item = 0;
[[nodiscard]] virtual auto
get_open_data() -> std::map<std::uint64_t, open_file_data> & = 0;
[[nodiscard]] virtual auto get_open_data()
-> std::map<std::uint64_t, open_file_data> & = 0;
[[nodiscard]] virtual auto
get_open_data() const -> const std::map<std::uint64_t, open_file_data> & = 0;
[[nodiscard]] virtual auto get_open_data() const
-> const std::map<std::uint64_t, open_file_data> & = 0;
[[nodiscard]] virtual auto
get_open_data(std::uint64_t handle) -> open_file_data & = 0;
[[nodiscard]] virtual auto get_open_data(std::uint64_t handle)
-> open_file_data & = 0;
[[nodiscard]] virtual auto
get_open_data(std::uint64_t handle) const -> const open_file_data & = 0;
[[nodiscard]] virtual auto get_open_data(std::uint64_t handle) const
-> const open_file_data & = 0;
[[nodiscard]] virtual auto get_open_file_count() const -> std::size_t = 0;
[[nodiscard]] virtual auto
get_read_state() const -> boost::dynamic_bitset<> = 0;
[[nodiscard]] virtual auto get_read_state() const
-> boost::dynamic_bitset<> = 0;
[[nodiscard]] virtual auto
get_read_state(std::size_t chunk) const -> bool = 0;
[[nodiscard]] virtual auto get_read_state(std::size_t chunk) const
-> bool = 0;
[[nodiscard]] virtual auto get_source_path() const -> std::string = 0;
@ -74,11 +74,11 @@ public:
native_operation_callback callback) -> api_error = 0;
[[nodiscard]] virtual auto read(std::size_t read_size,
std::uint64_t read_offset,
data_buffer &data) -> api_error = 0;
std::uint64_t read_offset, data_buffer &data)
-> api_error = 0;
[[nodiscard]] virtual auto
resize(std::uint64_t new_file_size) -> api_error = 0;
[[nodiscard]] virtual auto resize(std::uint64_t new_file_size)
-> api_error = 0;
virtual void set_api_path(const std::string &api_path) = 0;
@ -97,8 +97,8 @@ public:
virtual auto close() -> bool = 0;
[[nodiscard]] virtual auto
get_handles() const -> std::vector<std::uint64_t> = 0;
[[nodiscard]] virtual auto get_handles() const
-> std::vector<std::uint64_t> = 0;
[[nodiscard]] virtual auto is_complete() const -> bool = 0;
@ -106,7 +106,7 @@ public:
[[nodiscard]] virtual auto is_write_supported() const -> bool = 0;
virtual void remove(std::uint64_t handle) = 0;
virtual void remove(std::uint64_t handle, bool noQueue = false) = 0;
};
} // namespace repertory

View File

@ -107,7 +107,7 @@ public:
native_operation_callback callback)
-> api_error override;
void remove(std::uint64_t handle) override;
void remove(std::uint64_t handle, bool noQueue = false) override;
[[nodiscard]] auto read(std::size_t read_size, std::uint64_t read_offset,
data_buffer &data) -> api_error override;

View File

@ -185,7 +185,7 @@ public:
[[nodiscard]] auto is_modified() const -> bool override;
void remove(std::uint64_t handle) override;
void remove(std::uint64_t handle, bool noQueue = false) override;
void set_api_path(const std::string &api_path) override;
};