21 #ifndef SEPARATISTA_ELEMENTDESCRIPTOR_H 22 #define SEPARATISTA_ELEMENTDESCRIPTOR_H 26 #include "separatista/separatista.h" 28 #define SEPARATISTA_ELEMENTS(name) sizeof(name) / sizeof(ElementDescriptor), name 29 #define SEPARATISTA_TAG(tag) TEXT(tag), Separatista::HashTag(TEXT(tag)) 34 constexpr
unsigned int HashTag(
const wchar_t (&str)[L],
size_t n = L - 1)
36 return n == 0 ? str[n] : HashTag(str, n - 1) + (str[n] << n);
42 struct ChildElementDescriptor;
74 #endif // !defined SEPARATISTA_ELEMENTDESCRIPTOR_H
size_t m_nMin
Minimal presence of the element, 0 = optional.
Definition: elementdescriptor.h:65
size_t m_nElementCount
Number of child elements.
Definition: elementdescriptor.h:53
void(* m_pfnValidate)(const wchar_t *pValue, Element *pElement)
Data validation class.
Definition: elementdescriptor.h:51
const ElementDescriptor * m_pElementDescriptor
ElementDescriptor.
Definition: elementdescriptor.h:69
Definition: elementdescriptor.h:44
unsigned int m_nHash
The hash of the tag.
Definition: elementdescriptor.h:63
const wchar_t * m_pTag
The tag name of the element.
Definition: elementdescriptor.h:61
Definition: elementdescriptor.h:58
size_t m_nMax
Maximum presence of the element, 0 = infinite.
Definition: elementdescriptor.h:67
const ElementDescriptor * m_pTypeParent
Parent type ElementDescriptor, if any.
Definition: elementdescriptor.h:47
const ChildElementDescriptor * m_pChildren
ChildElement descriptors.
Definition: elementdescriptor.h:55