SectionPairRowArgumentEvaluator.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Co-Author: Claude Sonnet 4.6 (LLM)
  4. * Company: Lynar Studios
  5. * E-Mail: webmaster@lynarstudios.com
  6. * Created: 2023-02-20
  7. * Changed: 2026-06-23
  8. *
  9. * */
  10. #include <ls-std/core/exception/IllegalArgumentException.hpp>
  11. #include <ls-std/io/section-pair/SectionPairMessageFormatter.hpp>
  12. #include <ls-std/io/section-pair/evaluator/SectionPairRowArgumentEvaluator.hpp>
  13. #include <ls-std/io/section-pair/validator/SectionPairRowValidator.hpp>
  14. #include <string>
  15. using ls::standard::core::Class;
  16. using ls::standard::core::IllegalArgumentException;
  17. using ls::standard::io::SectionPairMessageFormatter;
  18. using ls::standard::io::SectionPairRowArgumentEvaluator;
  19. using ls::standard::io::SectionPairRowValidator;
  20. using std::move;
  21. using std::string;
  22. SectionPairRowArgumentEvaluator::SectionPairRowArgumentEvaluator(string _sectionPairRow) : Class("SectionPairRowArgumentEvaluator"), sectionPairRow(::move(_sectionPairRow))
  23. {}
  24. SectionPairRowArgumentEvaluator::~SectionPairRowArgumentEvaluator() noexcept = default;
  25. void SectionPairRowArgumentEvaluator::evaluate()
  26. {
  27. if (!SectionPairRowValidator{this->sectionPairRow}.isValid())
  28. {
  29. const string message = "\"" + this->sectionPairRow + "\" is not a valid section pair row!";
  30. throw IllegalArgumentException{SectionPairMessageFormatter::getFormattedMessage(message)};
  31. }
  32. }