mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Object loading
This commit is contained in:
@@ -20,14 +20,48 @@
|
||||
#define PDFDOCUMENT_H
|
||||
|
||||
#include "pdfglobal.h"
|
||||
#include "pdfobject.h"
|
||||
|
||||
namespace pdf
|
||||
{
|
||||
|
||||
/// Storage for objects. This class is not thread safe for writing (calling non-const functions). Caller must ensure
|
||||
/// locking, if this object is used from multiple threads. Calling const functions should be thread safe.
|
||||
class PDFObjectStorage
|
||||
{
|
||||
public:
|
||||
constexpr inline PDFObjectStorage() = default;
|
||||
|
||||
constexpr inline PDFObjectStorage(const PDFObjectStorage&) = default;
|
||||
constexpr inline PDFObjectStorage(PDFObjectStorage&&) = default;
|
||||
|
||||
constexpr inline PDFObjectStorage& operator=(const PDFObjectStorage&) = default;
|
||||
constexpr inline PDFObjectStorage& operator=(PDFObjectStorage&&) = default;
|
||||
|
||||
|
||||
struct Entry
|
||||
{
|
||||
constexpr inline explicit Entry() = default;
|
||||
inline explicit Entry(PDFInteger generation, PDFObject object) : generation(generation), object(std::move(object)) { }
|
||||
|
||||
PDFInteger generation = 0;
|
||||
PDFObject object;
|
||||
};
|
||||
|
||||
using PDFObjects = std::vector<Entry>;
|
||||
|
||||
private:
|
||||
PDFObjects m_pdfObjects;
|
||||
};
|
||||
|
||||
class PDFDocument
|
||||
{
|
||||
public:
|
||||
explicit PDFDocument() = default;
|
||||
|
||||
private:
|
||||
/// Storage of objects
|
||||
PDFObjectStorage m_pdfObjectStorage;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
Reference in New Issue
Block a user