## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.10

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# XPathConstructionContext.hpp

Go to the documentation of this file.

    00001 /*
    00002  * Copyright 1999-2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *     http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016 #if !defined(XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680)
    00017 #define XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680
    00018
    00019
    00020
    00021 // Base include file.  Must be first.
    00022 #include <xalanc/XPath/XPathDefinitions.hpp>
    00023
    00024
    00025
    00026 #include <xalanc/XalanDOM/XalanDOMString.hpp>
    00027
    00028
    00029
    00030 XALAN_DECLARE_XERCES_CLASS(Locator)
    00031
    00032
    00033
    00034 XALAN_CPP_NAMESPACE_BEGIN
    00035
    00036
    00037
    00038 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator  LocatorType;
    00039 XALAN_USING_XERCES(Locator)
    00040
    00041
    00042
    00043 class XalanNode;
    00044
    00045
    00046
    00047 //
    00051 // An abstract class which provides support for constructing the internal
    00052 // representation  of a stylesheet.
    00053 //
    00054 class XALAN_XPATH_EXPORT XPathConstructionContext
    00055 {
    00056 public:
    00057
    00058     XPathConstructionContext(MemoryManagerType&              theManager);
    00059
    00060     virtual
    00061     ~XPathConstructionContext();
    00062
    00063
    00068     virtual void
    00069     reset() = 0;
    00070
    00080     virtual const XalanDOMString&
    00081     getPooledString(const XalanDOMString&   theString) = 0;
    00082
    00093     virtual const XalanDOMString&
    00094     getPooledString(
    00095             const XalanDOMChar*         theString,
    00096             XalanDOMString::size_type   theLength = XalanDOMString::npos) = 0;
    00097
    00103     virtual XalanDOMString&
    00104     getCachedString() = 0;
    00105
    00113     virtual bool
    00114     releaseCachedString(XalanDOMString&     theString) = 0;
    00115
    00116     class GetAndReleaseCachedString
    00117     {
    00118     public:
    00119
    00120         GetAndReleaseCachedString(XPathConstructionContext&     theConstructionContext) :
    00121             m_constructionContext(&theConstructionContext),
    00122             m_string(&theConstructionContext.getCachedString())
    00123         {
    00124         }
    00125
    00126         // Note non-const copy semantics...
    00127         GetAndReleaseCachedString(GetAndReleaseCachedString&    theSource) :
    00128             m_constructionContext(theSource.m_constructionContext),
    00129             m_string(theSource.m_string)
    00130         {
    00131             theSource.m_string = 0;
    00132         }
    00133
    00134         ~GetAndReleaseCachedString()
    00135         {
    00136             if (m_string != 0)
    00137             {
    00138                 m_constructionContext->releaseCachedString(*m_string);
    00139             }
    00140         }
    00141
    00142         XalanDOMString&
    00143         get() const
    00144         {
    00145             assert(m_string != 0);
    00146
    00147             return *m_string;
    00148         }
    00149
    00150         XPathConstructionContext&
    00151         getConstructionContext() const
    00152         {
    00153             return *m_constructionContext;
    00154         }
    00155
    00156
    00157     private:
    00158
    00159         // Not implemented...
    00160         GetAndReleaseCachedString&
    00161         operator=(const GetAndReleaseCachedString&);
    00162
    00163
    00164         // Data members...
    00165         XPathConstructionContext*   m_constructionContext;
    00166
    00167         XalanDOMString*             m_string;
    00168     };
    00169
    00170     typedef GetAndReleaseCachedString   GetCachedString;
    00171
    00172     MemoryManagerType&
    00173     getMemoryManager()
    00174     {
    00175         return m_memoryManager;
    00176     }
    00177
    00178     virtual void
    00179     error(
    00180             const XalanDOMString&   msg,
    00181             const XalanNode*        sourceNode,
    00182             const Locator*          locator) const = 0;
    00183
    00184     virtual void
    00185     warn(
    00186             const XalanDOMString&   msg,
    00187             const XalanNode*        sourceNode,
    00188             const Locator*          locator) const = 0;
    00189
    00190     MemoryManagerType&              m_memoryManager;
    00191 };
    00192
    00193
    00194
    00195 XALAN_CPP_NAMESPACE_END
    00196
    00197
    00198
    00199 #endif  // XPATHCONSTRUCTIONCONTEXT_HEADER_GUARD_1357924680

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.10 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.