SectionPairRowSingleValueArgumentEvaluator.cpp 1.3 KB

123456789101112131415161718192021222324252627
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-02-19
  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/SectionPairRowSingleValueArgumentEvaluator.hpp>
  12. #include <ls-std/io/section-pair/validator/SectionPairRowSingleValueValidator.hpp>
  13. ls::std::io::SectionPairRowSingleValueArgumentEvaluator::SectionPairRowSingleValueArgumentEvaluator(::std::string _singleValueRow) : ls::std::core::Class("SectionPairRowSingleValueArgumentEvaluator"), singleValueRow(::std::move(_singleValueRow))
  14. {}
  15. ls::std::io::SectionPairRowSingleValueArgumentEvaluator::~SectionPairRowSingleValueArgumentEvaluator() noexcept = default;
  16. void ls::std::io::SectionPairRowSingleValueArgumentEvaluator::evaluate()
  17. {
  18. if (!ls::std::io::SectionPairRowSingleValueValidator{this->singleValueRow}.isValid())
  19. {
  20. ::std::string message = "\"" + this->singleValueRow + "\" is not a valid section pair single value row!";
  21. throw ls::std::core::IllegalArgumentException{ls::std::io::SectionPairMessageFormatter::getFormattedMessage(message)};
  22. }
  23. }