/*
* Author:          Patrick-Christopher Mattulat
* Co-Author:       Claude Sonnet 4.6 (LLM)
* Company:         Lynar Studios
* E-Mail:          webmaster@lynarstudios.com
* Created:         2023-02-20
* Changed:         2026-06-23
*
* */

#include <ls-std/core/exception/IllegalArgumentException.hpp>
#include <ls-std/io/section-pair/SectionPairMessageFormatter.hpp>
#include <ls-std/io/section-pair/evaluator/SectionPairSectionArgumentEvaluator.hpp>
#include <ls-std/io/section-pair/validator/SectionPairSectionValidator.hpp>

using ls::standard::core::Class;
using ls::standard::core::IllegalArgumentException;
using ls::standard::io::SectionPairMessageFormatter;
using ls::standard::io::SectionPairSectionArgumentEvaluator;
using ls::standard::io::SectionPairSectionValidator;
using std::move;
using std::string;

SectionPairSectionArgumentEvaluator::SectionPairSectionArgumentEvaluator(string _section) : Class("SectionPairSectionArgumentEvaluator"), section(::move(_section))
{}

SectionPairSectionArgumentEvaluator::~SectionPairSectionArgumentEvaluator() noexcept = default;

void SectionPairSectionArgumentEvaluator::evaluate()
{
  if (!SectionPairSectionValidator{this->section}.isValid())
  {
    const string message = "\"" + this->section + "\" is not a valid section!";
    throw IllegalArgumentException{SectionPairMessageFormatter::getFormattedMessage(message)};
  }
}
