File indexing completed on 2025-12-16 10:34:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #if !defined(XERCESC_INCLUDE_GUARD_GRAMMAR_HPP)
0023 #define XERCESC_INCLUDE_GUARD_GRAMMAR_HPP
0024
0025 #include <limits.h>
0026
0027 #include <xercesc/framework/XMLElementDecl.hpp>
0028 #include <xercesc/framework/XMLEntityDecl.hpp>
0029 #include <xercesc/framework/XMLNotationDecl.hpp>
0030
0031 #include <xercesc/internal/XSerializable.hpp>
0032
0033 XERCES_CPP_NAMESPACE_BEGIN
0034
0035 class XMLGrammarDescription;
0036
0037
0038
0039
0040
0041 class VALIDATORS_EXPORT Grammar : public XSerializable, public XMemory
0042 {
0043 public:
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 enum GrammarType {
0060 DTDGrammarType
0061 , SchemaGrammarType
0062 , UnKnown
0063 };
0064
0065 enum {
0066
0067
0068 UNKNOWN_SCOPE = UINT_MAX - 0
0069 , TOP_LEVEL_SCOPE = UINT_MAX - 1
0070 };
0071
0072
0073
0074
0075 virtual ~Grammar(){};
0076
0077
0078
0079
0080 virtual GrammarType getGrammarType() const =0;
0081 virtual const XMLCh* getTargetNamespace() const =0;
0082 virtual bool getValidated() const = 0;
0083
0084
0085
0086
0087
0088
0089 virtual XMLElementDecl* findOrAddElemDecl
0090 (
0091 const unsigned int uriId
0092 , const XMLCh* const baseName
0093 , const XMLCh* const prefixName
0094 , const XMLCh* const qName
0095 , unsigned int scope
0096 , bool& wasAdded
0097 ) = 0;
0098
0099 virtual XMLSize_t getElemId
0100 (
0101 const unsigned int uriId
0102 , const XMLCh* const baseName
0103 , const XMLCh* const qName
0104 , unsigned int scope
0105 ) const = 0;
0106
0107 virtual const XMLElementDecl* getElemDecl
0108 (
0109 const unsigned int uriId
0110 , const XMLCh* const baseName
0111 , const XMLCh* const qName
0112 , unsigned int scope
0113 ) const = 0;
0114
0115 virtual XMLElementDecl* getElemDecl
0116 (
0117 const unsigned int uriId
0118 , const XMLCh* const baseName
0119 , const XMLCh* const qName
0120 , unsigned int scope
0121 ) = 0;
0122
0123 virtual const XMLElementDecl* getElemDecl
0124 (
0125 const unsigned int elemId
0126 ) const = 0;
0127
0128 virtual XMLElementDecl* getElemDecl
0129 (
0130 const unsigned int elemId
0131 ) = 0;
0132
0133
0134 virtual const XMLNotationDecl* getNotationDecl
0135 (
0136 const XMLCh* const notName
0137 ) const=0;
0138
0139 virtual XMLNotationDecl* getNotationDecl
0140 (
0141 const XMLCh* const notName
0142 )=0;
0143
0144
0145
0146
0147 virtual XMLElementDecl* putElemDecl
0148 (
0149 const unsigned int uriId
0150 , const XMLCh* const baseName
0151 , const XMLCh* const prefixName
0152 , const XMLCh* const qName
0153 , unsigned int scope
0154 , const bool notDeclared = false
0155 ) = 0;
0156
0157 virtual XMLSize_t putElemDecl
0158 (
0159 XMLElementDecl* const elemDecl
0160 , const bool notDeclared = false
0161 ) = 0;
0162
0163 virtual XMLSize_t putNotationDecl
0164 (
0165 XMLNotationDecl* const notationDecl
0166 ) const=0;
0167
0168 virtual void setValidated(const bool newState) = 0;
0169
0170
0171
0172
0173 virtual void reset()=0;
0174
0175 virtual void setGrammarDescription( XMLGrammarDescription*) = 0;
0176 virtual XMLGrammarDescription* getGrammarDescription() const = 0;
0177
0178
0179
0180
0181 DECL_XSERIALIZABLE(Grammar)
0182
0183 static void storeGrammar(XSerializeEngine& serEng
0184 , Grammar* const grammar);
0185
0186 static Grammar* loadGrammar(XSerializeEngine& serEng);
0187
0188 protected :
0189
0190
0191
0192 Grammar(){};
0193
0194 private:
0195
0196
0197
0198 Grammar(const Grammar&);
0199 Grammar& operator=(const Grammar&);
0200 };
0201
0202 XERCES_CPP_NAMESPACE_END
0203
0204 #endif