Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

XPathEnvSupportDefault.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(XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680)
00017 #define XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
00018 
00019 
00020 
00021 // Base include file.  Must be first.
00022 #include <xalanc/XPath/XPathDefinitions.hpp>
00023 
00024 
00025 
00026 #include <vector>
00027 
00028 
00029 
00030 #include <xalanc/XPath/XPathEnvSupport.hpp>
00031 
00032 
00033 
00034 XALAN_CPP_NAMESPACE_BEGIN
00035 
00036 
00037 
00043 class XALAN_XPATH_EXPORT XPathEnvSupportDefault : public XPathEnvSupport
00044 {
00045 public:
00046 
00047 #if defined(XALAN_NO_STD_NAMESPACE)
00048     typedef map<XalanDOMString, XalanDocument*, less<XalanDOMString> >      SourceDocsTableType;
00049     typedef map<XalanDOMString, const Function*, less<XalanDOMString> >     FunctionTableType;
00050     typedef map<XalanDOMString, FunctionTableType, less<XalanDOMString> >   NamespaceFunctionTablesType;
00051 #else
00052     typedef std::map<XalanDOMString, XalanDocument*>    SourceDocsTableType;
00053     typedef std::map<XalanDOMString, const Function*>   FunctionTableType;
00054     typedef std::map<XalanDOMString, FunctionTableType> NamespaceFunctionTablesType;
00055 #endif
00056 
00061     static void
00062     initialize();
00063 
00067     static void
00068     terminate();
00069 
00070 
00071     XPathEnvSupportDefault();
00072 
00073     virtual
00074     ~XPathEnvSupportDefault();
00075 
00076 
00077     // Interfaces to install and uninstall external functions globally.
00078     // These calls are not thread-safe, and should happen during
00079     // processing.
00080 
00088     static void
00089     installExternalFunctionGlobal(
00090             const XalanDOMString&   theNamespace,
00091             const XalanDOMString&   functionName,
00092             const Function&         function);
00093 
00100     static void
00101     uninstallExternalFunctionGlobal(
00102             const XalanDOMString&   theNamespace,
00103             const XalanDOMString&   functionName);
00104 
00105     // Interfaces to install and uninstall external functions in this instance.
00106 
00114     virtual void
00115     installExternalFunctionLocal(
00116             const XalanDOMString&   theNamespace,
00117             const XalanDOMString&   functionName,
00118             const Function&         function);
00119 
00126     virtual void
00127     uninstallExternalFunctionLocal(
00128             const XalanDOMString&   theNamespace,
00129             const XalanDOMString&   functionName);
00130 
00131 
00132     // These interfaces are inherited from XPathEnvSupport...
00133 
00134     virtual XalanDocument*
00135     parseXML(
00136             const XalanDOMString&   urlString,
00137             const XalanDOMString&   base);
00138 
00139     virtual XalanDocument*
00140     getSourceDocument(const XalanDOMString& theURI) const;
00141 
00142     virtual void
00143     setSourceDocument(
00144             const XalanDOMString&   theURI,
00145             XalanDocument*          theDocument);
00146 
00147     virtual XalanDOMString
00148     findURIFromDoc(const XalanDocument*     owner) const;
00149 
00150     virtual bool
00151     elementAvailable(
00152             const XalanDOMString&   theNamespace, 
00153             const XalanDOMString&   elementName) const;
00154 
00155     virtual bool
00156     functionAvailable(
00157             const XalanDOMString&   theNamespace, 
00158             const XalanDOMString&   functionName) const;
00159 
00160     virtual XObjectPtr
00161     extFunction(
00162             XPathExecutionContext&          executionContext,
00163             const XalanDOMString&           theNamespace,
00164             const XalanDOMString&           functionName, 
00165             XalanNode*                      context,
00166             const XObjectArgVectorType&     argVec,
00167             const LocatorType*              locator) const;
00168 
00169     virtual bool
00170     problem(
00171             eSource                 where,
00172             eClassification         classification,
00173             const PrefixResolver*   resolver,
00174             const XalanNode*        sourceNode,
00175             const XalanDOMString&   msg,
00176             const XalanDOMChar*     uri,
00177             int                     lineNo,
00178             int                     charOffset) const;
00179 
00180     // These interfaces are inherited from Resettable...
00181 
00182     virtual void
00183     reset();
00184 
00185     // Delete functor for table cleanup...
00186     struct NamespaceFunctionTableDeleteFunctor
00187     {
00188         typedef FunctionTableType               FunctionTableInnerType;
00189         typedef NamespaceFunctionTablesType     NamespaceFunctionTablesInnerType;
00190 
00197         void
00198         operator()(const NamespaceFunctionTablesInnerType::value_type&  thePair) const;
00199     };
00200 
00201 protected:
00202 
00210     const Function*
00211     findFunction(
00212             const XalanDOMString&   theNamespace,
00213             const XalanDOMString&   functionName) const;
00214 
00215 private:
00216 
00217     // These are not implemented...
00218     XPathEnvSupportDefault(const XPathEnvSupportDefault&);
00219 
00220     XPathEnvSupportDefault&
00221     operator=(const XPathEnvSupportDefault&);
00222 
00223     bool
00224     operator==(const XPathEnvSupportDefault&) const;
00225 
00239     static void
00240     updateFunctionTable(
00241             NamespaceFunctionTablesType&    theTable,
00242             const XalanDOMString&           theNamespace,
00243             const XalanDOMString&           functionName,
00244             const Function*                 function);
00245 
00254     const Function*
00255     findFunction(
00256             const NamespaceFunctionTablesType&  theTable,
00257             const XalanDOMString&               theNamespace,
00258             const XalanDOMString&               functionName) const;
00259 
00260     // Data members...
00261 
00262     SourceDocsTableType                     m_sourceDocs;
00263 
00264     NamespaceFunctionTablesType             m_externalFunctions;
00265 
00266     static  NamespaceFunctionTablesType     s_externalFunctions;
00267 };
00268 
00269 
00270 
00271 XALAN_CPP_NAMESPACE_END
00272 
00273 
00274 
00275 #endif  // XPATHENVSUPPORTDEFAULT_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.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.