mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-31 02:48:31 +00:00
Split QPDFObject into QPDFObject and QPDFValue
This commit is contained in:
parent
43983109f2
commit
431bd666c0
@ -25,6 +25,7 @@
|
||||
#include <qpdf/Constants.h>
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/JSON.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
#include <string>
|
||||
@ -34,9 +35,9 @@ class QPDFObjectHandle;
|
||||
|
||||
class QPDFObject
|
||||
{
|
||||
public:
|
||||
QPDFObject();
|
||||
friend class QPDFValue;
|
||||
|
||||
public:
|
||||
// Objects derived from QPDFObject are accessible through
|
||||
// QPDFObjectHandle. Each object returns a unique type code that
|
||||
// has one of the valid qpdf_object_type_e values. As new object
|
||||
@ -63,17 +64,84 @@ class QPDFObject
|
||||
static constexpr object_type_e ot_inlineimage = ::ot_inlineimage;
|
||||
static constexpr object_type_e ot_unresolved = ::ot_unresolved;
|
||||
|
||||
QPDFObject() = default;
|
||||
virtual ~QPDFObject() = default;
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy() = 0;
|
||||
virtual std::string unparse() = 0;
|
||||
virtual JSON getJSON(int json_version) = 0;
|
||||
|
||||
std::shared_ptr<QPDFObject>
|
||||
shallowCopy()
|
||||
{
|
||||
return value->shallowCopy();
|
||||
}
|
||||
std::string
|
||||
unparse()
|
||||
{
|
||||
return value->unparse();
|
||||
}
|
||||
JSON
|
||||
getJSON(int json_version)
|
||||
{
|
||||
return value->getJSON(json_version);
|
||||
}
|
||||
|
||||
// Return a unique type code for the object
|
||||
virtual object_type_e getTypeCode() const = 0;
|
||||
object_type_e
|
||||
getTypeCode() const
|
||||
{
|
||||
return value->getTypeCode();
|
||||
}
|
||||
|
||||
// Return a string literal that describes the type, useful for
|
||||
// debugging and testing
|
||||
virtual char const* getTypeName() const = 0;
|
||||
char const*
|
||||
getTypeName() const
|
||||
{
|
||||
return value->getTypeName();
|
||||
}
|
||||
|
||||
void
|
||||
setDescription(QPDF* qpdf, std::string const& description)
|
||||
{
|
||||
return value->setDescription(qpdf, description);
|
||||
}
|
||||
bool
|
||||
getDescription(QPDF*& qpdf, std::string& description)
|
||||
{
|
||||
return value->getDescription(qpdf, description);
|
||||
}
|
||||
bool
|
||||
hasDescription()
|
||||
{
|
||||
return value->hasDescription();
|
||||
}
|
||||
void
|
||||
setParsedOffset(qpdf_offset_t offset)
|
||||
{
|
||||
value->setParsedOffset(offset);
|
||||
}
|
||||
qpdf_offset_t
|
||||
getParsedOffset()
|
||||
{
|
||||
return value->getParsedOffset();
|
||||
}
|
||||
void
|
||||
assign(std::shared_ptr<QPDFObject> o)
|
||||
{
|
||||
value = o->value;
|
||||
}
|
||||
void
|
||||
swapWith(std::shared_ptr<QPDFObject> o)
|
||||
{
|
||||
auto v = value;
|
||||
value = o->value;
|
||||
o->value = v;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T*
|
||||
as()
|
||||
{
|
||||
return dynamic_cast<T*>(value.get());
|
||||
}
|
||||
|
||||
// Accessor to give specific access to non-public methods
|
||||
class ObjAccessor
|
||||
@ -90,29 +158,20 @@ class QPDFObject
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
friend class ObjAccessor;
|
||||
|
||||
virtual void setDescription(QPDF*, std::string const&);
|
||||
bool getDescription(QPDF*&, std::string&);
|
||||
bool hasDescription();
|
||||
|
||||
void setParsedOffset(qpdf_offset_t offset);
|
||||
qpdf_offset_t getParsedOffset();
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
releaseResolved()
|
||||
{
|
||||
value->releaseResolved();
|
||||
}
|
||||
static std::shared_ptr<QPDFObject> do_create(QPDFObject*);
|
||||
|
||||
private:
|
||||
QPDFObject(QPDFObject const&) = delete;
|
||||
QPDFObject& operator=(QPDFObject const&) = delete;
|
||||
|
||||
QPDF* owning_qpdf;
|
||||
std::string object_description;
|
||||
qpdf_offset_t parsed_offset;
|
||||
std::shared_ptr<QPDFValue> value;
|
||||
};
|
||||
|
||||
#endif // QPDFOBJECT_HH
|
||||
|
93
include/qpdf/QPDFValue.hh
Normal file
93
include/qpdf/QPDFValue.hh
Normal file
@ -0,0 +1,93 @@
|
||||
// Copyright (c) 2005-2022 Jay Berkenbilt
|
||||
//
|
||||
// This file is part of qpdf.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
// Versions of qpdf prior to version 7 were released under the terms
|
||||
// of version 2.0 of the Artistic License. At your option, you may
|
||||
// continue to consider qpdf to be licensed under those terms. Please
|
||||
// see the manual for additional information.
|
||||
|
||||
#ifndef QPDFVALUE_HH
|
||||
#define QPDFVALUE_HH
|
||||
|
||||
#include <qpdf/Constants.h>
|
||||
#include <qpdf/DLL.h>
|
||||
#include <qpdf/JSON.hh>
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class QPDF;
|
||||
class QPDFObjectHandle;
|
||||
class QPDFObject;
|
||||
|
||||
class QPDFValue
|
||||
{
|
||||
friend class QPDFObject;
|
||||
|
||||
public:
|
||||
virtual ~QPDFValue() = default;
|
||||
|
||||
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)
|
||||
{
|
||||
owning_qpdf = qpdf;
|
||||
object_description = description;
|
||||
}
|
||||
bool
|
||||
getDescription(QPDF*& qpdf, std::string& description)
|
||||
{
|
||||
qpdf = owning_qpdf;
|
||||
description = object_description;
|
||||
return owning_qpdf != nullptr;
|
||||
}
|
||||
bool
|
||||
hasDescription()
|
||||
{
|
||||
return owning_qpdf != nullptr;
|
||||
}
|
||||
void
|
||||
setParsedOffset(qpdf_offset_t offset)
|
||||
{
|
||||
parsed_offset = offset;
|
||||
}
|
||||
qpdf_offset_t
|
||||
getParsedOffset()
|
||||
{
|
||||
return parsed_offset;
|
||||
}
|
||||
|
||||
protected:
|
||||
QPDFValue() = default;
|
||||
virtual void
|
||||
releaseResolved()
|
||||
{
|
||||
}
|
||||
static std::shared_ptr<QPDFObject> do_create(QPDFValue*);
|
||||
|
||||
private:
|
||||
QPDFValue(QPDFValue const&) = delete;
|
||||
QPDFValue& operator=(QPDFValue const&) = delete;
|
||||
QPDF* owning_qpdf{nullptr};
|
||||
std::string object_description;
|
||||
qpdf_offset_t parsed_offset{-1};
|
||||
};
|
||||
|
||||
#endif // QPDFVALUE_HH
|
@ -85,6 +85,7 @@ set(libqpdf_SOURCES
|
||||
QPDFSystemError.cc
|
||||
QPDFTokenizer.cc
|
||||
QPDFUsage.cc
|
||||
QPDFValue.cc
|
||||
QPDFWriter.cc
|
||||
QPDFXRefEntry.cc
|
||||
QPDF_Array.cc
|
||||
|
@ -1,47 +1 @@
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
|
||||
QPDFObject::QPDFObject() :
|
||||
owning_qpdf(nullptr),
|
||||
parsed_offset(-1)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<QPDFObject>
|
||||
QPDFObject::do_create(QPDFObject* object)
|
||||
{
|
||||
std::shared_ptr<QPDFObject> obj(object);
|
||||
return obj;
|
||||
}
|
||||
|
||||
void
|
||||
QPDFObject::setDescription(QPDF* qpdf, std::string const& description)
|
||||
{
|
||||
this->owning_qpdf = qpdf;
|
||||
this->object_description = description;
|
||||
}
|
||||
|
||||
bool
|
||||
QPDFObject::getDescription(QPDF*& qpdf, std::string& description)
|
||||
{
|
||||
qpdf = this->owning_qpdf;
|
||||
description = this->object_description;
|
||||
return this->owning_qpdf != nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
QPDFObject::hasDescription()
|
||||
{
|
||||
return this->owning_qpdf != nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
QPDFObject::setParsedOffset(qpdf_offset_t offset)
|
||||
{
|
||||
this->parsed_offset = offset;
|
||||
}
|
||||
|
||||
qpdf_offset_t
|
||||
QPDFObject::getParsedOffset()
|
||||
{
|
||||
return this->parsed_offset;
|
||||
}
|
||||
|
@ -280,68 +280,67 @@ QPDFObjectHandle::getTypeName()
|
||||
QPDF_Array*
|
||||
QPDFObjectHandle::asArray()
|
||||
{
|
||||
return isArray() ? dynamic_cast<QPDF_Array*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Array>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Bool*
|
||||
QPDFObjectHandle::asBool()
|
||||
{
|
||||
return isBool() ? dynamic_cast<QPDF_Bool*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Bool>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Dictionary*
|
||||
QPDFObjectHandle::asDictionary()
|
||||
{
|
||||
return isDictionary() ? dynamic_cast<QPDF_Dictionary*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Dictionary>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_InlineImage*
|
||||
QPDFObjectHandle::asInlineImage()
|
||||
{
|
||||
return isInlineImage() ? dynamic_cast<QPDF_InlineImage*>(obj.get())
|
||||
: nullptr;
|
||||
return dereference() ? obj->as<QPDF_InlineImage>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Integer*
|
||||
QPDFObjectHandle::asInteger()
|
||||
{
|
||||
return isInteger() ? dynamic_cast<QPDF_Integer*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Integer>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Name*
|
||||
QPDFObjectHandle::asName()
|
||||
{
|
||||
return isName() ? dynamic_cast<QPDF_Name*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Name>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Null*
|
||||
QPDFObjectHandle::asNull()
|
||||
{
|
||||
return isNull() ? dynamic_cast<QPDF_Null*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Null>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Operator*
|
||||
QPDFObjectHandle::asOperator()
|
||||
{
|
||||
return isOperator() ? dynamic_cast<QPDF_Operator*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Operator>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Real*
|
||||
QPDFObjectHandle::asReal()
|
||||
{
|
||||
return isReal() ? dynamic_cast<QPDF_Real*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Real>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Reserved*
|
||||
QPDFObjectHandle::asReserved()
|
||||
{
|
||||
return isReserved() ? dynamic_cast<QPDF_Reserved*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Reserved>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Stream*
|
||||
QPDFObjectHandle::asStream()
|
||||
{
|
||||
return isStream() ? dynamic_cast<QPDF_Stream*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_Stream>() : nullptr;
|
||||
}
|
||||
|
||||
QPDF_Stream*
|
||||
@ -355,7 +354,7 @@ QPDFObjectHandle::asStreamWithAssert()
|
||||
QPDF_String*
|
||||
QPDFObjectHandle::asString()
|
||||
{
|
||||
return isString() ? dynamic_cast<QPDF_String*>(obj.get()) : nullptr;
|
||||
return dereference() ? obj->as<QPDF_String>() : nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1716,11 +1715,8 @@ QPDFObjectHandle::unparseResolved()
|
||||
if (!dereference()) {
|
||||
throw std::logic_error(
|
||||
"attempted to dereference an uninitialized QPDFObjectHandle");
|
||||
} else if (isReserved()) {
|
||||
throw std::logic_error(
|
||||
"QPDFObjectHandle: attempting to unparse a reserved object");
|
||||
}
|
||||
return this->obj->unparse();
|
||||
return obj->unparse();
|
||||
}
|
||||
|
||||
std::string
|
||||
@ -1749,9 +1745,6 @@ QPDFObjectHandle::getJSON(int json_version, bool dereference_indirect)
|
||||
} else if (!dereference()) {
|
||||
throw std::logic_error(
|
||||
"attempted to dereference an uninitialized QPDFObjectHandle");
|
||||
} else if (isReserved()) {
|
||||
throw std::logic_error(
|
||||
"QPDFObjectHandle: attempting to unparse a reserved object");
|
||||
} else {
|
||||
return obj->getJSON(json_version);
|
||||
}
|
||||
|
11
libqpdf/QPDFValue.cc
Normal file
11
libqpdf/QPDFValue.cc
Normal file
@ -0,0 +1,11 @@
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
|
||||
std::shared_ptr<QPDFObject>
|
||||
QPDFValue::do_create(QPDFValue* object)
|
||||
{
|
||||
std::shared_ptr<QPDFObject> obj(new QPDFObject());
|
||||
obj->value = std::shared_ptr<QPDFValue>(object);
|
||||
return obj;
|
||||
}
|
@ -62,10 +62,10 @@ QPDF_Array::getJSON(int json_version)
|
||||
return j;
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Array::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_array;
|
||||
return ::ot_array;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -29,10 +29,10 @@ QPDF_Bool::getJSON(int json_version)
|
||||
return JSON::makeBool(this->val);
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Bool::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_boolean;
|
||||
return ::ot_boolean;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <qpdf/QPDF_Dictionary.hh>
|
||||
|
||||
#include <qpdf/QPDF_Name.hh>
|
||||
#include <qpdf/QPDF_Null.hh>
|
||||
|
||||
QPDF_Dictionary::QPDF_Dictionary(
|
||||
std::map<std::string, QPDFObjectHandle> const& items) :
|
||||
@ -58,10 +57,10 @@ QPDF_Dictionary::getJSON(int json_version)
|
||||
return j;
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Dictionary::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_dictionary;
|
||||
return ::ot_dictionary;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -29,10 +29,10 @@ QPDF_InlineImage::getJSON(int json_version)
|
||||
return JSON::makeNull();
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_InlineImage::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_inlineimage;
|
||||
return ::ot_inlineimage;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -31,10 +31,10 @@ QPDF_Integer::getJSON(int json_version)
|
||||
return JSON::makeInt(this->val);
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Integer::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_integer;
|
||||
return ::ot_integer;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -61,10 +61,10 @@ QPDF_Name::getJSON(int json_version)
|
||||
}
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Name::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_name;
|
||||
return ::ot_name;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -24,10 +24,10 @@ QPDF_Null::getJSON(int json_version)
|
||||
return JSON::makeNull();
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Null::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_null;
|
||||
return ::ot_null;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -20,7 +20,7 @@ QPDF_Operator::shallowCopy()
|
||||
std::string
|
||||
QPDF_Operator::unparse()
|
||||
{
|
||||
return this->val;
|
||||
return val;
|
||||
}
|
||||
|
||||
JSON
|
||||
@ -29,10 +29,10 @@ QPDF_Operator::getJSON(int json_version)
|
||||
return JSON::makeNull();
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Operator::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_operator;
|
||||
return ::ot_operator;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -60,10 +60,10 @@ QPDF_Real::getJSON(int json_version)
|
||||
return JSON::makeNumber(result);
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Real::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_real;
|
||||
return ::ot_real;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -30,10 +30,10 @@ QPDF_Reserved::getJSON(int json_version)
|
||||
return JSON::makeNull();
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Reserved::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_reserved;
|
||||
return ::ot_reserved;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -291,10 +291,10 @@ QPDF_Stream::getStreamJSON(
|
||||
return result;
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Stream::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_stream;
|
||||
return ::ot_stream;
|
||||
}
|
||||
|
||||
char const*
|
||||
@ -306,7 +306,7 @@ QPDF_Stream::getTypeName() const
|
||||
void
|
||||
QPDF_Stream::setDescription(QPDF* qpdf, std::string const& description)
|
||||
{
|
||||
this->QPDFObject::setDescription(qpdf, description);
|
||||
this->QPDFValue::setDescription(qpdf, description);
|
||||
setDictDescription();
|
||||
}
|
||||
|
||||
|
@ -84,10 +84,10 @@ QPDF_String::getJSON(int json_version)
|
||||
return JSON::makeString(result);
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_String::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_string;
|
||||
return ::ot_string;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -18,7 +18,7 @@ std::string
|
||||
QPDF_Unresolved::unparse()
|
||||
{
|
||||
throw std::logic_error(
|
||||
"attempted to unparse an unresolveded QPDFObjectHandle");
|
||||
"attempted to unparse an unresolved QPDFObjectHandle");
|
||||
return "";
|
||||
}
|
||||
|
||||
@ -28,10 +28,10 @@ QPDF_Unresolved::getJSON(int json_version)
|
||||
return JSON::makeNull();
|
||||
}
|
||||
|
||||
QPDFObject::object_type_e
|
||||
qpdf_object_type_e
|
||||
QPDF_Unresolved::getTypeCode() const
|
||||
{
|
||||
return QPDFObject::ot_unresolved;
|
||||
return ::ot_unresolved;
|
||||
}
|
||||
|
||||
char const*
|
||||
|
@ -1,13 +1,13 @@
|
||||
#ifndef QPDF_ARRAY_HH
|
||||
#define QPDF_ARRAY_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
#include <qpdf/SparseOHArray.hh>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
class QPDF_Array: public QPDFObject
|
||||
class QPDF_Array: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Array() = default;
|
||||
@ -17,7 +17,7 @@ class QPDF_Array: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
|
||||
int getNItems() const;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_BOOL_HH
|
||||
#define QPDF_BOOL_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Bool: public QPDFObject
|
||||
class QPDF_Bool: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Bool() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Bool: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
bool getVal() const;
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
#ifndef QPDF_DICTIONARY_HH
|
||||
#define QPDF_DICTIONARY_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include <qpdf/QPDFObjectHandle.hh>
|
||||
|
||||
class QPDF_Dictionary: public QPDFObject
|
||||
class QPDF_Dictionary: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Dictionary() = default;
|
||||
@ -17,7 +17,7 @@ class QPDF_Dictionary: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
|
||||
// hasKey() and getKeys() treat keys with null values as if they
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_INLINEIMAGE_HH
|
||||
#define QPDF_INLINEIMAGE_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_InlineImage: public QPDFObject
|
||||
class QPDF_InlineImage: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_InlineImage() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_InlineImage: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
std::string getVal() const;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_INTEGER_HH
|
||||
#define QPDF_INTEGER_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Integer: public QPDFObject
|
||||
class QPDF_Integer: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Integer() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Integer: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
long long getVal() const;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_NAME_HH
|
||||
#define QPDF_NAME_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Name: public QPDFObject
|
||||
class QPDF_Name: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Name() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Name: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
std::string getName() const;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_NULL_HH
|
||||
#define QPDF_NULL_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Null: public QPDFObject
|
||||
class QPDF_Null: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Null() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Null: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
|
||||
private:
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_OPERATOR_HH
|
||||
#define QPDF_OPERATOR_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Operator: public QPDFObject
|
||||
class QPDF_Operator: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Operator() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Operator: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
std::string getVal() const;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_REAL_HH
|
||||
#define QPDF_REAL_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Real: public QPDFObject
|
||||
class QPDF_Real: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Real() = default;
|
||||
@ -13,7 +13,7 @@ class QPDF_Real: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
std::string getVal();
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_RESERVED_HH
|
||||
#define QPDF_RESERVED_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Reserved: public QPDFObject
|
||||
class QPDF_Reserved: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Reserved() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Reserved: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
|
||||
private:
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
#include <qpdf/Types.h>
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFObjectHandle.hh>
|
||||
#include <qpdf/QPDFStreamFilter.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
@ -13,7 +13,7 @@
|
||||
class Pipeline;
|
||||
class QPDF;
|
||||
|
||||
class QPDF_Stream: public QPDFObject
|
||||
class QPDF_Stream: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Stream() = default;
|
||||
@ -26,7 +26,7 @@ class QPDF_Stream: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
virtual void setDescription(QPDF*, std::string const&);
|
||||
QPDFObjectHandle getDict() const;
|
||||
|
@ -1,11 +1,11 @@
|
||||
#ifndef QPDF_STRING_HH
|
||||
#define QPDF_STRING_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
// QPDF_Strings may included embedded null characters.
|
||||
|
||||
class QPDF_String: public QPDFObject
|
||||
class QPDF_String: public QPDFValue
|
||||
{
|
||||
friend class QPDFWriter;
|
||||
|
||||
@ -16,7 +16,7 @@ class QPDF_String: public QPDFObject
|
||||
create_utf16(std::string const& utf8_val);
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
std::string unparse(bool force_binary);
|
||||
virtual JSON getJSON(int json_version);
|
||||
|
@ -1,9 +1,9 @@
|
||||
#ifndef QPDF_UNRESOLVED_HH
|
||||
#define QPDF_UNRESOLVED_HH
|
||||
|
||||
#include <qpdf/QPDFObject.hh>
|
||||
#include <qpdf/QPDFValue.hh>
|
||||
|
||||
class QPDF_Unresolved: public QPDFObject
|
||||
class QPDF_Unresolved: public QPDFValue
|
||||
{
|
||||
public:
|
||||
virtual ~QPDF_Unresolved() = default;
|
||||
@ -11,7 +11,7 @@ class QPDF_Unresolved: public QPDFObject
|
||||
virtual std::shared_ptr<QPDFObject> shallowCopy();
|
||||
virtual std::string unparse();
|
||||
virtual JSON getJSON(int json_version);
|
||||
virtual QPDFObject::object_type_e getTypeCode() const;
|
||||
virtual qpdf_object_type_e getTypeCode() const;
|
||||
virtual char const* getTypeName() const;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user