@@ -715,3 +715,85 @@ bool WsjcppValidatorHex::isValid(const std::string &sValue, std::string &sError)
715715 }
716716 return true ;
717717}
718+
719+
720+ // ----------------------------------------------------------------------
721+ // WsjcppValidatorIntegerBase
722+
723+ WsjcppValidatorIntegerBase::WsjcppValidatorIntegerBase (const std::string &sTypeName ) {
724+ TAG = " WsjcppValidatorIntegerBase" ;
725+ m_sTypeName = sTypeName ;
726+ }
727+
728+ // ----------------------------------------------------------------------
729+
730+ WsjcppValidatorType WsjcppValidatorIntegerBase::getBaseType () {
731+ return WsjcppValidatorType::WSJCPP_VALIDATOR_INTEGER;
732+ }
733+
734+ // ----------------------------------------------------------------------
735+
736+ std::string WsjcppValidatorIntegerBase::getTypeName () {
737+ return m_sTypeName;
738+ }
739+
740+ // ----------------------------------------------------------------------
741+ // WsjcppValidatorIntegerMinValue
742+
743+ WsjcppValidatorIntegerMinValue::WsjcppValidatorIntegerMinValue (int nMinValue)
744+ : WsjcppValidatorIntegerBase(" integer_min_value" ) {
745+ TAG = " WsjcppValidatorIntegerMinValue" ;
746+ m_nMinValue = nMinValue;
747+ }
748+
749+ // ----------------------------------------------------------------------
750+
751+ bool WsjcppValidatorIntegerMinValue::isValid (int nValue, std::string &sError ) {
752+ if (nValue < m_nMinValue) {
753+ sError = " Value must be more or equal then " + std::to_string (m_nMinValue);
754+ return false ;
755+ }
756+ return true ;
757+ }
758+
759+ // ----------------------------------------------------------------------
760+ // WsjcppValidatorIntegerMaxValue
761+
762+ WsjcppValidatorIntegerMaxValue::WsjcppValidatorIntegerMaxValue (int nMaxValue)
763+ : WsjcppValidatorIntegerBase(" integer_max_value" ) {
764+ TAG = " WsjcppValidatorIntegerMaxValue" ;
765+ m_nMaxValue = nMaxValue;
766+ }
767+
768+ // ----------------------------------------------------------------------
769+
770+ bool WsjcppValidatorIntegerMaxValue::isValid (int nValue, std::string &sError ) {
771+ if (nValue > m_nMaxValue) {
772+ sError = " Value must be less or equal then " + std::to_string (m_nMaxValue);
773+ return false ;
774+ }
775+ return true ;
776+ }
777+
778+ // ----------------------------------------------------------------------
779+ // WsjcppValidatorJsonBase
780+
781+ WsjcppValidatorJsonBase::WsjcppValidatorJsonBase (const std::string &sTypeName ) {
782+ TAG = " WsjcppValidatorJsonBase" ;
783+ m_sTypeName = sTypeName ;
784+ }
785+
786+ // ----------------------------------------------------------------------
787+
788+ WsjcppValidatorType WsjcppValidatorJsonBase::getBaseType () {
789+ return WsjcppValidatorType::WSJCPP_VALIDATOR_JSON;
790+ }
791+
792+ // ----------------------------------------------------------------------
793+
794+ std::string WsjcppValidatorJsonBase::getTypeName () {
795+ return m_sTypeName;
796+ }
797+
798+
799+ // ----------------------------------------------------------------------
0 commit comments