SectionPairRowListValueArgumentEvaluator.cpp 1.2 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-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/SectionPairRowListValueArgumentEvaluator.hpp>
  12. #include <ls-std/io/section-pair/validator/SectionPairRowListValueValidator.hpp>
  13. ls::std::io::SectionPairRowListValueArgumentEvaluator::SectionPairRowListValueArgumentEvaluator(::std::string _listValueRow) : ls::std::core::Class("SectionPairRowListValueArgumentEvaluator"), listValueRow(::std::move(_listValueRow))
  14. {}
  15. ls::std::io::SectionPairRowListValueArgumentEvaluator::~SectionPairRowListValueArgumentEvaluator() = default;
  16. void ls::std::io::SectionPairRowListValueArgumentEvaluator::evaluate()
  17. {
  18. if (!ls::std::io::SectionPairRowListValueValidator{this->listValueRow}.isValid())
  19. {
  20. ::std::string message = "\"" + this->listValueRow + "\" is not a valid section pair list value row!";
  21. throw ls::std::core::IllegalArgumentException{ls::std::io::SectionPairMessageFormatter::getFormattedMessage(message)};
  22. }
  23. }