SectionPairRowListValueArgumentEvaluator.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  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-23
  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. using ls::std::core::Class;
  14. using ls::std::core::IllegalArgumentException;
  15. using ls::std::io::SectionPairMessageFormatter;
  16. using ls::std::io::SectionPairRowListValueArgumentEvaluator;
  17. using ls::std::io::SectionPairRowListValueValidator;
  18. using std::move;
  19. using std::string;
  20. SectionPairRowListValueArgumentEvaluator::SectionPairRowListValueArgumentEvaluator(string _listValueRow) : Class("SectionPairRowListValueArgumentEvaluator"), listValueRow(::move(_listValueRow))
  21. {}
  22. SectionPairRowListValueArgumentEvaluator::~SectionPairRowListValueArgumentEvaluator() noexcept = default;
  23. void SectionPairRowListValueArgumentEvaluator::evaluate()
  24. {
  25. if (!SectionPairRowListValueValidator{this->listValueRow}.isValid())
  26. {
  27. string message = "\"" + this->listValueRow + "\" is not a valid section pair list value row!";
  28. throw IllegalArgumentException{SectionPairMessageFormatter::getFormattedMessage(message)};
  29. }
  30. }