Object loading

This commit is contained in:
Jakub Melka
2018-11-25 14:48:08 +01:00
parent 8c93c82228
commit 89d4ee606b
12 changed files with 234 additions and 18 deletions

View File

@@ -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