Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


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 
33 XALAN_DECLARE_XERCES_CLASS(Locator)
34 
35 
36 
37 XALAN_CPP_NAMESPACE_BEGIN
38 
39 
40 
41 class DOMSupport;
43 
44 
45 
47 {
48 public:
49 
50  typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
51 
52  /**
53  * Construct an empty XalanQNameByValue.
54  */
55  explicit
56  XalanQNameByValue(MemoryManager& theManager);
57 
58  MemoryManager&
60  {
61  return m_namespace.getMemoryManager();
62  }
63 
64  /**
65  * Copy constructor.
66  *
67  * @param theSource The source of the copy.
68  */
70  const XalanQNameByValue& theSource,
71  MemoryManager& theManager);
72 
73  /**
74  * Construct an instance from another XalanQName.
75  *
76  * @param theSource The source of the copy.
77  */
78  explicit
80  const XalanQName& theSource,
81  MemoryManager& theManager);
82 
83  /**
84  * Construct a XalanQNameByValue, with the supplied namespace and local part.
85  *
86  * @param theNamespace namespace string
87  * @param theLocalPart local part string
88  */
90  const XalanDOMString& theNamespace,
91  const XalanDOMString& theLocalPart,
92  MemoryManager& theManager);
93 
94  static XalanQNameByValue*
95  create(
96  const XalanDOMString& theNamespace,
97  const XalanDOMString& theLocalPart,
98  MemoryManager& theManager);
99 
100  /**
101  * Construct a XalanQNameByValue from a string, resolving the prefix using the given
102  * namespace vector stack.
103  *
104  * @param qname QName string
105  * @param namespaces namespace vector stack to use
106  * @param locator The Locator instance for error reporting, if any
107  * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
108  */
110  const XalanDOMString& qname,
111  const NamespacesStackType& namespaces,
112  MemoryManager& theManager,
113  const Locator* locator = 0,
114  bool fUseDefault = false);
115 
116  /**
117  * Construct a XalanQNameByValue from a string, resolving the prefix using the given
118  * namespace vector stack.
119  *
120  * @param qname QName string
121  * @param namespaces namespace vector stack to use
122  * @param locator The Locator instance for error reporting, if any
123  * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
124  */
126  const XalanDOMChar* qname,
127  const NamespacesStackType& namespaces,
128  MemoryManager& theManager,
129  const Locator* locator = 0,
130  bool fUseDefault = false);
131 
132  /**
133  * Construct a XalanQNameByValue from a string, resolving the prefix using the given
134  * prefix resolver. The default namespace is not resolved.
135  *
136  * @param qname QName string
137  * @param theResolver prefix resolver to use
138  * @param locator The Locator instance for error reporting, if any
139  */
141  const XalanDOMString& qname,
142  MemoryManager& theManager,
143  const PrefixResolver* theResolver = 0,
144  const Locator* locator = 0);
145 
146  virtual
148 
149  /**
150  * Retrieve the local part of qualified name.
151  *
152  * @return local part string
153  */
154  virtual const XalanDOMString&
155  getLocalPart() const;
156 
157  /**
158  * Set the local part of qualified name.
159  *
160  * @param theLocalPart local part string
161  */
162  void
163  setLocalPart(const XalanDOMString& theLocalPart)
164  {
165  m_localpart = theLocalPart;
166  }
167 
168  /**
169  * Retrieve the namespace of qualified name.
170  *
171  * @return namespace string
172  */
173  virtual const XalanDOMString&
174  getNamespace() const;
175 
176  /**
177  * Set the Namespace URI of qualified name.
178  *
179  * @param theLocalPart local part string
180  */
181  void
182  setNamespace(const XalanDOMString& theNamespace)
183  {
184  m_namespace = theNamespace;
185  }
186 
187  /**
188  * Set the local part and namespace URI of a XalanQNameByValue from
189  * a string, resolving the prefix using the given namespace vector
190  * stack.
191  *
192  * @param qname QName string
193  * @param namespaces namespace vector stack to use
194  * @param locator The Locator instance for error reporting, if any
195  * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
196  */
197  void
198  set(
199  const XalanDOMString& qname,
200  const NamespacesStackType& namespaces,
201  const Locator* locator = 0,
202  bool fUseDefault = false);
203 
204  /**
205  * Set the local part and namespace URI of a XalanQNameByValue from
206  * a string, resolving the prefix using the given namespace vector
207  * stack.
208  *
209  * @param qname QName string
210  * @param namespaces namespace vector stack to use
211  * @param locator The Locator instance for error reporting, if any
212  * @param fUseDefault If true, then elements with no prefix will have the default namespace URI, if there is one.
213  */
214  void
215  set(
216  const XalanDOMChar* qname,
217  const NamespacesStackType& namespaces,
218  const Locator* locator = 0,
219  bool fUseDefault = false);
220 
221  /**
222  * Set the local part and namespace URI of a XalanQNameByValue from
223  * a string, resolving the prefix using the resolver provided. The
224  * default namespace is not resolved.
225  *
226  * @param qname QName string
227  * @param theResolver prefix resolver to use
228  * @param locator The Locator instance for error reporting, if any
229  */
230  void
231  set(
232  const XalanDOMString& qname,
233  const PrefixResolver* theResolver = 0,
234  const Locator* locator = 0);
235 
236  /**
237  * Set the local part and namespace URI of a XalanQNameByValue from
238  * a string, resolving the prefix using the resolver provided. The
239  * default namespace is not resolved.
240  *
241  * @param qname QName string
242  * @param theResolver prefix resolver to use
243  * @param locator The Locator instance for error reporting, if any
244  */
245  void
246  set(
247  const XalanDOMChar* qname,
248  const PrefixResolver* theResolver = 0,
249  const Locator* locator = 0);
250  /**
251  * Clear the instance.
252  */
253  void
255  {
256  m_namespace.clear();
257  m_localpart.clear();
258  }
259 
262  {
263  m_namespace = theRHS.m_namespace;
264  m_localpart = theRHS.m_localpart;
265 
266  return *this;
267  }
268 
270  operator=(const XalanQName& theRHS)
271  {
272  m_namespace = theRHS.getNamespace();
273  m_localpart = theRHS.getLocalPart();
274 
275  return *this;
276  }
277 
278 private:
279  // not implemented
280  XalanQNameByValue(const XalanQNameByValue& theSource);
281  void
282  initialize(
283  const XalanDOMChar* qname,
285  const NamespacesStackType& namespaces,
286  const Locator* locator,
287  bool fUseDefault);
288 
289  void
290  resolvePrefix(
291  const XalanDOMChar* qname,
292  XalanDOMString::size_type theLength,
293  const PrefixResolver* theResolver,
294  const Locator* locator);
295 
296  void
297  validate(
298  const XalanDOMChar* qname,
299  XalanDOMString::size_type theLength,
300  const Locator* locator);
301 
302  // Data members...
303  XalanDOMString m_namespace;
304 
305  XalanDOMString m_localpart;
306 };
307 
309 
310 
311 template<>
313 {
314 };
315 
316 
317 
318 XALAN_CPP_NAMESPACE_END
319 
320 
321 
322 #endif // XALANQNAMEBYVALUE_HEADER_GUARD_1357924680
void clear()
Clear the instance.
virtual const XalanDOMString & getNamespace() const =0
Retrieve the namespace of qualified name.
XalanSize_t size_type
MemoryManager & getMemoryManager()
This is the abstract class that is used when reporting a problem some kind, that requires a message...
This class defines an interface for classes that resolve namespace prefixes to their URIs...
#define XALAN_USES_MEMORY_MANAGER(Type)
XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType
XalanQNameByValue & operator=(const XalanQNameByValue &theRHS)
virtual const XalanDOMString & getLocalPart() const =0
Retrieve the local part of qualified name.
XalanQNameByValue & operator=(const XalanQName &theRHS)
void setNamespace(const XalanDOMString &theNamespace)
Set the Namespace URI of qualified name.
#define XALAN_XPATH_EXPORT
Class to represent a qualified name.
Definition: XalanQName.hpp:70
Xalan implementation of deque.
Definition: XalanDeque.hpp:200
void setLocalPart(const XalanDOMString &theLocalPart)
Set the local part of qualified name.

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo