mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
refactor: constify the inout module (#6328)
* refactor: move tr_preallocation_mode info tr_open_files * refactor: remove unnecessary error nullptr check * refactor: use snake_case for private method names in inout.cc * refactor: extract-method get_fd() from read_or_write_bytes() * refactor: make function args const where possible * refactor: simplify read_or_write_bytes() * refactor: make buflen a uint64_t in read_or_write_piece() * refactor: move tr_torrentStop() logic from read_or_write_piece() to tr_ioWrite() * refactor: make tr_ioFoo() functions take a const torrent * refactor: make tr_cache::close_torrent_files() take a tor_id instead of a torrent
This commit is contained in:
@@ -24,6 +24,13 @@
|
||||
class tr_open_files
|
||||
{
|
||||
public:
|
||||
enum class Preallocation
|
||||
{
|
||||
None,
|
||||
Sparse,
|
||||
Full
|
||||
};
|
||||
|
||||
[[nodiscard]] std::optional<tr_sys_file_t> get(tr_torrent_id_t tor_id, tr_file_index_t file_num, bool writable);
|
||||
|
||||
[[nodiscard]] std::optional<tr_sys_file_t> get(
|
||||
@@ -31,7 +38,7 @@ public:
|
||||
tr_file_index_t file_num,
|
||||
bool writable,
|
||||
std::string_view filename,
|
||||
tr_preallocation_mode allocation,
|
||||
Preallocation allocation,
|
||||
uint64_t file_size);
|
||||
|
||||
void close_all();
|
||||
|
||||
Reference in New Issue
Block a user