Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

XPathConstructionContext.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(XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
17 #define XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
18 
19 
20 
21 // Base include file. Must be first.
23 
24 
25 
27 
28 
29 
30 XALAN_DECLARE_XERCES_CLASS(Locator)
31 
32 
33 
34 XALAN_CPP_NAMESPACE_BEGIN
35 
36 
37 
38 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
39 XALAN_USING_XERCES(Locator)
40 
41 
42 
43 class XalanNode;
44 
45 
46 
47 //
51 // An abstract class which provides support for constructing the internal
52 // representation of a stylesheet.
53 //
55 {
56 public:
57 
58  XPathConstructionContext(MemoryManagerType& theManager);
59 
60  virtual
61  ~XPathConstructionContext();
62 
63 
68  virtual void
69  reset() = 0;
70 
80  virtual const XalanDOMString&
81  getPooledString(const XalanDOMString& theString) = 0;
82 
93  virtual const XalanDOMString&
94  getPooledString(
95  const XalanDOMChar* theString,
97 
103  virtual XalanDOMString&
104  getCachedString() = 0;
105 
113  virtual bool
114  releaseCachedString(XalanDOMString& theString) = 0;
115 
117  {
118  public:
119 
120  GetAndReleaseCachedString(XPathConstructionContext& theConstructionContext) :
121  m_constructionContext(&theConstructionContext),
122  m_string(&theConstructionContext.getCachedString())
123  {
124  }
125 
126  // Note non-const copy semantics...
128  m_constructionContext(theSource.m_constructionContext),
129  m_string(theSource.m_string)
130  {
131  theSource.m_string = 0;
132  }
133 
135  {
136  if (m_string != 0)
137  {
138  m_constructionContext->releaseCachedString(*m_string);
139  }
140  }
141 
143  get() const
144  {
145  assert(m_string != 0);
146 
147  return *m_string;
148  }
149 
150  XPathConstructionContext&
151  getConstructionContext() const
152  {
153  return *m_constructionContext;
154  }
155 
156 
157  private:
158 
159  // Not implemented...
161  operator=(const GetAndReleaseCachedString&);
162 
163 
164  // Data members...
165  XPathConstructionContext* m_constructionContext;
166 
167  XalanDOMString* m_string;
168  };
169 
171 
173  getMemoryManager()
174  {
175  return m_memoryManager;
176  }
177 
178  virtual void
179  error(
180  const XalanDOMString& msg,
181  const XalanNode* sourceNode,
182  const Locator* locator) const = 0;
183 
184  virtual void
185  warn(
186  const XalanDOMString& msg,
187  const XalanNode* sourceNode,
188  const Locator* locator) const = 0;
189 
191 };
192 
193 
194 
195 XALAN_CPP_NAMESPACE_END
196 
197 
198 
199 #endif // XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680

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