tdlight/td/telegram/files/FileSourceId.hpp

28 lines
865 B
C++
Raw Normal View History

2022-02-26 19:55:12 +01:00
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
//
// 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-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-26 19:55:12 +01:00
template <class StorerT>
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-26 19:55:12 +01:00
} // namespace td