[2674] | 1 | /* |
---|
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 3 | * contributor license agreements. See the NOTICE file distributed with |
---|
| 4 | * this work for additional information regarding copyright ownership. |
---|
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 6 | * (the "License"); you may not use this file except in compliance with |
---|
| 7 | * the License. You may obtain a copy of the License at |
---|
| 8 | * |
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 10 | * |
---|
| 11 | * Unless required by applicable law or agreed to in writing, software |
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 14 | * See the License for the specific language governing permissions and |
---|
| 15 | * limitations under the License. |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | /* |
---|
| 19 | * $Id: ValidationContext.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #if !defined(VALIDATION_CONTEXT_HPP) |
---|
| 23 | #define VALIDATION_CONTEXT_HPP |
---|
| 24 | |
---|
| 25 | #include <xercesc/util/PlatformUtils.hpp> |
---|
| 26 | #include <xercesc/util/RefHashTableOf.hpp> |
---|
| 27 | #include <xercesc/util/NameIdPool.hpp> |
---|
| 28 | #include <xercesc/util/XMemory.hpp> |
---|
| 29 | |
---|
| 30 | XERCES_CPP_NAMESPACE_BEGIN |
---|
| 31 | |
---|
| 32 | class XMLRefInfo; |
---|
| 33 | class DTDEntityDecl; |
---|
| 34 | class DatatypeValidator; |
---|
| 35 | class ElemStack; |
---|
| 36 | |
---|
| 37 | class XMLPARSER_EXPORT ValidationContext : public XMemory |
---|
| 38 | { |
---|
| 39 | public : |
---|
| 40 | // ----------------------------------------------------------------------- |
---|
| 41 | /** @name Virtual destructor for derived classes */ |
---|
| 42 | // ----------------------------------------------------------------------- |
---|
| 43 | //@{ |
---|
| 44 | |
---|
| 45 | /** |
---|
| 46 | * virtual destructor |
---|
| 47 | * |
---|
| 48 | */ |
---|
| 49 | virtual ~ValidationContext(){}; |
---|
| 50 | //@} |
---|
| 51 | |
---|
| 52 | // ----------------------------------------------------------------------- |
---|
| 53 | /** @name The ValidationContext Interface */ |
---|
| 54 | // ----------------------------------------------------------------------- |
---|
| 55 | //@{ |
---|
| 56 | |
---|
| 57 | /** |
---|
| 58 | * IDRefList |
---|
| 59 | * |
---|
| 60 | */ |
---|
| 61 | virtual RefHashTableOf<XMLRefInfo>* getIdRefList() const = 0; |
---|
| 62 | |
---|
| 63 | virtual void setIdRefList(RefHashTableOf<XMLRefInfo>* const) = 0; |
---|
| 64 | |
---|
| 65 | virtual void clearIdRefList() = 0; |
---|
| 66 | |
---|
| 67 | virtual void addId(const XMLCh * const ) = 0; |
---|
| 68 | |
---|
| 69 | virtual void addIdRef(const XMLCh * const ) = 0; |
---|
| 70 | |
---|
| 71 | virtual void toCheckIdRefList(bool) = 0; |
---|
| 72 | |
---|
| 73 | /** |
---|
| 74 | * EntityDeclPool |
---|
| 75 | * |
---|
| 76 | */ |
---|
| 77 | virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const = 0; |
---|
| 78 | |
---|
| 79 | virtual const NameIdPool<DTDEntityDecl>* setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const) = 0; |
---|
| 80 | |
---|
| 81 | virtual void checkEntity(const XMLCh * const ) const = 0 ; |
---|
| 82 | |
---|
| 83 | /** |
---|
| 84 | * Union datatype handling |
---|
| 85 | * |
---|
| 86 | */ |
---|
| 87 | |
---|
| 88 | virtual DatatypeValidator * getValidatingMemberType() const = 0 ; |
---|
| 89 | virtual void setValidatingMemberType(DatatypeValidator * validatingMemberType) = 0 ; |
---|
| 90 | |
---|
| 91 | /** |
---|
| 92 | * QName datatype handling |
---|
| 93 | * Create default implementations for source code compatibility |
---|
| 94 | */ |
---|
| 95 | virtual bool isPrefixUnknown(XMLCh* /* prefix */) { return true; }; |
---|
| 96 | virtual void setElemStack(ElemStack* /* elemStack */) {}; |
---|
| 97 | //@} |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | protected : |
---|
| 101 | // ----------------------------------------------------------------------- |
---|
| 102 | /** Hidden Constructors */ |
---|
| 103 | // ----------------------------------------------------------------------- |
---|
| 104 | //@{ |
---|
| 105 | ValidationContext(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager) |
---|
| 106 | :fMemoryManager(memMgr) |
---|
| 107 | { |
---|
| 108 | }; |
---|
| 109 | //@} |
---|
| 110 | |
---|
| 111 | // ----------------------------------------------------------------------- |
---|
| 112 | // Data members |
---|
| 113 | // |
---|
| 114 | // fMemoryManager |
---|
| 115 | // Pluggable memory manager for dynamic allocation/deallocation. |
---|
| 116 | // ----------------------------------------------------------------------- |
---|
| 117 | MemoryManager* fMemoryManager; |
---|
| 118 | |
---|
| 119 | private : |
---|
| 120 | // ----------------------------------------------------------------------- |
---|
| 121 | /** name Unimplemented copy constructor and operator= */ |
---|
| 122 | // ----------------------------------------------------------------------- |
---|
| 123 | //@{ |
---|
| 124 | ValidationContext(const ValidationContext& ); |
---|
| 125 | ValidationContext& operator=(const ValidationContext& ); |
---|
| 126 | //@} |
---|
| 127 | |
---|
| 128 | }; |
---|
| 129 | |
---|
| 130 | XERCES_CPP_NAMESPACE_END |
---|
| 131 | |
---|
| 132 | #endif |
---|
| 133 | |
---|