diff --git a/libqpdf/qpdf-c.cc b/libqpdf/qpdf-c.cc index 7feabd1c..01987365 100644 --- a/libqpdf/qpdf-c.cc +++ b/libqpdf/qpdf-c.cc @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -20,42 +21,6 @@ #include #include -struct _qpdf_error -{ - std::shared_ptr exc; -}; - -struct _qpdf_data -{ - _qpdf_data() = default; - ~_qpdf_data() = default; - - std::shared_ptr qpdf; - std::shared_ptr qpdf_writer; - - std::shared_ptr error; - _qpdf_error tmp_error; - std::list warnings; - std::string tmp_string; - - // Parameters for functions we call - char const* filename{nullptr}; // or description - char const* buffer{nullptr}; - unsigned long long size{0}; - char const* password{nullptr}; - bool write_memory{false}; - std::shared_ptr output_buffer; - - // QPDFObjectHandle support - bool silence_errors{false}; - bool oh_error_occurred{false}; - std::map> oh_cache; - qpdf_oh next_oh{0}; - std::set cur_iter_dict_keys; - std::set::const_iterator dict_iter; - std::string cur_dict_key; -}; - // must set qpdf->filename and qpdf->password static void call_read(qpdf_data qpdf) diff --git a/libqpdf/qpdf/qpdf-c_impl.hh b/libqpdf/qpdf/qpdf-c_impl.hh new file mode 100644 index 00000000..0d52cf10 --- /dev/null +++ b/libqpdf/qpdf/qpdf-c_impl.hh @@ -0,0 +1,47 @@ +#include + +#include + +#include +#include +#include + +struct _qpdf_error +{ + std::shared_ptr exc; +}; + +struct _qpdf_data +{ + _qpdf_data() = default; + + _qpdf_data(std::unique_ptr&& qpdf) : + qpdf(std::move(qpdf)){}; + + ~_qpdf_data() = default; + + std::shared_ptr qpdf; + std::shared_ptr qpdf_writer; + + std::shared_ptr error; + _qpdf_error tmp_error; + std::list warnings; + std::string tmp_string; + + // Parameters for functions we call + char const* filename{nullptr}; // or description + char const* buffer{nullptr}; + unsigned long long size{0}; + char const* password{nullptr}; + bool write_memory{false}; + std::shared_ptr output_buffer; + + // QPDFObjectHandle support + bool silence_errors{false}; + bool oh_error_occurred{false}; + std::map> oh_cache; + qpdf_oh next_oh{0}; + std::set cur_iter_dict_keys; + std::set::const_iterator dict_iter; + std::string cur_dict_key; +};