Xalan-C++ API Reference 1.12.0
XalanQNameByValue.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18#if !defined(XALANQNAMEBYVALUE_HEADER_GUARD_1357924680)
19#define XALANQNAMEBYVALUE_HEADER_GUARD_1357924680
20
21
22
23// Base header file. Must be first.
25
26
27
28// Base class header file...
30
31
32
33namespace XERCES_CPP_NAMESPACE
34{
35 class Locator;
36}
37
38
39
40namespace XALAN_CPP_NAMESPACE {
41
42
43
44class DOMSupport;
45class ProblemListenerBase;
46
47
48
50{
51public:
52
53 typedef xercesc::Locator LocatorType;
54
55 /**
56 * Construct an empty XalanQNameByValue.
57 */
58 explicit
60
61 MemoryManager&
63 {
64 return m_namespace.getMemoryManager();
65 }
66
67 /**
68 * Copy constructor.
69 *
70 * @param theSource The source of the copy.
71 */
74 MemoryManager& theManager);
75
76 /**
77 * Construct an instance from another XalanQName.
78 *
79 * @param theSource The source of the copy.
80 */
81 explicit
83 const XalanQName& theSource,
84 MemoryManager& theManager);
85
86 /**
87 * Construct a XalanQNameByValue, with the supplied namespace and local part.
88 *
89 * @param theNamespace namespace string
90 * @param theLocalPart local part string
91 */
95 MemoryManager& theManager);
96
97 static XalanQNameByValue*
101 MemoryManager& theManager);
102
103 /**
104 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
105 * namespace vector stack.
106 *
107 * @param qname QName string
108 * @param namespaces namespace vector stack to use
109 * @param locator The Locator instance for error reporting, if any
110 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
111 */
113 const XalanDOMString& qname,
115 MemoryManager& theManager,
116 const Locator* locator = 0,
117 bool fUseDefault = false);
118
119 /**
120 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
121 * namespace vector stack.
122 *
123 * @param qname QName string
124 * @param namespaces namespace vector stack to use
125 * @param locator The Locator instance for error reporting, if any
126 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
127 */
129 const XalanDOMChar* qname,
131 MemoryManager& theManager,
132 const Locator* locator = 0,
133 bool fUseDefault = false);
134
135 /**
136 * Construct a XalanQNameByValue from a string, resolving the prefix using the given
137 * prefix resolver. The default namespace is not resolved.
138 *
139 * @param qname QName string
140 * @param theResolver prefix resolver to use
141 * @param locator The Locator instance for error reporting, if any
142 */
144 const XalanDOMString& qname,
145 MemoryManager& theManager,
146 const PrefixResolver* theResolver = 0,
147 const Locator* locator = 0);
148
149 virtual
151
152 /**
153 * Retrieve the local part of qualified name.
154 *
155 * @return local part string
156 */
157 virtual const XalanDOMString&
159
160 /**
161 * Set the local part of qualified name.
162 *
163 * @param theLocalPart local part string
164 */
165 void
167 {
168 m_localpart = theLocalPart;
169 }
170
171 /**
172 * Retrieve the namespace of qualified name.
173 *
174 * @return namespace string
175 */
176 virtual const XalanDOMString&
178
179 /**
180 * Set the Namespace URI of qualified name.
181 *
182 * @param theLocalPart local part string
183 */
184 void
186 {
187 m_namespace = theNamespace;
188 }
189
190 /**
191 * Set the local part and namespace URI of a XalanQNameByValue from
192 * a string, resolving the prefix using the given namespace vector
193 * stack.
194 *
195 * @param qname QName string
196 * @param namespaces namespace vector stack to use
197 * @param locator The Locator instance for error reporting, if any
198 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
199 */
200 void
202 const XalanDOMString& qname,
204 const Locator* locator = 0,
205 bool fUseDefault = false);
206
207 /**
208 * Set the local part and namespace URI of a XalanQNameByValue from
209 * a string, resolving the prefix using the given namespace vector
210 * stack.
211 *
212 * @param qname QName string
213 * @param namespaces namespace vector stack to use
214 * @param locator The Locator instance for error reporting, if any
215 * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
216 */
217 void
219 const XalanDOMChar* qname,
221 const Locator* locator = 0,
222 bool fUseDefault = false);
223
224 /**
225 * Set the local part and namespace URI of a XalanQNameByValue from
226 * a string, resolving the prefix using the resolver provided. The
227 * default namespace is not resolved.
228 *
229 * @param qname QName string
230 * @param theResolver prefix resolver to use
231 * @param locator The Locator instance for error reporting, if any
232 */
233 void
235 const XalanDOMString& qname,
236 const PrefixResolver* theResolver = 0,
237 const Locator* locator = 0);
238
239 /**
240 * Set the local part and namespace URI of a XalanQNameByValue from
241 * a string, resolving the prefix using the resolver provided. The
242 * default namespace is not resolved.
243 *
244 * @param qname QName string
245 * @param theResolver prefix resolver to use
246 * @param locator The Locator instance for error reporting, if any
247 */
248 void
250 const XalanDOMChar* qname,
251 const PrefixResolver* theResolver = 0,
252 const Locator* locator = 0);
253 /**
254 * Clear the instance.
255 */
256 void
258 {
259 m_namespace.clear();
260 m_localpart.clear();
261 }
262
265 {
266 m_namespace = theRHS.m_namespace;
267 m_localpart = theRHS.m_localpart;
268
269 return *this;
270 }
271
274 {
275 m_namespace = theRHS.getNamespace();
276 m_localpart = theRHS.getLocalPart();
277
278 return *this;
279 }
280
281private:
282 // not implemented
284 void
285 initialize(
286 const XalanDOMChar* qname,
288 const NamespacesStackType& namespaces,
289 const Locator* locator,
290 bool fUseDefault);
291
292 void
293 resolvePrefix(
294 const XalanDOMChar* qname,
297 const Locator* locator);
298
299 void
300 validate(
301 const XalanDOMChar* qname,
303 const Locator* locator);
304
305 // Data members...
306 XalanDOMString m_namespace;
307
308 XalanDOMString m_localpart;
309};
310
311XALAN_USES_MEMORY_MANAGER(XalanQNameByValue)
312
313
314template<>
316{
317};
318
319
320
321}
322
323
324
325#endif // XALANQNAMEBYVALUE_HEADER_GUARD_1357924680
#define XALAN_XPATH_EXPORT
#define XALAN_USES_MEMORY_MANAGER(Type)
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
This class defines an interface for classes that resolve namespace prefixes to their URIs.
Xalan implementation of deque.
MemoryManager & getMemoryManager()
XalanQNameByValue(const XalanDOMString &qname, const NamespacesStackType &namespaces, MemoryManager &theManager, const Locator *locator=0, bool fUseDefault=false)
Construct a XalanQNameByValue from a string, resolving the prefix using the given namespace vector st...
XalanQNameByValue(const XalanQName &theSource, MemoryManager &theManager)
Construct an instance from another XalanQName.
virtual const XalanDOMString & getLocalPart() const
Retrieve the local part of qualified name.
void set(const XalanDOMString &qname, const PrefixResolver *theResolver=0, const Locator *locator=0)
Set the local part and namespace URI of a XalanQNameByValue from a string, resolving the prefix using...
static XalanQNameByValue * create(const XalanDOMString &theNamespace, const XalanDOMString &theLocalPart, MemoryManager &theManager)
void setNamespace(const XalanDOMString &theNamespace)
Set the Namespace URI of qualified name.
XalanQNameByValue & operator=(const XalanQName &theRHS)
XalanQNameByValue(const XalanDOMString &qname, MemoryManager &theManager, const PrefixResolver *theResolver=0, const Locator *locator=0)
Construct a XalanQNameByValue from a string, resolving the prefix using the given prefix resolver.
XalanQNameByValue(const XalanDOMChar *qname, const NamespacesStackType &namespaces, MemoryManager &theManager, const Locator *locator=0, bool fUseDefault=false)
Construct a XalanQNameByValue from a string, resolving the prefix using the given namespace vector st...
void setLocalPart(const XalanDOMString &theLocalPart)
Set the local part of qualified name.
XalanQNameByValue(MemoryManager &theManager)
Construct an empty XalanQNameByValue.
void set(const XalanDOMString &qname, const NamespacesStackType &namespaces, const Locator *locator=0, bool fUseDefault=false)
Set the local part and namespace URI of a XalanQNameByValue from a string, resolving the prefix using...
XalanQNameByValue(const XalanDOMString &theNamespace, const XalanDOMString &theLocalPart, MemoryManager &theManager)
Construct a XalanQNameByValue, with the supplied namespace and local part.
virtual const XalanDOMString & getNamespace() const
Retrieve the namespace of qualified name.
void set(const XalanDOMChar *qname, const NamespacesStackType &namespaces, const Locator *locator=0, bool fUseDefault=false)
Set the local part and namespace URI of a XalanQNameByValue from a string, resolving the prefix using...
void clear()
Clear the instance.
XalanQNameByValue(const XalanQNameByValue &theSource, MemoryManager &theManager)
Copy constructor.
XalanQNameByValue & operator=(const XalanQNameByValue &theRHS)
void set(const XalanDOMChar *qname, const PrefixResolver *theResolver=0, const Locator *locator=0)
Set the local part and namespace URI of a XalanQNameByValue from a string, resolving the prefix using...
Class to represent a qualified name.