package.h 625 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "base/buffer.h"
  3. #include "util/map.hpp"
  4. namespace ylib
  5. {
  6. class package
  7. {
  8. public:
  9. struct packstruct
  10. {
  11. std::string name;
  12. ylib::buffer data;
  13. };
  14. public:
  15. package();
  16. ~package();
  17. bool parse(const ylib::buffer& data);
  18. bool add(const std::string& name, const ylib::buffer& data);
  19. void to(const std::string& password, ylib::buffer& data);
  20. bool get(const std::string& name, ylib::buffer& data);
  21. void clear();
  22. void ___test__c_to_utf8();
  23. private:
  24. void free();
  25. private:
  26. ylib::map<std::string, packstruct*> m_list;
  27. ylib::map<std::string, ylib::buffer*> m_parse_list;
  28. };
  29. }