SectionPairRowArgumentEvaluator.cpp 1.2 KB

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