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