mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Advanced functions
This commit is contained in:
@ -217,7 +217,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
/// Guard guarding the cyclical references.
|
||||
/// Guard guarding the cyclical references (by reference).
|
||||
class PDFParsingContextGuard
|
||||
{
|
||||
public:
|
||||
@ -238,6 +238,33 @@ public:
|
||||
PDFObjectReference m_reference;
|
||||
};
|
||||
|
||||
/// Guard guarding the cyclical references (by object).
|
||||
class PDFParsingContextObjectGuard
|
||||
{
|
||||
public:
|
||||
explicit inline PDFParsingContextObjectGuard(PDFParsingContext* context, const PDFObject* object) :
|
||||
m_context(context),
|
||||
m_object(object)
|
||||
{
|
||||
if (object->isReference())
|
||||
{
|
||||
m_context->beginParsingObject(object->getReference());
|
||||
}
|
||||
}
|
||||
|
||||
inline ~PDFParsingContextObjectGuard()
|
||||
{
|
||||
if (m_object->isReference())
|
||||
{
|
||||
m_context->endParsingObject(m_object->getReference());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
PDFParsingContext* m_context;
|
||||
const PDFObject* m_object;
|
||||
};
|
||||
|
||||
/// Returns dereferenced object, if object is a reference. If it is not a reference,
|
||||
/// then same object is returned.
|
||||
PDFObject getObject(const PDFObject& object);
|
||||
@ -257,7 +284,7 @@ private:
|
||||
|
||||
/// Class for parsing objects. Checks cyclical references. If
|
||||
/// the object cannot be obtained from the stream, exception is thrown.
|
||||
class PDFParser
|
||||
class PDFFORQTLIBSHARED_EXPORT PDFParser
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(pdf::PDFParser)
|
||||
|
||||
|
Reference in New Issue
Block a user