Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

NameSpace.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(NAMESPACE_HEADER_GUARD_1357924680)
17 #define NAMESPACE_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base header file. Must be first.
23 
25 
27 
28 
29 
30 XALAN_CPP_NAMESPACE_BEGIN
31 
32 
33 
39 {
40 public:
41 
42  explicit
44  m_prefix(theManager),
45  m_uri(theManager)
46  {
47  }
48 
57  const XalanDOMString& prefix,
58  const XalanDOMString& uri,
59  MemoryManagerType& theManager) :
60  m_prefix(prefix, theManager),
61  m_uri(uri, theManager)
62  {
63  }
64 
65  static NameSpace*
67  const XalanDOMString& prefix,
68  const XalanDOMString& uri,
69  MemoryManagerType& theManager)
70  {
71  typedef NameSpace ThisType;
72 
73  XalanMemMgrAutoPtr<ThisType, false> theGuard( theManager , (ThisType*)theManager.allocate(sizeof(ThisType)));
74 
75  ThisType* theResult = theGuard.get();
76 
77  new (theResult) ThisType(prefix, uri, theManager);
78 
79  theGuard.release();
80 
81  return theResult;
82  }
83  NameSpace( const NameSpace& other,
84  MemoryManagerType& theManager) :
85  m_prefix(other.m_prefix, theManager),
86  m_uri(other.m_uri, theManager)
87  {
88  }
89 
91  {
92  }
93 
99  const XalanDOMString&
100  getPrefix() const
101  {
102  return m_prefix;
103  }
104 
110  void
111  setPrefix(const XalanDOMString& prefix)
112  {
113  m_prefix = prefix;
114  }
115 
121  const XalanDOMString&
122  getURI() const
123  {
124  return m_uri;
125  }
126 
132  void
133  setURI(const XalanDOMString& uri)
134  {
135  m_uri = uri;
136  }
137 
143  void
144  setURI(const XalanDOMChar* uri)
145  {
146  assert(uri != 0);
147 
148  m_uri = uri;
149  }
150 
157  void
159  const XalanDOMChar* uri,
161  {
162  assert(uri != 0);
163 
164  m_uri.assign(uri, len);
165  }
166 
167  bool
168  empty() const
169  {
170  return m_prefix.empty() && m_uri.empty();
171  }
172 
173  void
175  {
176  m_prefix.clear();
177 
178  m_uri.clear();
179  }
180 
186  bool
187  operator==(const NameSpace& theRHS) const
188  {
189  return equals(m_prefix, theRHS.m_prefix) &&
190  equals(m_uri, theRHS.m_uri);
191  }
192 
193 private:
194  NameSpace(const NameSpace&);
195 
196  XalanDOMString m_prefix;
197 
198  XalanDOMString m_uri;
199 };
200 
202 
203 XALAN_CPP_NAMESPACE_END
204 
205 
206 
207 #endif // NAMESPACE_HEADER_GUARD_1357924680
void setPrefix(const XalanDOMString &prefix)
Set the prefix for namespace.
Definition: NameSpace.hpp:111
XALAN_CPP_NAMESPACE_BEGIN typedef XERCES_CPP_NAMESPACE_QUALIFIER MemoryManager MemoryManagerType
Definition: XalanMemoryManagement.hpp:39
NameSpace(MemoryManagerType &theManager)
Definition: NameSpace.hpp:43
void clear()
Definition: NameSpace.hpp:174
bool operator==(const NameSpace &theRHS) const
Equality operator.
Definition: NameSpace.hpp:187
void setURI(const XalanDOMString &uri)
Set the URI for namespace.
Definition: NameSpace.hpp:133
void setURI(const XalanDOMChar *uri, XalanDOMString::size_type len)
Set the URI for namespace.
Definition: NameSpace.hpp:158
A representation of a namespace.
Definition: NameSpace.hpp:38
~NameSpace()
Definition: NameSpace.hpp:90
static NameSpace * create(const XalanDOMString &prefix, const XalanDOMString &uri, MemoryManagerType &theManager)
Definition: NameSpace.hpp:66
NameSpace(const NameSpace &other, MemoryManagerType &theManager)
Definition: NameSpace.hpp:83
const XalanDOMString & getURI() const
Retrieve the URI for namespace.
Definition: NameSpace.hpp:122
Type * get() const
Definition: XalanMemMgrAutoPtr.hpp:164
Definition: XalanMemMgrAutoPtr.hpp:46
#define XALAN_USES_MEMORY_MANAGER(Type)
Definition: XalanMemoryManagement.hpp:468
NameSpace(const XalanDOMString &prefix, const XalanDOMString &uri, MemoryManagerType &theManager)
Construct a namespace for placement on the result tree namespace stack.
Definition: NameSpace.hpp:56
void setURI(const XalanDOMChar *uri)
Set the URI for namespace.
Definition: NameSpace.hpp:144
Definition: XalanDOMString.hpp:42
const XalanDOMString & getPrefix() const
Retrieve the prefix for namespace.
Definition: NameSpace.hpp:100
unsigned int size_type
Definition: XalanDOMString.hpp:53
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:33
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
bool empty() const
Definition: NameSpace.hpp:168

Interpreting class diagrams

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

dot

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

Apache Logo