KvDocument.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-12-25
  6. * Changed: 2022-05-12
  7. *
  8. * */
  9. #ifndef LS_STD_KV_DOCUMENT_HPP
  10. #define LS_STD_KV_DOCUMENT_HPP
  11. #include <ls_std/core/Class.hpp>
  12. #include "KvPair.hpp"
  13. #include <ls_std/core/types/KvTypes.hpp>
  14. #include <map>
  15. namespace ls
  16. {
  17. namespace std
  18. {
  19. namespace io
  20. {
  21. class KvDocument : public ls::std::core::Class
  22. {
  23. public:
  24. KvDocument();
  25. ~KvDocument() override = default;
  26. bool addPair(ls::std::io::KvPair _pair);
  27. void clear();
  28. ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> getPairs();
  29. bool hasPair(const ls::std::core::type::kv_key &_key);
  30. bool removePair(const ls::std::core::type::kv_key &_key);
  31. private:
  32. ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> pairs{};
  33. bool _hasPair(const ls::std::core::type::kv_key &_key);
  34. };
  35. }
  36. }
  37. }
  38. #endif