From 25ccc7eae4b78e90d0fe6400abeba22ca4cd648e Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 8 Sep 2022 11:12:10 -0400 Subject: [PATCH] Rename QPDFValueProxy.hh and QPDFValueProxy.cc Preparing to change the class name back to QPDFObject --- cSpell.json | 1 - include/qpdf/QPDFObject.hh | 18 ++++++++++++++---- libqpdf/CMakeLists.txt | 2 +- libqpdf/QPDF.cc | 2 +- libqpdf/{QPDFValueProxy.cc => QPDFObject.cc} | 2 +- libqpdf/QPDFObjectHandle.cc | 2 +- libqpdf/QPDFValue.cc | 2 +- ...QPDFValueProxy.hh => QPDFObject_private.hh} | 10 +++++++--- 8 files changed, 26 insertions(+), 13 deletions(-) rename libqpdf/{QPDFValueProxy.cc => QPDFObject.cc} (86%) rename libqpdf/qpdf/{QPDFValueProxy.hh => QPDFObject_private.hh} (92%) diff --git a/cSpell.json b/cSpell.json index 3c78fc51..2e33690e 100644 --- a/cSpell.json +++ b/cSpell.json @@ -425,7 +425,6 @@ "qpdftypes", "qpdfusage", "qpdfvalue", - "qpdfvalueproxy", "qpdfwriter", "qpdfx", "qpdfxrefentry", diff --git a/include/qpdf/QPDFObject.hh b/include/qpdf/QPDFObject.hh index 619f27f6..b46b2820 100644 --- a/include/qpdf/QPDFObject.hh +++ b/include/qpdf/QPDFObject.hh @@ -19,14 +19,24 @@ // continue to consider qpdf to be licensed under those terms. Please // see the manual for additional information. -#ifndef QPDFOBJECT_HH -#define QPDFOBJECT_HH +#ifndef QPDFOBJECT_OLD_HH +#define QPDFOBJECT_OLD_HH + +// ********************************************************************** +// +// This file is for backward compatibility. The header file for the +// internal QPDFObject class (not part of the public API) is in +// QPDFObject_private.hh (not installed). +// +// ********************************************************************** // ABI: in qpdf 12, leave this file in place and have it generate an // error. This is to prevent someone from being able to successfully // include this file and get a copy from a previous installation // thereby accidentally creating sources depend on having an older -// version installed. +// version installed. When enough time has passed, this file can be +// removed, and libqpdf/qpdf/QPDFObject_private.hh can be renamed to +// libqpdf/qpdf/QPDFObject.hh. #ifndef QPDF_OBJECT_NOWARN // ABI: remove this file in qpdf 12 @@ -66,4 +76,4 @@ class QPDFObject QPDFObject& operator=(QPDFObject const&) = delete; }; -#endif // QPDFOBJECT_HH +#endif // QPDFOBJECT_OLD_HH diff --git a/libqpdf/CMakeLists.txt b/libqpdf/CMakeLists.txt index 3084813d..1323e60c 100644 --- a/libqpdf/CMakeLists.txt +++ b/libqpdf/CMakeLists.txt @@ -72,6 +72,7 @@ set(libqpdf_SOURCES QPDFMatrix.cc QPDFNameTreeObjectHelper.cc QPDFNumberTreeObjectHelper.cc + QPDFObject.cc QPDFObjectHandle.cc QPDFObjGen.cc QPDFOutlineDocumentHelper.cc @@ -85,7 +86,6 @@ set(libqpdf_SOURCES QPDFTokenizer.cc QPDFUsage.cc QPDFValue.cc - QPDFValueProxy.cc QPDFWriter.cc QPDFXRefEntry.cc QPDF_Array.cc diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 1b1ee784..d56fb29d 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libqpdf/QPDFValueProxy.cc b/libqpdf/QPDFObject.cc similarity index 86% rename from libqpdf/QPDFValueProxy.cc rename to libqpdf/QPDFObject.cc index c315128c..b5d073ab 100644 --- a/libqpdf/QPDFValueProxy.cc +++ b/libqpdf/QPDFObject.cc @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index d31af881..ab54b808 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/libqpdf/QPDFValue.cc b/libqpdf/QPDFValue.cc index 957cc350..99fd77d7 100644 --- a/libqpdf/QPDFValue.cc +++ b/libqpdf/QPDFValue.cc @@ -1,6 +1,6 @@ #include -#include +#include std::shared_ptr QPDFValue::do_create(QPDFValue* object) diff --git a/libqpdf/qpdf/QPDFValueProxy.hh b/libqpdf/qpdf/QPDFObject_private.hh similarity index 92% rename from libqpdf/qpdf/QPDFValueProxy.hh rename to libqpdf/qpdf/QPDFObject_private.hh index ff3f80b6..84aaabe4 100644 --- a/libqpdf/qpdf/QPDFValueProxy.hh +++ b/libqpdf/qpdf/QPDFObject_private.hh @@ -1,5 +1,9 @@ -#ifndef QPDFVALUEPROXY_HH -#define QPDFVALUEPROXY_HH +#ifndef QPDFOBJECT_HH +#define QPDFOBJECT_HH + +// NOTE: This file is called QPDFObject_private.hh instead of +// QPDFObject.hh because of include/qpdf/QPDFObject.hh. See comments +// there for an explanation. #include #include @@ -149,4 +153,4 @@ class QPDFValueProxy std::shared_ptr value; }; -#endif // QPDFVALUEPROXY_HH +#endif // QPDFOBJECT_HH