2022-02-26 19:55:12 +01:00
|
|
|
//
|
2022-12-31 22:28:08 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
|
2022-02-27 16:23:06 +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)
|
2022-02-26 19:55:12 +01:00
|
|
|
//
|
|
|
|
#pragma once
|
2022-02-27 16:23:06 +01:00
|
|
|
|
2022-02-28 16:25:07 +01:00
|
|
|
#include "td/telegram/FileReferenceManager.h"
|
2022-02-26 19:55:12 +01:00
|
|
|
#include "td/telegram/FileReferenceManager.hpp"
|
|
|
|
#include "td/telegram/files/FileSourceId.h"
|
|
|
|
#include "td/telegram/Td.h"
|
|
|
|
|
|
|
|
namespace td {
|
2022-02-27 16:23:06 +01:00
|
|
|
|
2022-02-26 19:55:12 +01:00
|
|
|
template <class StorerT>
|
2022-02-27 16:23:06 +01:00
|
|
|
void store(FileSourceId file_source_id, StorerT &storer) {
|
2022-02-26 19:55:12 +01:00
|
|
|
Td *td = storer.context()->td().get_actor_unsafe();
|
|
|
|
td->file_reference_manager_->store_file_source(file_source_id, storer);
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class ParserT>
|
|
|
|
void parse(FileSourceId &file_source_id, ParserT &parser) {
|
|
|
|
Td *td = parser.context()->td().get_actor_unsafe();
|
|
|
|
file_source_id = td->file_reference_manager_->parse_file_source(td, parser);
|
|
|
|
}
|
2022-02-27 16:23:06 +01:00
|
|
|
|
2022-02-26 19:55:12 +01:00
|
|
|
} // namespace td
|