55#include < odr/document_path.hpp>
66#include < odr/exceptions.hpp>
77#include < odr/filesystem.hpp>
8+ #include < odr/global_params.hpp>
89
910#include < odr/internal/html/document.hpp>
1011#include < odr/internal/html/filesystem.hpp>
@@ -24,6 +25,8 @@ using namespace odr::internal;
2425
2526namespace odr {
2627
28+ HtmlConfig::HtmlConfig () : resource_path{GlobalParams::odr_core_data_path ()} {}
29+
2730Html::Html (FileType file_type, HtmlConfig config, std::vector<HtmlPage> pages)
2831 : m_file_type{file_type}, m_config{std::move (config)},
2932 m_pages{std::move (pages)} {}
@@ -52,23 +55,6 @@ void Html::save(const std::string &path) const {
5255HtmlPage::HtmlPage (std::string name, std::string path)
5356 : name{std::move (name)}, path{std::move (path)} {}
5457
55- Html html::translate (const File &file, const std::string &output_path,
56- const HtmlConfig &config,
57- const PasswordCallback &password_callback) {
58- auto decoded_file = DecodedFile (file);
59-
60- if (decoded_file.is_document_file ()) {
61- DocumentFile document_file = decoded_file.document_file ();
62- if (document_file.password_encrypted ()) {
63- if (!document_file.decrypt (password_callback ())) {
64- throw WrongPassword ();
65- }
66- }
67- }
68-
69- return translate (decoded_file, output_path, config);
70- }
71-
7258Html html::translate (const DecodedFile &decoded_file,
7359 const std::string &output_path, const HtmlConfig &config) {
7460 if (decoded_file.is_text_file ()) {
0 commit comments