123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /*
- * Author: Patrick-Christopher Mattulat
- * Company: Lynar Studios
- * E-Mail: webmaster@lynarstudios.com
- * Created: 2023-02-10
- * Changed: 2023-02-13
- *
- * */
- #include <ls-std/core/ConditionalFunctionExecutor.hpp>
- #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
- #include <ls-std/io/section-pair/evaluator/SectionPairRowValueArgumentEvaluator.hpp>
- #include <ls-std/io/section-pair/model/SectionPairRowSingleValue.hpp>
- #include <ls-std/io/section-pair/serialization/SerializableSectionPairRowSingleValue.hpp>
- ls::std::io::SectionPairRowSingleValue::SectionPairRowSingleValue(const ls::std::io::section_pair_row_value &_value) : ls::std::core::Class("SectionPairRowSingleValue"), ls::std::io::SectionPairRowValue(ls::std::io::SECTION_PAIR_ROW_SINGLE_VALUE)
- {
- this->_set(_value);
- }
- ls::std::io::SectionPairRowSingleValue::~SectionPairRowSingleValue() = default;
- ls::std::io::section_pair_row_value ls::std::io::SectionPairRowSingleValue::get()
- {
- return this->value;
- }
- ls::std::io::SectionPairRowEnumType ls::std::io::SectionPairRowSingleValue::getType()
- {
- return this->type;
- }
- ls::std::core::type::byte_field ls::std::io::SectionPairRowSingleValue::marshal()
- {
- ls::std::core::ConditionalFunctionExecutor{this->serializable == nullptr}.execute([this] { _createSerializable(); });
- return this->serializable->marshal();
- }
- void ls::std::io::SectionPairRowSingleValue::set(const ls::std::io::section_pair_row_value &_value)
- {
- this->_set(_value);
- }
- void ls::std::io::SectionPairRowSingleValue::unmarshal(const ls::std::core::type::byte_field &_data)
- {
- ls::std::core::ConditionalFunctionExecutor{this->serializable == nullptr}.execute([this] { _createSerializable(); });
- this->serializable->unmarshal(_data);
- }
- void ls::std::io::SectionPairRowSingleValue::_createSerializable()
- {
- this->serializable = ::std::make_shared<ls::std::io::SerializableSectionPairRowSingleValue>(shared_from_this());
- }
- void ls::std::io::SectionPairRowSingleValue::_set(const ls::std::io::section_pair_row_value &_value)
- {
- ls::std::core::EmptyStringArgumentEvaluator{_value}.evaluate();
- ls::std::io::SectionPairRowValueArgumentEvaluator(_value, "section pair single value \"" + _value + "\" contains invalid characters!").evaluate();
- this->value = _value;
- }
|