File indexing completed on 2025-12-16 10:34:31
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_SIMPLECONTENTMODEL_HPP)
0023 #define XERCESC_INCLUDE_GUARD_SIMPLECONTENTMODEL_HPP
0024
0025 #include <xercesc/framework/XMLContentModel.hpp>
0026 #include <xercesc/validators/common/ContentSpecNode.hpp>
0027
0028 XERCES_CPP_NAMESPACE_BEGIN
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 class SimpleContentModel : public XMLContentModel
0055 {
0056 public :
0057
0058
0059
0060 SimpleContentModel
0061 (
0062 const bool dtd
0063 , QName* const firstChild
0064 , QName* const secondChild
0065 , const ContentSpecNode::NodeTypes cmOp
0066 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0067 );
0068
0069 ~SimpleContentModel();
0070
0071
0072
0073
0074
0075 virtual bool validateContent
0076 (
0077 QName** const children
0078 , XMLSize_t childCount
0079 , unsigned int emptyNamespaceId
0080 , XMLSize_t* indexFailingChild
0081 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0082 ) const;
0083
0084 virtual bool validateContentSpecial
0085 (
0086 QName** const children
0087 , XMLSize_t childCount
0088 , unsigned int emptyNamespaceId
0089 , GrammarResolver* const pGrammarResolver
0090 , XMLStringPool* const pStringPool
0091 , XMLSize_t* indexFailingChild
0092 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
0093 ) const;
0094
0095 virtual ContentLeafNameTypeVector *getContentLeafNameTypeVector() const;
0096
0097 virtual unsigned int getNextState(unsigned int currentState,
0098 XMLSize_t elementIndex) const;
0099
0100 virtual bool handleRepetitions( const QName* const curElem,
0101 unsigned int curState,
0102 unsigned int currentLoop,
0103 unsigned int& nextState,
0104 unsigned int& nextLoop,
0105 XMLSize_t elementIndex,
0106 SubstitutionGroupComparator * comparator) const;
0107
0108 virtual void checkUniqueParticleAttribution
0109 (
0110 SchemaGrammar* const pGrammar
0111 , GrammarResolver* const pGrammarResolver
0112 , XMLStringPool* const pStringPool
0113 , XMLValidator* const pValidator
0114 , unsigned int* const pContentSpecOrgURI
0115 , const XMLCh* pComplexTypeName = 0
0116 ) ;
0117
0118 private :
0119
0120
0121
0122 SimpleContentModel();
0123 SimpleContentModel(const SimpleContentModel&);
0124 SimpleContentModel& operator=(const SimpleContentModel&);
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145 QName* fFirstChild;
0146 QName* fSecondChild;
0147 ContentSpecNode::NodeTypes fOp;
0148 bool fDTD;
0149 MemoryManager* const fMemoryManager;
0150 };
0151
0152
0153
0154
0155
0156 inline SimpleContentModel::SimpleContentModel
0157 (
0158 const bool dtd
0159 , QName* const firstChild
0160 , QName* const secondChild
0161 , const ContentSpecNode::NodeTypes cmOp
0162 , MemoryManager* const manager
0163 )
0164 : fFirstChild(0)
0165 , fSecondChild(0)
0166 , fOp(cmOp)
0167 , fDTD(dtd)
0168 , fMemoryManager(manager)
0169 {
0170 if (firstChild)
0171 fFirstChild = new (manager) QName(*firstChild);
0172 else
0173 fFirstChild = new (manager) QName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, XMLElementDecl::fgInvalidElemId, manager);
0174
0175 if (secondChild)
0176 fSecondChild = new (manager) QName(*secondChild);
0177 else
0178 fSecondChild = new (manager) QName(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, XMLElementDecl::fgInvalidElemId, manager);
0179 }
0180
0181 inline SimpleContentModel::~SimpleContentModel()
0182 {
0183 delete fFirstChild;
0184 delete fSecondChild;
0185 }
0186
0187
0188
0189
0190
0191 inline unsigned int
0192 SimpleContentModel::getNextState(unsigned int,
0193 XMLSize_t) const {
0194
0195 return XMLContentModel::gInvalidTrans;
0196 }
0197
0198 inline bool
0199 SimpleContentModel::handleRepetitions( const QName* const ,
0200 unsigned int ,
0201 unsigned int ,
0202 unsigned int& ,
0203 unsigned int& ,
0204 XMLSize_t ,
0205 SubstitutionGroupComparator * ) const
0206 {
0207 return true;
0208 }
0209
0210 XERCES_CPP_NAMESPACE_END
0211
0212 #endif