SubfileData.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // Created by Иван_Архипов on 06.12.2017.
  3. //
  4. #ifndef LOTRO_DAT_LIBRARY_SUBFILEDATA_H
  5. #define LOTRO_DAT_LIBRARY_SUBFILEDATA_H
  6. #include <string>
  7. #include <yaml-cpp/yaml.h>
  8. #include "BinaryData.h"
  9. namespace LOTRO_DAT {
  10. class SubfileData {
  11. public:
  12. SubfileData() {
  13. binary_data = BinaryData(0);
  14. text_data = std::u16string();
  15. options = YAML::Node();
  16. }
  17. SubfileData(const BinaryData &binary_data_, const std::u16string &text_data_, const YAML::Node &options_) {
  18. binary_data = binary_data_;
  19. text_data = text_data_;
  20. options = options_;
  21. }
  22. bool Empty() const {
  23. return binary_data.size() == 0 && text_data.length() == 0;
  24. }
  25. bool operator == (const SubfileData &other) {
  26. return binary_data == other.binary_data && text_data == other.text_data;
  27. }
  28. bool operator != (const SubfileData &other) {
  29. return !(*this == other);
  30. }
  31. public:
  32. BinaryData binary_data;
  33. std::u16string text_data;
  34. YAML::Node options;
  35. };
  36. }
  37. #endif //LOTRO_DAT_LIBRARY_SUBFILEDATA_H