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 | // This file is part of the internal implementation of the C++ XML DOM. |
---|
20 | // It should NOT be included or used directly by application programs. |
---|
21 | // |
---|
22 | // Applications should include the file <xercesc/dom/DOM.hpp> for the entire |
---|
23 | // DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class |
---|
24 | // name is substituded for the *. |
---|
25 | // |
---|
26 | |
---|
27 | #if !defined(XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP) |
---|
28 | #define XERCESC_INCLUDE_GUARD_DOMCONFIGURATIONIMPL_HPP |
---|
29 | |
---|
30 | //------------------------------------------------------------------------------------ |
---|
31 | // Includes |
---|
32 | //------------------------------------------------------------------------------------ |
---|
33 | #include <xercesc/dom/DOMConfiguration.hpp> |
---|
34 | #include <xercesc/dom/DOMErrorHandler.hpp> |
---|
35 | #include <icxercesc/util/XMLString.hpp> |
---|
36 | |
---|
37 | XERCES_CPP_NAMESPACE_BEGIN |
---|
38 | |
---|
39 | class DOMDocumentImpl; |
---|
40 | class DOMStringListImpl; |
---|
41 | |
---|
42 | class CDOM_EXPORT DOMConfigurationImpl : public DOMConfiguration |
---|
43 | { |
---|
44 | private: |
---|
45 | //unimplemented |
---|
46 | DOMConfigurationImpl(const DOMConfiguration &); |
---|
47 | DOMConfigurationImpl & operator = (const DOMConfiguration &); |
---|
48 | |
---|
49 | |
---|
50 | public: |
---|
51 | |
---|
52 | //----------------------------------------------------------------------------------- |
---|
53 | // Constructor |
---|
54 | //----------------------------------------------------------------------------------- |
---|
55 | DOMConfigurationImpl(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager); |
---|
56 | ~DOMConfigurationImpl(); |
---|
57 | |
---|
58 | enum DOMConfigurationFeature { |
---|
59 | FEATURE_CANONICAL_FORM = 0x0001, |
---|
60 | FEATURE_CDATA_SECTIONS = 0x0002, |
---|
61 | FEATURE_COMMENTS = 0x0004, |
---|
62 | FEATURE_DATATYPE_NORMALIZATION = 0x0008, |
---|
63 | FEATURE_DISCARD_DEFAULT_CONTENT = 0x0010, |
---|
64 | FEATURE_ENTITIES = 0x0020, |
---|
65 | FEATURE_INFOSET = 0x0040, |
---|
66 | FEATURE_NAMESPACES = 0x0080, |
---|
67 | FEATURE_NAMESPACE_DECLARATIONS = 0x0100, |
---|
68 | FEATURE_NORMALIZE_CHARACTERS = 0x0200, |
---|
69 | FEATURE_SPLIT_CDATA_SECTIONS = 0x0400, |
---|
70 | FEATURE_VALIDATE = 0x0800, |
---|
71 | FEATURE_VALIDATE_IF_SCHEMA = 0x1000, |
---|
72 | FEATURE_ELEMENT_CONTENT_WHITESPACE = 0x2000 |
---|
73 | }; |
---|
74 | |
---|
75 | unsigned short featureValues; |
---|
76 | |
---|
77 | // ----------------------------------------------------------------------- |
---|
78 | // Setter methods |
---|
79 | // ----------------------------------------------------------------------- |
---|
80 | |
---|
81 | virtual void setParameter(const XMLCh* name, const void* value); |
---|
82 | virtual void setParameter(const XMLCh* name, bool value); |
---|
83 | |
---|
84 | // ----------------------------------------------------------------------- |
---|
85 | // Getter methods |
---|
86 | // ----------------------------------------------------------------------- |
---|
87 | |
---|
88 | virtual const void* getParameter(const XMLCh* name) const; |
---|
89 | |
---|
90 | |
---|
91 | // ----------------------------------------------------------------------- |
---|
92 | // Query methods |
---|
93 | // ----------------------------------------------------------------------- |
---|
94 | |
---|
95 | virtual bool canSetParameter(const XMLCh* name, const void* value) const; |
---|
96 | virtual bool canSetParameter(const XMLCh* name, bool value) const; |
---|
97 | |
---|
98 | virtual const DOMStringList* getParameterNames() const; |
---|
99 | |
---|
100 | // --------------------------------------------------------------------------- |
---|
101 | // Impl specific methods |
---|
102 | // --------------------------------------------------------------------------- |
---|
103 | |
---|
104 | /* specific get and set methods for non-boolean parameters |
---|
105 | * */ |
---|
106 | |
---|
107 | DOMErrorHandler* getErrorHandler() const; |
---|
108 | |
---|
109 | const XMLCh* getSchemaType() const; |
---|
110 | |
---|
111 | const XMLCh* getSchemaLocation() const; |
---|
112 | |
---|
113 | void setErrorHandler(DOMErrorHandler *erHandler); |
---|
114 | |
---|
115 | void setSchemaType(const XMLCh* st); |
---|
116 | |
---|
117 | void setSchemaLocation(const XMLCh* sl); |
---|
118 | |
---|
119 | // The default values for the boolean parameters |
---|
120 | // from CANONICAL_FORM to ELEMENT_CONTENT_WHITESPACE |
---|
121 | // 10010110010110 = 0x2596 |
---|
122 | static const unsigned short fDEFAULT_VALUES; |
---|
123 | |
---|
124 | |
---|
125 | protected: |
---|
126 | // implements a simple map between the name and its enum value |
---|
127 | DOMConfigurationFeature getFeatureFlag(const XMLCh* name) const; |
---|
128 | |
---|
129 | // the error handler |
---|
130 | DOMErrorHandler* fErrorHandler; |
---|
131 | |
---|
132 | // the schema type |
---|
133 | const XMLCh* fSchemaType; |
---|
134 | |
---|
135 | // the schema location |
---|
136 | const XMLCh* fSchemaLocation; |
---|
137 | |
---|
138 | // the list of supported parameters |
---|
139 | DOMStringListImpl* fSupportedParameters; |
---|
140 | |
---|
141 | MemoryManager* fMemoryManager; |
---|
142 | }; |
---|
143 | |
---|
144 | XERCES_CPP_NAMESPACE_END |
---|
145 | |
---|
146 | #endif |
---|
147 | |
---|
148 | /** |
---|
149 | * End of file DOMConfigurationImpl.hpp |
---|
150 | */ |
---|