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 #include <xalanc/XPath/XPathEnvSupport.hpp> 00024 00025 00026 #include<xalanc/PlatformSupport/DOMStringHelper.hpp> 00027 00028 00029 #include<xalanc/Include/XalanMap.hpp> 00030 00031 00032 XALAN_CPP_NAMESPACE_BEGIN 00033 00034 typedef XalanMap<XalanDOMString, const Function*> FunctionTableTypeDefinition; 00035 XALAN_USES_MEMORY_MANAGER(FunctionTableTypeDefinition) 00036 00037 00043 class XALAN_XPATH_EXPORT XPathEnvSupportDefault : public XPathEnvSupport 00044 { 00045 public: 00046 00047 typedef XalanMap<XalanDOMString, XalanDocument*> SourceDocsTableType; 00048 typedef FunctionTableTypeDefinition FunctionTableType; 00049 typedef XalanMap<XalanDOMString, FunctionTableType> NamespaceFunctionTablesType; 00050 00055 static void 00056 initialize(MemoryManagerType& theManager); 00057 00061 static void 00062 terminate(); 00063 00064 00065 XPathEnvSupportDefault(MemoryManagerType& theManager XALAN_DEFAULT_MEMMGR); 00066 00067 virtual 00068 ~XPathEnvSupportDefault(); 00069 00070 MemoryManagerType& 00071 getMemoryManager() 00072 { 00073 return m_sourceDocs.getMemoryManager(); 00074 } 00075 00076 // Interfaces to install and uninstall external functions globally. 00077 // These calls are not thread-safe, and should happen during 00078 // processing. 00079 00087 static void 00088 installExternalFunctionGlobal( 00089 const XalanDOMString& theNamespace, 00090 const XalanDOMString& functionName, 00091 const Function& function); 00092 00099 static void 00100 uninstallExternalFunctionGlobal( 00101 const XalanDOMString& theNamespace, 00102 const XalanDOMString& functionName); 00103 00104 // Interfaces to install and uninstall external functions in this instance. 00105 00113 virtual void 00114 installExternalFunctionLocal( 00115 const XalanDOMString& theNamespace, 00116 const XalanDOMString& functionName, 00117 const Function& function); 00118 00125 virtual void 00126 uninstallExternalFunctionLocal( 00127 const XalanDOMString& theNamespace, 00128 const XalanDOMString& functionName); 00129 00130 00131 // These interfaces are inherited from XPathEnvSupport... 00132 00133 virtual XalanDocument* 00134 parseXML( 00135 MemoryManagerType& theManager, 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 const 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 00191 NamespaceFunctionTableDeleteFunctor(MemoryManagerType& theManager); 00198 void 00199 operator()(const NamespaceFunctionTablesInnerType::value_type& thePair) const; 00200 private: 00201 MemoryManagerType& m_memMgr; 00202 }; 00203 00204 protected: 00205 00213 const Function* 00214 findFunction( 00215 const XalanDOMString& theNamespace, 00216 const XalanDOMString& functionName) const; 00217 00218 private: 00219 00220 // These are not implemented... 00221 XPathEnvSupportDefault(const XPathEnvSupportDefault&); 00222 00223 XPathEnvSupportDefault& 00224 operator=(const XPathEnvSupportDefault&); 00225 00226 bool 00227 operator==(const XPathEnvSupportDefault&) const; 00228 00242 static void 00243 updateFunctionTable( 00244 NamespaceFunctionTablesType& theTable, 00245 const XalanDOMString& theNamespace, 00246 const XalanDOMString& functionName, 00247 const Function* function); 00248 00257 const Function* 00258 findFunction( 00259 const NamespaceFunctionTablesType& theTable, 00260 const XalanDOMString& theNamespace, 00261 const XalanDOMString& functionName) const; 00262 00263 // Data members... 00264 00265 SourceDocsTableType m_sourceDocs; 00266 00267 NamespaceFunctionTablesType m_externalFunctions; 00268 00269 static NamespaceFunctionTablesType s_externalFunctions; 00270 00271 static const XalanDOMString s_emptyString; 00272 }; 00273 00274 XALAN_CPP_NAMESPACE_END 00275 00276 00277 00278 #endif // XPATHENVSUPPORTDEFAULT_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.10 |
|