From 4c6640cb455bc9e8a2e2150be2e48455be341325 Mon Sep 17 00:00:00 2001 From: m-holger Date: Wed, 6 Jul 2022 20:27:39 +0100 Subject: Inline QPDFObjGen methods ABI breaking change --- include/qpdf/QPDFObjGen.hh | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDFObjGen.hh b/include/qpdf/QPDFObjGen.hh index 2a778179..28042dde 100644 --- a/include/qpdf/QPDFObjGen.hh +++ b/include/qpdf/QPDFObjGen.hh @@ -23,6 +23,7 @@ #define QPDFOBJGEN_HH #include +#include #include // This class represents an object ID and generation pair. It is @@ -32,22 +33,48 @@ class QPDFObjGen { public: QPDF_DLL - QPDFObjGen(); + QPDFObjGen() : + obj(0), + gen(0) + { + } QPDF_DLL - QPDFObjGen(int obj, int gen); + QPDFObjGen(int obj, int gen) : + obj(obj), + gen(gen) + { + } QPDF_DLL - bool operator<(QPDFObjGen const&) const; + bool operator<(QPDFObjGen const& rhs) const + { + return ((obj < rhs.obj) || ((obj == rhs.obj) && (gen < rhs.gen))); + } QPDF_DLL - bool operator==(QPDFObjGen const&) const; + bool operator==(QPDFObjGen const& rhs) const + { + return ((obj == rhs.obj) && (gen == rhs.gen)); + } QPDF_DLL - int getObj() const; + int getObj() const + { + return obj; + } QPDF_DLL - int getGen() const; + int getGen() const + { + return gen; + } QPDF_DLL - std::string unparse() const; - + std::string unparse() const + { + return QUtil::int_to_string(obj) + "," + QUtil::int_to_string(gen); + } QPDF_DLL - friend std::ostream& operator<<(std::ostream&, const QPDFObjGen&); + friend std::ostream& operator<<(std::ostream& os, const QPDFObjGen& og) + { + os << og.obj << "," << og.gen; + return os; + } private: // This class does not use the Members pattern to avoid a memory -- cgit v1.2.3-54-g00ecf