|
5 | 5 | #include <memory> |
6 | 6 | #include <optional> |
7 | 7 | #include <string> |
| 8 | +#include <string_view> |
8 | 9 | #include <vector> |
9 | 10 |
|
10 | 11 | namespace odr::internal::abstract { |
@@ -140,10 +141,14 @@ struct DocumentMeta final { |
140 | 141 | /// @brief Meta information about a file. |
141 | 142 | struct FileMeta final { |
142 | 143 | FileMeta(); |
| 144 | + [[deprecated]] |
143 | 145 | FileMeta(FileType type, bool password_encrypted, |
144 | 146 | std::optional<DocumentMeta> document_meta); |
| 147 | + FileMeta(FileType type, std::string_view mimetype, bool password_encrypted, |
| 148 | + std::optional<DocumentMeta> document_meta); |
145 | 149 |
|
146 | 150 | FileType type{FileType::unknown}; |
| 151 | + std::string_view mimetype; |
147 | 152 | bool password_encrypted{false}; |
148 | 153 | std::optional<DocumentMeta> document_meta; |
149 | 154 | }; |
@@ -175,9 +180,12 @@ class File final { |
175 | 180 | /// @brief Represents a decoded file. |
176 | 181 | class DecodedFile { |
177 | 182 | public: |
178 | | - static std::vector<FileType> list_file_types(const std::string &path, |
179 | | - Logger &logger = Logger::null()); |
180 | | - static std::vector<DecoderEngine> list_decoder_engines(FileType as); |
| 183 | + [[nodiscard]] static std::vector<FileType> |
| 184 | + list_file_types(const std::string &path, Logger &logger = Logger::null()); |
| 185 | + [[nodiscard]] static std::vector<DecoderEngine> |
| 186 | + list_decoder_engines(FileType as); |
| 187 | + [[nodiscard]] static std::string_view |
| 188 | + mimetype(const std::string &path, Logger &logger = Logger::null()); |
181 | 189 |
|
182 | 190 | explicit DecodedFile(std::shared_ptr<internal::abstract::DecodedFile> impl); |
183 | 191 | explicit DecodedFile(const File &file, Logger &logger = Logger::null()); |
|
0 commit comments