SectionPairRow.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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-08
  7. *
  8. * */
  9. #include <ls-std/io/section-pair/SectionPairRow.hpp>
  10. ls::std::io::SectionPairRow::SectionPairRow(const ::std::string &_key) : ls::std::core::Class("SectionPairRow")
  11. {
  12. //ls::std::io::SectionPairRowKeyArgumentEvaluator{_key}.evaluate();
  13. this->key = _key;
  14. }
  15. ls::std::io::SectionPairRow::~SectionPairRow() = default;
  16. ::std::string ls::std::io::SectionPairRow::getValue()
  17. {
  18. return this->values.empty() ? "" : this->values.front();
  19. }
  20. bool ls::std::io::SectionPairRow::isKeyValue()
  21. {
  22. return this->type == ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_KEY_VALUE;
  23. }
  24. bool ls::std::io::SectionPairRow::isList()
  25. {
  26. return this->type == ls::std::io::SectionPairRowEnumType::SECTION_PAIR_ROW_LIST;
  27. }
  28. void ls::std::io::SectionPairRow::setValue(const ::std::string &_value)
  29. {
  30. //ls::std::core::EmptyStringArgumentEvaluator{_value}.evaluate();
  31. if (!this->values.empty())
  32. {
  33. this->values.pop_front();
  34. }
  35. this->values.push_back(_value);
  36. }