Skip to content

Commit

Permalink
draft
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Sep 14, 2024
1 parent f1e1007 commit 028809b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/odr/file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,19 @@ enum class FileLocation {
disk,
};

/// @brief Collection of decoder engines.
enum class DecoderEngine {
odr,
pdf2html_ex,
wv_ware,
};

/// @brief Preference for decoding files.
struct DecodePreference final {
std::vector<FileType> file_type_priority;
std::vector<DecoderEngine> engine_priority;
};

/// @brief Collection of encryption states.
enum class EncryptionState {
unknown,
Expand Down
15 changes: 14 additions & 1 deletion src/odr/internal/open_strategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

namespace odr {
enum class FileType;
}
enum class DecoderEngine;
struct DecodePreferences;
} // namespace odr

namespace odr::internal::abstract {
class File;
Expand All @@ -20,11 +22,22 @@ class Path;

namespace odr::internal::open_strategy {
std::vector<FileType> types(std::shared_ptr<internal::abstract::File> file);
std::vector<DecoderEngine>
engines(std::shared_ptr<internal::abstract::File> file, FileType as);

std::unique_ptr<internal::abstract::DecodedFile>
open_file(std::shared_ptr<internal::abstract::File> file);
std::unique_ptr<internal::abstract::DecodedFile>
open_file(std::shared_ptr<internal::abstract::File> file, FileType as);
std::unique_ptr<internal::abstract::DecodedFile>
open_file(std::shared_ptr<internal::abstract::File> file, FileType as,
DecoderEngine with);
std::unique_ptr<internal::abstract::DecodedFile>
open_file(std::shared_ptr<internal::abstract::File> file,
const DecodePreferences &preferences);
std::unique_ptr<internal::abstract::DecodedFile>
open_file(std::shared_ptr<internal::abstract::File> file, FileType as,
const DecodePreferences &preferences);

std::unique_ptr<internal::abstract::DocumentFile>
open_document_file(std::shared_ptr<internal::abstract::File> file);
Expand Down

0 comments on commit 028809b

Please sign in to comment.