00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(EXSLT_COMMONIMPL_HEADER_GUARD_1357924680) 00019 #define EXSLT_COMMONIMPL_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include "XalanEXSLTDefinitions.hpp" 00024 00025 00026 00027 #include <xalanc/PlatformSupport/XalanMessageLoader.hpp> 00028 00029 00030 00031 #include <xalanc/XPath/Function.hpp> 00032 00033 00034 00035 #include <xalanc/XalanExtensions/FunctionNodeSet.hpp> 00036 00037 00038 00039 XALAN_CPP_NAMESPACE_BEGIN 00040 00041 00042 00043 class XALAN_EXSLT_EXPORT XalanEXSLTFunctionNodeSet : public FunctionNodeSet 00044 { 00045 public: 00046 00047 XalanEXSLTFunctionNodeSet() : 00048 FunctionNodeSet(true) 00049 { 00050 } 00051 00052 virtual 00053 ~XalanEXSLTFunctionNodeSet() 00054 { 00055 } 00056 00057 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00058 virtual Function* 00059 #else 00060 virtual XalanEXSLTFunctionNodeSet* 00061 #endif 00062 clone(MemoryManager& theManager) const 00063 { 00064 return XalanCopyConstruct(theManager, *this); 00065 } 00066 00067 protected: 00068 00069 virtual const XalanDOMString& 00070 getError(XalanDOMString& theBuffer) const 00071 { 00072 XalanMessageLoader::getMessage( 00073 theBuffer, 00074 XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param, 00075 "node-set()"); 00076 00077 return theBuffer; 00078 } 00079 00080 00081 virtual const XalanDOMString& 00082 getInvalidArgumentTypeError(XalanDOMString& theResult) const 00083 { 00084 XalanMessageLoader::getMessage( 00085 theResult, 00086 XalanMessages::InvalidArgumentType_1Param, 00087 "node-set()"); 00088 00089 return theResult; 00090 } 00091 00092 private: 00093 00094 // Not implemented... 00095 XalanEXSLTFunctionNodeSet& 00096 operator=(const XalanEXSLTFunctionNodeSet&); 00097 00098 bool 00099 operator==(const XalanEXSLTFunctionNodeSet&) const; 00100 }; 00101 00102 00103 00104 class XALAN_EXSLT_EXPORT XalanEXSLTFunctionObjectType : public Function 00105 { 00106 public: 00107 00108 typedef Function ParentType; 00109 00110 XalanEXSLTFunctionObjectType(MemoryManager& theManager) : 00111 Function(), 00112 m_boolean(s_booleanString, theManager), 00113 m_external(s_externalString, theManager), 00114 m_nodeSet(s_nodeSetString, theManager), 00115 m_number(s_numberString, theManager), 00116 m_rtf(s_rtfString, theManager), 00117 m_string(s_stringString, theManager) 00118 { 00119 } 00120 00121 // A dummy constructor for use internally. Do not use this one!!!! 00122 XalanEXSLTFunctionObjectType(MemoryManager& theManager, int /* theDummy */) : 00123 Function(), 00124 m_boolean(theManager), 00125 m_external(theManager), 00126 m_nodeSet(theManager), 00127 m_number(theManager), 00128 m_rtf(theManager), 00129 m_string(theManager) 00130 { 00131 } 00132 00133 virtual 00134 ~XalanEXSLTFunctionObjectType() 00135 { 00136 } 00137 00138 // These methods are inherited from Function ... 00139 00140 virtual XObjectPtr 00141 execute( 00142 XPathExecutionContext& executionContext, 00143 XalanNode* context, 00144 const XObjectArgVectorType& args, 00145 const Locator* locator) const; 00146 00147 using ParentType::execute; 00148 00149 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00150 virtual Function* 00151 #else 00152 virtual XalanEXSLTFunctionObjectType* 00153 #endif 00154 clone(MemoryManager& theManager) const 00155 { 00156 typedef XalanEXSLTFunctionObjectType ThisType; 00157 00158 XalanAllocationGuard theGuard(theManager, theManager.allocate(sizeof(ThisType))); 00159 00160 ThisType* const theResult = 00161 new (theGuard.get()) ThisType(theManager); 00162 00163 theGuard.release(); 00164 00165 return theResult; 00166 } 00167 00168 protected: 00169 00170 00171 00172 const XalanDOMString& 00173 getError(XalanDOMString& theResult) const; 00174 00175 private: 00176 00177 // Not implemented... 00178 XalanEXSLTFunctionObjectType(const XalanEXSLTFunctionObjectType&); 00179 00180 XalanEXSLTFunctionObjectType& 00181 operator=(const XalanEXSLTFunctionObjectType&); 00182 00183 bool 00184 operator==(const XalanEXSLTFunctionObjectType&) const; 00185 00186 00187 // Data members... 00188 const XalanDOMString m_boolean; 00189 const XalanDOMString m_external; 00190 const XalanDOMString m_nodeSet; 00191 const XalanDOMString m_number; 00192 const XalanDOMString m_rtf; 00193 const XalanDOMString m_string; 00194 00195 static const XalanDOMChar s_booleanString[]; 00196 static const XalanDOMChar s_externalString[]; 00197 static const XalanDOMChar s_nodeSetString[]; 00198 static const XalanDOMChar s_numberString[]; 00199 static const XalanDOMChar s_rtfString[]; 00200 static const XalanDOMChar s_stringString[]; 00201 }; 00202 00203 00204 00205 XALAN_CPP_NAMESPACE_END 00206 00207 00208 00209 #endif // EXSLT_COMMONIMPL_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.11 |
|