KvDocument.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2020-12-25
  6. * Changed: 2022-07-03
  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. #include <ls_std/os/dynamic_goal.hpp>
  16. namespace ls::std::io
  17. {
  18. class LS_STD_DYNAMIC_GOAL KvDocument : public ls::std::core::Class
  19. {
  20. public:
  21. KvDocument();
  22. ~KvDocument() override = default;
  23. bool addPair(ls::std::io::KvPair _pair);
  24. void clear();
  25. ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> getPairs();
  26. bool hasPair(const ls::std::core::type::kv_key &_key);
  27. bool removePair(const ls::std::core::type::kv_key &_key);
  28. private:
  29. ::std::map<ls::std::core::type::kv_key, ls::std::io::KvPair> pairs{};
  30. bool _hasPair(const ls::std::core::type::kv_key &_key);
  31. };
  32. }
  33. #endif