summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/td/telegram/Document.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/td/telegram/Document.h')
-rw-r--r--protocols/Telegram/tdlib/td/td/telegram/Document.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/protocols/Telegram/tdlib/td/td/telegram/Document.h b/protocols/Telegram/tdlib/td/td/telegram/Document.h
new file mode 100644
index 0000000000..e58c816144
--- /dev/null
+++ b/protocols/Telegram/tdlib/td/td/telegram/Document.h
@@ -0,0 +1,46 @@
+//
+// 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)
+//
+#pragma once
+
+#include "td/telegram/files/FileId.h"
+
+#include "td/utils/common.h"
+#include "td/utils/StringBuilder.h"
+
+namespace td {
+
+class Td;
+
+struct Document {
+ // append only
+ enum class Type : int32 { Unknown, Animation, Audio, General, Sticker, Video, VideoNote, VoiceNote };
+
+ Type type = Type::Unknown;
+ FileId file_id;
+
+ Document() = default;
+ Document(Type type, FileId file_id) : type(type), file_id(file_id) {
+ }
+
+ bool empty() const {
+ return type == Type::Unknown;
+ }
+
+ vector<FileId> get_file_ids(const Td *td) const;
+
+ void append_file_ids(const Td *td, vector<FileId> &file_ids) const;
+};
+
+bool operator==(const Document &lhs, const Document &rhs);
+
+bool operator!=(const Document &lhs, const Document &rhs);
+
+StringBuilder &operator<<(StringBuilder &string_builder, const Document::Type &document_type);
+
+StringBuilder &operator<<(StringBuilder &string_builder, const Document &document);
+
+} // namespace td