source: NonGTP/Xerces/xerces/include/xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp @ 358

Revision 358, 5.5 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2000,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: ICUMsgLoader.hpp,v $
19 * Revision 1.9  2004/09/08 13:56:33  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.8  2003/12/24 15:24:13  cargilld
23 * More updates to memory management so that the static memory manager.
24 *
25 * Revision 1.7  2003/12/17 03:56:15  neilg
26 * add default memory manager parameter to loadMsg method that uses char * parameters
27 *
28 * Revision 1.6  2003/05/15 18:29:48  knoaman
29 * Partial implementation of the configurable memory manager.
30 *
31 * Revision 1.5  2003/03/07 18:15:44  tng
32 * Return a reference instead of void for operator=
33 *
34 * Revision 1.4  2002/11/04 15:10:40  tng
35 * C++ Namespace Support.
36 *
37 * Revision 1.3  2002/10/10 21:07:55  peiyongz
38 * load resource files using environement vars and base name
39 *
40 * Revision 1.2  2002/09/30 22:20:40  peiyongz
41 * Build with ICU MsgLoader
42 *
43 * Revision 1.1.1.1  2002/02/01 22:22:19  peiyongz
44 * sane_include
45 *
46 * Revision 1.5  2002/01/21 14:52:25  tng
47 * [Bug 5847] ICUMsgLoader can't be compiled with gcc 3.0.3 and ICU2.  And also fix the memory leak introduced by Bug 2730 fix.
48 *
49 * Revision 1.4  2001/11/01 23:39:18  jasons
50 * 2001-11-01  Jason E. Stewart  <jason@openinformatics.com>
51 *
52 *      * src/util/MsgLoaders/ICU/ICUMsgLoader.hpp (Repository):
53 *      * src/util/MsgLoaders/ICU/ICUMsgLoader.cpp (Repository):
54 *      Updated to compile with ICU-1.8.1
55 *
56 * Revision 1.3  2000/03/02 19:55:14  roddey
57 * This checkin includes many changes done while waiting for the
58 * 1.1.0 code to be finished. I can't list them all here, but a list is
59 * available elsewhere.
60 *
61 * Revision 1.2  2000/02/06 07:48:21  rahulj
62 * Year 2K copyright swat.
63 *
64 * Revision 1.1.1.1  1999/11/09 01:07:24  twl
65 * Initial checkin
66 *
67 * Revision 1.4  1999/11/08 20:45:26  rahul
68 * Swat for adding in Product name and CVS comment log variable.
69 *
70 */
71
72
73#if !defined(ICUMSGLOADER_HPP)
74#define ICUMSGLOADER_HPP
75
76#include <xercesc/util/XMLMsgLoader.hpp>
77#include "unicode/ures.h"
78
79XERCES_CPP_NAMESPACE_BEGIN
80
81//
82//  This is the ICU specific implementation of the XMLMsgLoader interface.
83//  This one uses ICU resource bundles to store its messages.
84//
85class XMLUTIL_EXPORT ICUMsgLoader : public XMLMsgLoader
86{
87public :
88    // -----------------------------------------------------------------------
89    //  Public Constructors and Destructor
90    // -----------------------------------------------------------------------
91    ICUMsgLoader(const XMLCh* const  msgDomain);
92    ~ICUMsgLoader();
93
94
95    // -----------------------------------------------------------------------
96    //  Implementation of the virtual message loader API
97    // -----------------------------------------------------------------------
98    virtual bool loadMsg
99    (
100        const   XMLMsgLoader::XMLMsgId  msgToLoad
101        ,       XMLCh* const            toFill
102        , const unsigned int           maxChars
103    );
104
105    virtual bool loadMsg
106    (
107        const   XMLMsgLoader::XMLMsgId  msgToLoad
108        ,       XMLCh* const            toFill
109        , const unsigned int            maxChars
110        , const XMLCh* const            repText1
111        , const XMLCh* const            repText2 = 0
112        , const XMLCh* const            repText3 = 0
113        , const XMLCh* const            repText4 = 0
114        , MemoryManager* const          manager  = XMLPlatformUtils::fgMemoryManager
115    );
116
117    virtual bool loadMsg
118    (
119        const   XMLMsgLoader::XMLMsgId  msgToLoad
120        ,       XMLCh* const            toFill
121        , const unsigned int            maxChars
122        , const char* const             repText1
123        , const char* const             repText2 = 0
124        , const char* const             repText3 = 0
125        , const char* const             repText4 = 0
126        , MemoryManager * const         manager  = XMLPlatformUtils::fgMemoryManager
127    );
128
129
130private :
131    // -----------------------------------------------------------------------
132    //  Unimplemented constructors and operators
133    // -----------------------------------------------------------------------
134    ICUMsgLoader();
135    ICUMsgLoader(const ICUMsgLoader&);
136    ICUMsgLoader& operator=(const ICUMsgLoader&);
137
138
139    // -----------------------------------------------------------------------
140    //  Private data members
141    //
142    //  fLocaleBundle
143    //      pointer to the required locale specific resource bundle,
144        //           or to the default locale resrouce bundle in case the required
145        //              locale specific resource bundle unavailable.
146    //
147    //  fDomainBundle
148    //      pointer to the domain specific resource bundle with in the
149        //              required locale specific (or default locale) resource bundle.
150    //
151    // -----------------------------------------------------------------------
152    UResourceBundle*      fLocaleBundle;
153    UResourceBundle*      fDomainBundle;
154};
155
156XERCES_CPP_NAMESPACE_END
157
158#endif
Note: See TracBrowser for help on using the repository browser.