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(XALANMESSAGELOADER_HEADER_GUARD_1357924680) 00017 #define XALANMESSAGELOADER_HEADER_GUARD_1357924680 00018 00019 00020 // Base include file. Must be first. 00021 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp> 00022 00023 00024 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00025 00026 #include <xalanc/Include/XalanMemMgrAutoPtr.hpp> 00027 00028 #include <LocalMsgIndex.hpp> 00029 00030 00031 00032 XALAN_CPP_NAMESPACE_BEGIN 00033 00034 00035 00036 // class for calling fom outside of the module 00037 class XALAN_PLATFORMSUPPORT_EXPORT XalanMessageLoader { 00038 00039 00040 public: 00041 template <class Type> 00042 class XalanMessageLoaderCreateFunct 00043 { 00044 public: 00045 Type* 00046 operator()(MemoryManagerType& theManager) 00047 { 00048 XalanMemMgrAutoPtr<Type, false> theGuard( theManager , (Type*)theManager.allocate(sizeof(Type))); 00049 00050 Type* theResult = theGuard.get(); 00051 00052 new (theResult) Type(theManager); 00053 00054 theGuard.release(); 00055 00056 return theResult; 00057 } 00058 00059 }; 00060 00061 class XalanMessageLoaderDestructFunct 00062 { 00063 public: 00064 void 00065 operator()(MemoryManagerType& theManager, XalanMessageLoader* p) 00066 { 00067 assert ( p != 0); 00068 00069 p->~XalanMessageLoader(); 00070 00071 theManager.deallocate(p); 00072 } 00073 00074 }; 00075 00076 virtual 00077 ~XalanMessageLoader(); 00078 00079 XalanMessageLoader() 00080 { 00081 } 00082 00083 static void 00084 initialize(MemoryManagerType& theManager); 00085 00086 static void 00087 terminate(); 00088 00089 static XalanDOMString& 00090 getMessage(XalanMessages::Codes msgToLoad, 00091 XalanDOMString& theResultMessage, 00092 const char* repText1 , 00093 const char* repText2 = 0, 00094 const char* repText3 = 0, 00095 const char* repText4 = 0); 00096 00097 static XalanDOMString& 00098 getMessage(XalanMessages::Codes msgToLoad, 00099 XalanDOMString& theResultMessage, 00100 const XalanDOMChar* repText1, 00101 const XalanDOMChar* repText2 = 0, 00102 const XalanDOMChar* repText3 = 0, 00103 const XalanDOMChar* repText4 = 0); 00104 00105 static XalanDOMString& 00106 getMessage(XalanMessages::Codes msgToLoad, 00107 XalanDOMString& theResultMessage); 00108 00109 static XalanDOMString& 00110 getMessage(XalanMessages::Codes msgToLoad, 00111 XalanDOMString& theResultMessage, 00112 const XalanDOMString& repText1 ); 00113 00114 static XalanDOMString& 00115 getMessage(XalanMessages::Codes msgToLoad, 00116 XalanDOMString& theResultMessage, 00117 const XalanDOMString& repText1, 00118 const XalanDOMString& repText2 ); 00119 00120 static XalanDOMString& 00121 getMessage(XalanMessages::Codes msgToLoad, 00122 XalanDOMString& theResultMessage, 00123 const XalanDOMString& repText1, 00124 const XalanDOMString& repText2, 00125 const XalanDOMString& repText3); 00126 00127 00128 00129 protected: 00130 virtual bool loadMsg 00131 ( 00132 XalanMessages::Codes msgToLoad, 00133 XalanDOMChar* toFill, 00134 unsigned int maxChars) =0; 00135 00136 private: 00137 00138 bool load(XalanMessages::Codes msgToLoad, 00139 XalanDOMChar* toFill, 00140 unsigned int maxChars, 00141 const XalanDOMChar* repText1 , 00142 const XalanDOMChar* repText2 = 0, 00143 const XalanDOMChar* repText3 = 0, 00144 const XalanDOMChar* repText4 = 0 00145 ); 00146 00147 bool load(XalanMessages::Codes msgToLoad, 00148 MemoryManagerType& theManager, 00149 XalanDOMChar* toFill, 00150 unsigned int maxChars, 00151 const char* repText1 , 00152 const char* repText2 = 0, 00153 const char* repText3 = 0, 00154 const char* repText4 = 0); 00155 00156 XalanMessageLoader(const XalanMessageLoader&); 00157 00158 XalanMessageLoader& 00159 operator=(const XalanMessageLoader&); 00160 00161 static XalanMessageLoader* s_msgLoader; 00162 }; 00163 00164 00165 00166 XALAN_CPP_NAMESPACE_END 00167 00168 #endif // XALANMESSAGELOADER_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.9 |
|