SectionPairRow.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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-10
  7. *
  8. * */
  9. #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
  10. #include <ls-std/io/section-pair/SectionPairIdentifierArgumentEvaluator.hpp>
  11. #include <ls-std/io/section-pair/SectionPairRow.hpp>
  12. ls::std::io::SectionPairRow::SectionPairRow(const ls::std::io::section_pair_identifier &_key) : ls::std::core::Class("SectionPairRow")
  13. {
  14. ls::std::core::EmptyStringArgumentEvaluator{_key, "passed key identifier for section pair row is empty!"}.evaluate();
  15. ls::std::io::SectionPairIdentifierArgumentEvaluator(_key, "section pair key identifier \"" + _key + "\" contains invalid characters!").evaluate();
  16. this->key = _key;
  17. }
  18. ls::std::io::SectionPairRow::~SectionPairRow() = default;
  19. ls::std::io::section_pair_row_value ls::std::io::SectionPairRow::getKey()
  20. {
  21. return this->key;
  22. }
  23. bool ls::std::io::SectionPairRow::isList()
  24. {
  25. return this->type == ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST;
  26. }
  27. bool ls::std::io::SectionPairRow::isSingleValue()
  28. {
  29. return this->type == ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_SINGLE_VALUE;
  30. }