//
// Created by Иван_Архипов on 31.10.2017.
//

#ifndef LOTRO_DAT_PATCHER_BINARYDATA_H
#define LOTRO_DAT_PATCHER_BINARYDATA_H

#include <cstdio>
#include <string>

extern  "C++"
{
namespace LOTRO_DAT
{
    class BinaryData
    {
    public:
        BinaryData();
        BinaryData(const BinaryData &d);
        explicit BinaryData(unsigned int size);
        ~BinaryData();

        unsigned char& operator[] (const unsigned int &pos);

        template <int T>
        long long ToNumber(const long long &pos) const;

        template <int T>
        void FromNumber(const long long &number);

        size_t size() const;
        unsigned char* data() const;

        BinaryData& operator=(const BinaryData& data);

		bool WriteToFile(const char *filename) const;
		bool WriteToFile(const std::string &filename) const;

    private:
        unsigned char *data_;
        size_t size_;
    };
}
}

#endif //LOTRO_DAT_PATCHER_BINARYDATA_H