12#ifndef FFIRNVALIDATOR_HPP
13#define FFIRNVALIDATOR_HPP
15#include "usmtf_export.h"
19#include <unordered_map>
36const std::string
cLATM =
"LATM";
37const std::string
cLATS =
"LATS";
38const std::string
cRARA =
"RARA";
39const std::string
cFLFL =
"FLFL";
40const std::string
cRAFL =
"RAFL";
41const std::string
cBRFL =
"BRFL";
42const std::string
cBRRA =
"BRRA";
43const std::string
cSNWP =
"SNWP";
69 static bool IsInSelection(
const std::string& aValue,
const std::vector<std::string>& choices)
noexcept;
70 static bool IsStringLength(
const std::string& aValue,
size_t aLength)
noexcept;
72 static size_t CheckForAnyDelimeter(
const std::string& aValue,
const std::vector<std::string>& aDelimeters)
noexcept;
74 const std::vector<std::string>& aDelimeters,
75 std::string& aFoundDelimeter)
noexcept;
78 static bool IsInRange(T aValue, T aLowerBound, T aUpperBound)
noexcept
80 return aValue >= aLowerBound && aValue <= aUpperBound;
84 const std::string& GetRawContent() const noexcept;
87 std::vector<
std::
string> SplitOnDelimeter(const
std::
string& value, const
std::
string& delimeter);
88 const
std::
string& GetFieldContent() const noexcept;
92 bool ValidateByDescriptor(const FFIRN_DescriptorMap& aDescriptorMap);
100 void ClearErrorsIfValid(
bool aHasAtLeastOnePassed) noexcept;
102 void SetField(const
Field& aField) noexcept;
static bool IsInRange(T aValue, T aLowerBound, T aUpperBound) noexcept
Definition FFIRN_Validator.hpp:78
static bool IsStringLength(const std::string &aValue, size_t aLength) noexcept
Definition FFIRN_Validator.cpp:67
Field mField
Definition FFIRN_Validator.hpp:103
virtual bool ParseAndValidate(const usmtf::Field &aField)=0
FFIRN_Validator()=default
std::unordered_map< std::string, FFIRN_Func > FFIRN_DescriptorMap
Definition FFIRN_Validator.hpp:56
std::function< bool(void)> FFIRN_Func
Definition FFIRN_Validator.hpp:53
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.
Definition FFIRN_Validator.cpp:72
static bool IsInSelection(const std::string &aValue, const std::vector< std::string > &choices) noexcept
Definition FFIRN_Validator.cpp:62
Definition Validatable.hpp:24
Template specialization for wsf::comm::Address. Allows usage of Address in std::unordered_map/set.
Definition WsfCommAddress.hpp:185
Definition FFIRN_Validator.hpp:35
const std::string cLATM
Definition FFIRN_Validator.hpp:36
const std::string cBRRA
Definition FFIRN_Validator.hpp:42
const std::string cBRFL
Definition FFIRN_Validator.hpp:41
const std::string cRARA
Definition FFIRN_Validator.hpp:38
const std::string cSNWP
Definition FFIRN_Validator.hpp:43
const std::string cRAFL
Definition FFIRN_Validator.hpp:40
const std::string cFLFL
Definition FFIRN_Validator.hpp:39
const std::string cLATS
Definition FFIRN_Validator.hpp:37
static const std::string NULL_FIELD
Definition FFIRN_Validator.hpp:26