Xalan-C++ API Reference  1.12.0
XalanQNameByReference.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(XALANQNAMEBYREFERENCE_HEADER_GUARD_1357924680)
19 #define XALANQNAMEBYREFERENCE_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 namespace XALAN_CPP_NAMESPACE {
34 
35 
36 
38 {
39 public:
40 
41  /**
42  * Construct an empty XalanQNameByReference.
43  */
44  explicit
46 
47  /**
48  * Construct a XalanQNameByReference, with the supplied namespace and local part.
49  * The instance keeps only a _reference_ to the string, to avoid making a
50  * copy.
51  *
52  * @param theNamespace namespace string
53  * @param theLocalPart local part string
54  */
56  const XalanDOMString& theNamespace,
57  const XalanDOMString& theLocalPart);
58 
59  /**
60  * Construct a XalanQNameByReference, with the supplied local part.
61  * The instance keeps only a _reference_ to the string, to avoid making a
62  * copy.
63  *
64  * @param theLocalPart local part string
65  */
66  XalanQNameByReference(const XalanDOMString& theLocalPart);
67 
68  /**
69  * Construct a XalanQNameByReference, from the supplied XalanQName. The instance
70  * keeps only a _reference_ to the string, to avoid making a copy.
71  *
72  * @param theQName The source QName
73  */
74  XalanQNameByReference(const XalanQName& theQName);
75 
76  virtual
78 
79  /**
80  * Retrieve the local part of qualified name.
81  *
82  * @return local part string
83  */
84  virtual const XalanDOMString&
85  getLocalPart() const;
86 
87  /**
88  * Set the local part of qualified name.
89  *
90  * @param theLocalPart local part string
91  */
92  void
93  setLocalPart(const XalanDOMString& theLocalPart)
94  {
95  m_localpart = &theLocalPart;
96  }
97 
98  /**
99  * Retrieve the namespace of qualified name.
100  *
101  * @return namespace string
102  */
103  virtual const XalanDOMString&
104  getNamespace() const;
105 
106  /**
107  * Set the Namespace URI of qualified name.
108  *
109  * @param theLocalPart local part string
110  */
111  void
112  setNamespace(const XalanDOMString& theNamespace)
113  {
114  m_namespace = &theNamespace;
115  }
116 
117  /**
118  * Clear the instance.
119  */
120  void
122  {
123  m_namespace = &s_emptyString;
124  m_localpart = &s_emptyString;
125  }
126 
127 private:
128 
129  // OK, we said reference, but using pointers
130  // allows for copy and assignment semantics.
131  const XalanDOMString* m_namespace;
132 
133  const XalanDOMString* m_localpart;
134 };
135 
136 
137 
138 template<>
140 {
141 };
142 
143 
144 
145 }
146 
147 
148 
149 #endif // XALANQNAMEBYREFERENCE_HEADER_GUARD_1357924680
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanQNameByReference
Definition: XalanQNameByReference.hpp:37
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
XalanQName.hpp
xalanc::XalanQNameByReference::setLocalPart
void setLocalPart(const XalanDOMString &theLocalPart)
Set the local part of qualified name.
Definition: XalanQNameByReference.hpp:93
xalanc::XalanQNameByReference::clear
void clear()
Clear the instance.
Definition: XalanQNameByReference.hpp:121
xalanc::XalanMapKeyTraits
Definition: XalanMap.hpp:68
xalanc::XalanQName
Class to represent a qualified name.
Definition: XalanQName.hpp:70
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XalanQNameByReference::setNamespace
void setNamespace(const XalanDOMString &theNamespace)
Set the Namespace URI of qualified name.
Definition: XalanQNameByReference.hpp:112
XPathDefinitions.hpp