From 8abb791d9cd3d5fbed0db576dd8ea6744021d60a Mon Sep 17 00:00:00 2001 From: m-holger Date: Thu, 16 Oct 2025 11:30:36 +0100 Subject: [PATCH] Refactor `Doc` usage: introduce `impl::Doc` namespace and update related `using` declarations across the codebase for improved encapsulation. --- libqpdf/QPDF.cc | 5 ++--- libqpdf/QPDFJob.cc | 3 +-- libqpdf/QPDFWriter.cc | 3 +-- libqpdf/qpdf/QPDF_private.hh | 5 +++++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 3a96465..5c72571 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -27,9 +27,8 @@ using namespace qpdf; using namespace std::literals; -using QDoc = QPDF::Doc; -using Common = QDoc::Common; -using Objects = QDoc::Objects; +using Common = impl::Doc::Common; +using Objects = impl::Doc::Objects; using Foreign = Objects::Foreign; using Streams = Objects::Streams; diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index d920ab0..ddada94 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -30,8 +30,7 @@ using namespace qpdf; -using QDoc = QPDF::Doc; -using Pages = QDoc::Pages; +using Pages = impl::Doc::Pages; namespace { diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc index 5c9c6e6..6a10919 100644 --- a/libqpdf/QPDFWriter.cc +++ b/libqpdf/QPDFWriter.cc @@ -27,8 +27,7 @@ using namespace std::literals; using namespace qpdf; -using QDoc = QPDF::Doc; -using Encryption = QDoc::Encryption; +using Encryption = impl::Doc::Encryption; QPDFWriter::ProgressReporter::~ProgressReporter() // NOLINT (modernize-use-equals-default) { diff --git a/libqpdf/qpdf/QPDF_private.hh b/libqpdf/qpdf/QPDF_private.hh index 79efe70..9f76434 100644 --- a/libqpdf/qpdf/QPDF_private.hh +++ b/libqpdf/qpdf/QPDF_private.hh @@ -22,6 +22,11 @@ namespace qpdf class OffsetBuffer; } // namespace is + namespace impl + { + using Doc = QPDF::Doc; + } + class Doc: public QPDF { public: -- libgit2 0.21.4