Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanNamespace.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(XALANNAMESPACE_HEADER_GUARD_1357924680)
19 #define XALANNAMESPACE_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base header file. Must be first.
25 
26 
27 
29 
30 
31 
32 XALAN_CPP_NAMESPACE_BEGIN
33 
34 
35 
37 {
38 public:
39 
40  explicit
41  XalanNamespace(MemoryManager& theManager) :
42  m_prefix(theManager),
43  m_uri(theManager)
44  {
45  }
46 
47  /**
48  * Construct a namespace for placement on the
49  * result tree namespace stack.
50  *
51  * @param thePrefix namespace thePrefix
52  * @param theURI URI of namespace
53  */
55  const XalanDOMString& thePrefix,
56  const XalanDOMString& theURI,
57  MemoryManager& theManager) :
58  m_prefix(thePrefix,theManager),
59  m_uri(theURI, theManager)
60  {
61  }
62 
64  const XalanNamespace& other,
65  MemoryManager& theManager) :
66  m_prefix(other.m_prefix,theManager),
67  m_uri(other.m_uri, theManager)
68  {
69  }
70 
72  {
73  }
74 
75  /**
76  * Retrieve the thePrefix for namespace
77  *
78  * @return thePrefix string
79  */
80  const XalanDOMString&
81  getPrefix() const
82  {
83  return m_prefix;
84  }
85 
86  /**
87  * Set the thePrefix for namespace
88  *
89  * @param thePrefix The new thePrefix value
90  */
91  void
92  setPrefix(const XalanDOMString& thePrefix)
93  {
94  m_prefix = thePrefix;
95  }
96 
97  /**
98  * Retrieve the URI for namespace
99  *
100  * @return URI string
101  */
102  const XalanDOMString&
103  getURI() const
104  {
105  return m_uri;
106  }
107 
108  /**
109  * Set the URI for namespace
110  *
111  * @param theURI The new theURI value
112  */
113  void
114  setURI(const XalanDOMString& theURI)
115  {
116  m_uri = theURI;
117  }
118 
119  /**
120  * Set the URI for namespace
121  *
122  * @param theURI The new theURI value
123  */
124  void
125  setURI(const XalanDOMChar* theURI)
126  {
127  assert(theURI != 0);
128 
129  m_uri = theURI;
130  }
131 
132  /**
133  * Set the URI for namespace
134  *
135  * @param theURI The new theURI value
136  * @param len The length of the theURI
137  */
138  void
140  const XalanDOMChar* theURI,
142  {
143  assert(theURI != 0);
144 
145  m_uri.assign(theURI, len);
146  }
147 
148  bool
149  empty() const
150  {
151  return m_prefix.empty() && m_uri.empty();
152  }
153 
154  void
156  {
157  m_prefix.clear();
158 
159  m_uri.clear();
160  }
161 
162  /**
163  * Equality operator
164  *
165  * @param theRHS namespace to compare
166  */
167  bool
168  operator==(const XalanNamespace& theRHS) const
169  {
170  return equals(m_prefix, theRHS.m_prefix) &&
171  equals(m_uri, theRHS.m_uri);
172  }
173 
174 private:
175  //Not implemented
176  XalanNamespace();
178 
179  XalanDOMString m_prefix;
180 
181  XalanDOMString m_uri;
182 };
183 
185 
186 XALAN_CPP_NAMESPACE_END
187 
188 
189 
190 #endif // ALANNAMESPACE_HEADER_GUARD_1357924680
XalanNamespace(const XalanDOMString &thePrefix, const XalanDOMString &theURI, MemoryManager &theManager)
Construct a namespace for placement on the result tree namespace stack.
XalanNamespace(MemoryManager &theManager)
void setURI(const XalanDOMChar *theURI)
Set the URI for namespace.
bool empty() const
XalanSize_t size_type
XalanDOMString & assign(const XalanDOMChar *theSource)
void setURI(const XalanDOMChar *theURI, XalanDOMString::size_type len)
Set the URI for namespace.
XalanNamespace(const XalanNamespace &other, MemoryManager &theManager)
bool empty() const
const XalanDOMString & getPrefix() const
Retrieve the thePrefix for namespace.
void setURI(const XalanDOMString &theURI)
Set the URI for namespace.
#define XALAN_USES_MEMORY_MANAGER(Type)
const XalanDOMString & getURI() const
Retrieve the URI for namespace.
bool operator==(const XalanNamespace &theRHS) const
Equality operator.
equals(const XalanDOMChar *theLHS, const XalanDOMChar *theRHS, XalanDOMString::size_type theLength)
Compare the contents of two arrays for equality.
void setPrefix(const XalanDOMString &thePrefix)
Set the thePrefix for namespace.

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