SectionPairRowArgumentEvaluator.cpp 1.0 KB

123456789101112131415161718192021222324252627
  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-20
  7. *
  8. * */
  9. #include <ls-std/core/exception/IllegalArgumentException.hpp>
  10. #include <ls-std/io/section-pair/evaluator/SectionPairRowArgumentEvaluator.hpp>
  11. #include <ls-std/io/section-pair/validator/SectionPairRowValidator.hpp>
  12. #include <string>
  13. ls::std::io::SectionPairRowArgumentEvaluator::SectionPairRowArgumentEvaluator(::std::string _sectionPairRow) : ls::std::core::Class("SectionPairRowArgumentEvaluator"), sectionPairRow(::std::move(_sectionPairRow))
  14. {}
  15. ls::std::io::SectionPairRowArgumentEvaluator::~SectionPairRowArgumentEvaluator() = default;
  16. void ls::std::io::SectionPairRowArgumentEvaluator::evaluate()
  17. {
  18. if (!ls::std::io::SectionPairRowValidator{this->sectionPairRow}.isValid())
  19. {
  20. ::std::string message = "\"" + this->sectionPairRow + "\" is not a valid section pair row!";
  21. throw ls::std::core::IllegalArgumentException{message};
  22. }
  23. }