SectionPairRow.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-08
  6. * Changed: 2023-02-12
  7. *
  8. * */
  9. #ifndef LS_STD_SECTION_PAIR_ROW_HPP
  10. #define LS_STD_SECTION_PAIR_ROW_HPP
  11. #include <ls-std/core/Class.hpp>
  12. #include <ls-std/io/section-pair/SectionPairRowEnumType.hpp>
  13. #include <ls-std/io/section-pair/SectionPairTypes.hpp>
  14. #include <ls-std/io/section-pair/model/SectionPairRowValue.hpp>
  15. #include <ls-std/os/dynamic-goal.hpp>
  16. #include <memory>
  17. namespace ls::std::io
  18. {
  19. class LS_STD_DYNAMIC_GOAL SectionPairRow : public ls::std::core::Class
  20. {
  21. public:
  22. explicit SectionPairRow(const ls::std::io::section_pair_identifier &_key, const ls::std::io::SectionPairRowEnumType &_type);
  23. ~SectionPairRow() override;
  24. [[nodiscard]] ls::std::io::section_pair_identifier getKey();
  25. [[nodiscard]] ::std::shared_ptr<ls::std::io::SectionPairRowValue> getValue();
  26. [[nodiscard]] bool isList();
  27. [[nodiscard]] bool isSingleValue();
  28. void setKey(const ls::std::io::section_pair_identifier &_key);
  29. private:
  30. ls::std::io::section_pair_identifier key{};
  31. ::std::shared_ptr<ls::std::io::SectionPairRowValue> value{};
  32. void _initValue(const ls::std::io::SectionPairRowEnumType &_type);
  33. void _setKey(const ls::std::io::section_pair_identifier &_key);
  34. };
  35. }
  36. #endif