20 #ifndef SEPARATISTA_VALIDATOR_H 21 #define SEPARATISTA_VALIDATOR_H 23 #include <initializer_list> 26 #include "separatista.h" 28 #include "exception.h" 42 #ifdef SEPARATISTA_DEBUG 65 const wchar_t *m_pValue;
72 static void validateDecimal(
const wchar_t *pValue,
Element *pElement);
74 static void validateString(
const wchar_t *pValue,
Element *pElement);
76 static void validateBoolean(
const wchar_t *pValue,
Element *pElement);
78 static void validateMinInclusive(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
80 static void validateFractionDigits(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
82 static void validateTotalDigits(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
84 static void validateNumeric(
const wchar_t *pValue,
Element *pElement);
86 static void validateEnumeration(
const wchar_t *pValue, std::initializer_list<const wchar_t*> pPossibleValues,
Element *pElement);
88 static void validatePattern(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
90 static void validateMinLength(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
92 static void validateMaxLength(
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
94 static void validateDateTime(
const wchar_t *pValue,
Element *pElement);
96 static void validateDate(
const wchar_t *pValue,
Element *pElement);
99 static void validate(
const wchar_t* pSchemaSymbols,
const wchar_t *pValue,
const wchar_t *pArg,
Element *pElement);
104 inline void Validator::validate(
const wchar_t * pSchemaSymbols,
const wchar_t * pValue,
const wchar_t * pArg,
Element *pElement)
106 xercesc::RefHashTableOf<xercesc::KVStringPair>* pFacets =
new xercesc::RefHashTableOf<xercesc::KVStringPair>(1,
true);
108 (
void*)pSchemaSymbols,
109 new xercesc::KVStringPair(
113 T *pValidator =
new T(NULL, pFacets, NULL, 0);
118 pValidator->validate(pValue);
120 catch (
const xercesc::InvalidDatatypeValueException &)
132 #endif // !defined SEPARATISTA_VALIDATOR_H Definition: exception.h:40
Invalid value exception, thrown when an element can't accept a value.
Definition: validator.h:33
Validator interface.
Definition: validator.h:69
const wchar_t * getValue() const
Returns the erronous value.
Definition: validator.h:58
Element * getSourceElement() const
Returns the target element.
Definition: validator.h:52