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

#ifndef LOTRO_DAT_LIBRARY_SUBFILEDATA_H
#define LOTRO_DAT_LIBRARY_SUBFILEDATA_H

#include <string>
#include <yaml-cpp/yaml.h>
#include "BinaryData.h"

namespace LOTRO_DAT {
    struct SubfileData {
    public:
        SubfileData() {
            binary_data = BinaryData();
            text_data = std::u16string();
            options = YAML::Node();
        }

        SubfileData(const BinaryData &binary_data_, const std::u16string &text_data_, const YAML::Node &options_) {
            binary_data = binary_data_;
            text_data = text_data_;
            options = options_;
        }

        bool Empty() const {
            return binary_data.size() == 0 && text_data.length() == 0;
        }

        bool operator == (const SubfileData &other) {
            return binary_data == other.binary_data && text_data == other.text_data;
        }

        bool operator != (const SubfileData &other) {
            return !(*this == other);
        }

    public:
        BinaryData binary_data;
        std::u16string text_data;
        YAML::Node options;
    };
}

#endif //LOTRO_DAT_LIBRARY_SUBFILEDATA_H
