#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>;
