|
| using | FFIRN_Func = std::function<bool(void)> |
| using | FFIRN_DescriptorMap = std::unordered_map<std::string, FFIRN_Func> |
| static bool | IsInSelection (const std::string &aValue, const std::vector< std::string > &choices) noexcept |
| static bool | IsStringLength (const std::string &aValue, size_t aLength) noexcept |
| static size_t | CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters) noexcept |
| | Returns the positions of a specified delimiter if present, npos if not.
|
| static size_t | CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters, std::string &aFoundDelimeter) noexcept |
| template<class T> |
| static bool | IsInRange (T aValue, T aLowerBound, T aUpperBound) noexcept |
| bool | IsValidRadius () noexcept |
| bool | IsValidUnitOfMeasureForRadius (const std::string &aUom) noexcept |
| bool | IsInvalidRange (double aValue) noexcept |
| bool | ValidateByDescriptor (const FFIRN_DescriptorMap &aDescriptorMap) |
| | Speed up validation if descriptor is present. Runs all functions if it isn't.
|
| void | ClearErrorsIfValid (bool aHasAtLeastOnePassed) noexcept |
| void | SetField (const Field &aField) noexcept |
| | Field Setter for internal use only.
|
| void | AddError (const ValidationError &aError) noexcept |
| void | AddError (const std::string &aFailureReason, const std::string &aValueValidatied, const std::string &aOptionalSuggestion="") noexcept |
| void | AddError (const std::string &aErrorMessage) noexcept |
| void | AddErrors (const std::vector< ValidationError > &aErrors) noexcept |
| void | ClearErrors () noexcept |
FFIRN_Validator responsible for the validation and property extraction of usmtf InnerOuterRange. An InnerOuterRange is essentially two radius (as I use Radius class often to show distance, one inner and one outer. Its represented in the usmtf as the following: |This part to the end. EXAMPLE: /SECTIO:058190T45-60NM Given SectorGeometry covers start stop angle, this is used by it to cover parsing and validation of the inner outer Radii.
| bool usmtf::InnerOuterRange::ParseAndValidate |
( |
const Field & | aField | ) |
|
|
overridevirtual |
I am not a huge fan of violating command query separation. But, in this case it makes sense. The functions that come into ParseAndValidate have to parse to get value of the component, sometimes there are many components in a single field. Unfortunately parsing is an intertwined attribute of validation. You cant parse according to some rule set if the field is invalid, making it impossible to separate the two notions easily. I have opted to instead name the functions for what they are actually doing. Parsing components and validating them as well. Optionally members can be set within the function as well.
Implements usmtf::FFIRN_Validator.
References usmtf::ErrorManager::AddError(), usmtf::Field::GetContent(), usmtf::RangeValidator< double >::IsInvalidRange(), usmtf::Validatable::IsValid(), usmtf::RangeValidator< double >::mCastedRangeValue, mInnerRadius, mInnerRadiusDouble, usmtf::Radius::mRadiusDouble, usmtf::Radius::mRadiusValue, usmtf::Radius::mUnitOfMeasure, usmtf::Radius::ParseAndValidate(), and usmtf::FFIRN_Validator::SplitOnDelimeter().