|
||||
File indexing completed on 2025-01-18 10:14:53
0001 /* 0002 * Licensed to the Apache Software Foundation (ASF) under one or more 0003 * contributor license agreements. See the NOTICE file distributed with 0004 * this work for additional information regarding copyright ownership. 0005 * The ASF licenses this file to You under the Apache License, Version 2.0 0006 * (the "License"); you may not use this file except in compliance with 0007 * the License. You may obtain a copy of the License at 0008 * 0009 * http://www.apache.org/licenses/LICENSE-2.0 0010 * 0011 * Unless required by applicable law or agreed to in writing, software 0012 * distributed under the License is distributed on an "AS IS" BASIS, 0013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0014 * See the License for the specific language governing permissions and 0015 * limitations under the License. 0016 */ 0017 0018 /* 0019 * $Id$ 0020 */ 0021 0022 #if !defined(XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP) 0023 #define XERCESC_INCLUDE_GUARD_XMLCONTENTMODEL_HPP 0024 0025 #include <xercesc/util/XMemory.hpp> 0026 #include <xercesc/util/QName.hpp> 0027 0028 XERCES_CPP_NAMESPACE_BEGIN 0029 0030 class ContentLeafNameTypeVector; 0031 class GrammarResolver; 0032 class XMLStringPool; 0033 class XMLValidator; 0034 class SchemaGrammar; 0035 class SubstitutionGroupComparator; 0036 0037 /** 0038 * This class defines the abstract interface for all content models. All 0039 * elements have a content model against which (if validating) its content 0040 * is checked. Each type of validator (DTD, Schema, etc...) can have 0041 * different types of content models, and even with each type of validator 0042 * there can be specialized content models. So this simple class provides 0043 * the abstract API via which all the types of contents models are dealt 0044 * with generically. Its pretty simple. 0045 */ 0046 class XMLPARSER_EXPORT XMLContentModel : public XMemory 0047 { 0048 public: 0049 // --------------------------------------------------------------------------- 0050 // Public static data 0051 // 0052 // gInvalidTrans 0053 // This value represents an invalid transition in each line of the 0054 // transition table. 0055 // 0056 // gEOCFakeId 0057 // gEpsilonFakeId 0058 // We have to put in a couple of special CMLeaf nodes to represent 0059 // special values, using fake element ids that we know won't conflict 0060 // with real element ids. 0061 // 0062 // 0063 // --------------------------------------------------------------------------- 0064 static const unsigned int gInvalidTrans; 0065 static const unsigned int gEOCFakeId; 0066 static const unsigned int gEpsilonFakeId; 0067 0068 // ----------------------------------------------------------------------- 0069 // Constructors are hidden, only the virtual Destructor is exposed 0070 // ----------------------------------------------------------------------- 0071 /** @name Destructor */ 0072 //@{ 0073 virtual ~XMLContentModel() 0074 { 0075 } 0076 //@} 0077 0078 0079 // ----------------------------------------------------------------------- 0080 // The virtual content model interface provided by derived classes 0081 // ----------------------------------------------------------------------- 0082 virtual bool validateContent 0083 ( 0084 QName** const children 0085 , XMLSize_t childCount 0086 , unsigned int emptyNamespaceId 0087 , XMLSize_t* indexFailingChild 0088 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager 0089 ) const = 0; 0090 0091 virtual bool validateContentSpecial 0092 ( 0093 QName** const children 0094 , XMLSize_t childCount 0095 , unsigned int emptyNamespaceId 0096 , GrammarResolver* const pGrammarResolver 0097 , XMLStringPool* const pStringPool 0098 , XMLSize_t* indexFailingChild 0099 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager 0100 ) const =0; 0101 0102 virtual void checkUniqueParticleAttribution 0103 ( 0104 SchemaGrammar* const pGrammar 0105 , GrammarResolver* const pGrammarResolver 0106 , XMLStringPool* const pStringPool 0107 , XMLValidator* const pValidator 0108 , unsigned int* const pContentSpecOrgURI 0109 , const XMLCh* pComplexTypeName = 0 0110 ) =0; 0111 0112 virtual ContentLeafNameTypeVector* getContentLeafNameTypeVector() 0113 const = 0; 0114 0115 virtual unsigned int getNextState(unsigned int currentState, 0116 XMLSize_t elementIndex) const = 0; 0117 0118 virtual bool handleRepetitions( const QName* const curElem, 0119 unsigned int curState, 0120 unsigned int currentLoop, 0121 unsigned int& nextState, 0122 unsigned int& nextLoop, 0123 XMLSize_t elementIndex, 0124 SubstitutionGroupComparator * comparator) const = 0; 0125 0126 protected : 0127 // ----------------------------------------------------------------------- 0128 // Hidden Constructors 0129 // ----------------------------------------------------------------------- 0130 XMLContentModel() 0131 { 0132 } 0133 0134 0135 private : 0136 // ----------------------------------------------------------------------- 0137 // Unimplemented constructors and operators 0138 // ----------------------------------------------------------------------- 0139 XMLContentModel(const XMLContentModel&); 0140 XMLContentModel& operator=(const XMLContentModel&); 0141 }; 0142 0143 XERCES_CPP_NAMESPACE_END 0144 0145 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |