Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

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

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo