diff options
author | m-holger <m-holger@kubitscheck.org> | 2022-08-02 23:57:33 +0200 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2022-09-01 15:29:02 +0200 |
commit | c7005e8a6d626d1c66bd780314c2520d12b0ca9a (patch) | |
tree | 45c4e9d2c7f854fe3fd6823d7c867c42f2f6d241 /include | |
parent | 27fae2b55e835a41277df78f090d4baf6fe05c1e (diff) | |
download | qpdf-c7005e8a6d626d1c66bd780314c2520d12b0ca9a.tar.zst |
Remove virtual methods QPDFValue::getTypeCode and getTypeName
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 |