diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/QPDFObject.hh | 5 | ||||
-rw-r--r-- | include/qpdf/QPDFValue.hh | 16 |
2 files changed, 15 insertions, 6 deletions
diff --git a/include/qpdf/QPDFObject.hh b/include/qpdf/QPDFObject.hh index db6efa4c..a1930168 100644 --- a/include/qpdf/QPDFObject.hh +++ b/include/qpdf/QPDFObject.hh @@ -87,7 +87,7 @@ class QPDFObject object_type_e getTypeCode() const { - return value->getTypeCode(); + return value->type_code; } // Return a string literal that describes the type, useful for @@ -95,9 +95,8 @@ class QPDFObject char const* getTypeName() const { - return value->getTypeName(); + return value->type_name; } - void setDescription(QPDF* qpdf, std::string const& description) { diff --git a/include/qpdf/QPDFValue.hh b/include/qpdf/QPDFValue.hh index b957b813..33558f1b 100644 --- a/include/qpdf/QPDFValue.hh +++ b/include/qpdf/QPDFValue.hh @@ -43,8 +43,6 @@ class QPDFValue virtual std::shared_ptr<QPDFObject> shallowCopy() = 0; virtual std::string unparse() = 0; virtual JSON getJSON(int json_version) = 0; - virtual qpdf_object_type_e getTypeCode() const = 0; - virtual char const* getTypeName() const = 0; virtual void setDescription(QPDF* qpdf, std::string const& description) { @@ -75,7 +73,17 @@ class QPDFValue } protected: - QPDFValue() = default; + QPDFValue() : + type_code(::ot_uninitialized), + type_name("uninitilized") + { + } + QPDFValue(qpdf_object_type_e type_code, char const* type_name) : + type_code(type_code), + type_name(type_name) + { + } + virtual void releaseResolved() { @@ -88,6 +96,8 @@ class QPDFValue QPDF* owning_qpdf{nullptr}; std::string object_description; qpdf_offset_t parsed_offset{-1}; + const qpdf_object_type_e type_code; + char const* type_name; }; #endif // QPDFVALUE_HH |