#pragma once

#include "PdfDictionary.h"

#include <memory>
#include <string>

class PdfXRefTable;

class PdfObject
{
public:
    virtual ~PdfObject() = default;

    std::string getStringPrefix() const;

    std::string getStringSuffix() const;

    std::string getRefString() const;

    virtual unsigned indexObjects(unsigned count);

    bool isFree() const;

    virtual std::string toString(PdfXRefTable* xRefTable);

    void setObjectNumber(unsigned num);

    void setGenerationNumber(unsigned num);

protected:
    virtual void updateDictionary();

    unsigned mObjectNumber{0};
    unsigned mGenerationNumber{0};
    PdfDictionary mDictionary;
    bool mIsFree {false};
};
using PdfObjectPtr = std::unique_ptr<PdfObject>;
