2018-12-31 20:04:05 +01:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
2018-12-31 20:04:05 +01:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
2022-10-10 13:19:35 +02:00
|
|
|
#include "td/telegram/files/FileLoaderUtils.h"
|
2018-12-31 20:04:05 +01:00
|
|
|
#include "td/telegram/files/FileLocation.h"
|
|
|
|
|
2021-09-18 23:47:05 +02:00
|
|
|
#include "td/actor/actor.h"
|
|
|
|
|
2018-12-31 20:04:05 +01:00
|
|
|
#include "td/utils/buffer.h"
|
2022-06-21 01:55:53 +02:00
|
|
|
#include "td/utils/common.h"
|
2022-06-27 12:30:18 +02:00
|
|
|
#include "td/utils/Promise.h"
|
2018-12-31 20:04:05 +01:00
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class FileLoadManager final : public Actor {
|
|
|
|
public:
|
2022-06-15 20:40:23 +02:00
|
|
|
void get_content(string file_path, Promise<BufferSlice> promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
|
2022-06-15 23:25:47 +02:00
|
|
|
void read_file_part(string file_path, int64 offset, int64 count, Promise<string> promise);
|
|
|
|
|
2022-06-16 12:32:14 +02:00
|
|
|
void unlink_file(string file_path, Promise<Unit> promise);
|
|
|
|
|
2022-10-10 13:19:35 +02:00
|
|
|
void check_full_local_location(FullLocalLocationInfo local_info, bool skip_file_size_checks,
|
|
|
|
Promise<FullLocalLocationInfo> promise);
|
|
|
|
|
|
|
|
void check_partial_local_location(PartialLocalFileLocation partial, Promise<Unit> promise);
|
2018-12-31 20:04:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|