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: Win32MsgLoader.hpp,v $
|
---|
19 | * Revision 1.6 2004/09/08 13:56:34 peiyongz
|
---|
20 | * Apache License Version 2.0
|
---|
21 | *
|
---|
22 | * Revision 1.5 2003/12/24 15:24:13 cargilld
|
---|
23 | * More updates to memory management so that the static memory manager.
|
---|
24 | *
|
---|
25 | * Revision 1.4 2003/12/17 00:18:37 cargilld
|
---|
26 | * Update to memory management so that the static memory manager (one used to call Initialize) is only for static data.
|
---|
27 | *
|
---|
28 | * Revision 1.3 2003/03/07 18:15:44 tng
|
---|
29 | * Return a reference instead of void for operator=
|
---|
30 | *
|
---|
31 | * Revision 1.2 2002/11/04 15:10:41 tng
|
---|
32 | * C++ Namespace Support.
|
---|
33 | *
|
---|
34 | * Revision 1.1.1.1 2002/02/01 22:22:22 peiyongz
|
---|
35 | * sane_include
|
---|
36 | *
|
---|
37 | * Revision 1.4 2000/03/28 19:43:23 roddey
|
---|
38 | * Fixes for signed/unsigned warnings. New work for two way transcoding
|
---|
39 | * stuff.
|
---|
40 | *
|
---|
41 | * Revision 1.3 2000/03/02 19:55:19 roddey
|
---|
42 | * This checkin includes many changes done while waiting for the
|
---|
43 | * 1.1.0 code to be finished. I can't list them all here, but a list is
|
---|
44 | * available elsewhere.
|
---|
45 | *
|
---|
46 | * Revision 1.2 2000/02/06 07:48:24 rahulj
|
---|
47 | * Year 2K copyright swat.
|
---|
48 | *
|
---|
49 | * Revision 1.1.1.1 1999/11/09 01:07:15 twl
|
---|
50 | * Initial checkin
|
---|
51 | *
|
---|
52 | * Revision 1.3 1999/11/08 20:45:28 rahul
|
---|
53 | * Swat for adding in Product name and CVS comment log variable.
|
---|
54 | *
|
---|
55 | */
|
---|
56 |
|
---|
57 |
|
---|
58 | #if !defined(WIN32MSGLOADER_HPP)
|
---|
59 | #define WIN32MSGLOADER_HPP
|
---|
60 |
|
---|
61 | #include <xercesc/util/XercesDefs.hpp>
|
---|
62 | #include <xercesc/util/XMLMsgLoader.hpp>
|
---|
63 |
|
---|
64 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
65 |
|
---|
66 | //
|
---|
67 | // This is a simple in Win32 RC message loader implementation.
|
---|
68 | //
|
---|
69 | class XMLUTIL_EXPORT Win32MsgLoader : public XMLMsgLoader
|
---|
70 | {
|
---|
71 | public :
|
---|
72 | // -----------------------------------------------------------------------
|
---|
73 | // Public Constructors and Destructor
|
---|
74 | // -----------------------------------------------------------------------
|
---|
75 | Win32MsgLoader(const XMLCh* const msgDomain);
|
---|
76 | ~Win32MsgLoader();
|
---|
77 |
|
---|
78 |
|
---|
79 | // -----------------------------------------------------------------------
|
---|
80 | // Implementation of the virtual message loader API
|
---|
81 | // -----------------------------------------------------------------------
|
---|
82 | virtual bool loadMsg
|
---|
83 | (
|
---|
84 | const XMLMsgLoader::XMLMsgId msgToLoad
|
---|
85 | , XMLCh* const toFill
|
---|
86 | , const unsigned int maxChars
|
---|
87 | );
|
---|
88 |
|
---|
89 | virtual bool loadMsg
|
---|
90 | (
|
---|
91 | const XMLMsgLoader::XMLMsgId msgToLoad
|
---|
92 | , XMLCh* const toFill
|
---|
93 | , const unsigned int maxChars
|
---|
94 | , const XMLCh* const repText1
|
---|
95 | , const XMLCh* const repText2 = 0
|
---|
96 | , const XMLCh* const repText3 = 0
|
---|
97 | , const XMLCh* const repText4 = 0
|
---|
98 | , MemoryManager* const manger = XMLPlatformUtils::fgMemoryManager
|
---|
99 | );
|
---|
100 |
|
---|
101 | virtual bool loadMsg
|
---|
102 | (
|
---|
103 | const XMLMsgLoader::XMLMsgId msgToLoad
|
---|
104 | , XMLCh* const toFill
|
---|
105 | , const unsigned int maxChars
|
---|
106 | , const char* const repText1
|
---|
107 | , const char* const repText2 = 0
|
---|
108 | , const char* const repText3 = 0
|
---|
109 | , const char* const repText4 = 0
|
---|
110 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
|
---|
111 | );
|
---|
112 |
|
---|
113 |
|
---|
114 | private :
|
---|
115 | // -----------------------------------------------------------------------
|
---|
116 | // Unimplemented constructors and operators
|
---|
117 | // -----------------------------------------------------------------------
|
---|
118 | Win32MsgLoader();
|
---|
119 | Win32MsgLoader(const Win32MsgLoader&);
|
---|
120 | Win32MsgLoader& operator=(const Win32MsgLoader&);
|
---|
121 |
|
---|
122 |
|
---|
123 | // -----------------------------------------------------------------------
|
---|
124 | // Private data members
|
---|
125 | //
|
---|
126 | // fDomainOfs
|
---|
127 | // This is the id offset for the current domain. Its used to bias
|
---|
128 | // the zero based id of each domain, since they are stored in the
|
---|
129 | // same file and have to have unique ids internally. This is set
|
---|
130 | // in the ctor from the domain name. We just have to agree with
|
---|
131 | // what our formatter in the NLSXlat program does.
|
---|
132 | //
|
---|
133 | // fModHandle
|
---|
134 | // This is our DLL module handle that we need in order to load
|
---|
135 | // resource messages. This is set during construction.
|
---|
136 | //
|
---|
137 | // fMsgDomain
|
---|
138 | // This is the name of the error domain that this loader is for.
|
---|
139 | // -----------------------------------------------------------------------
|
---|
140 | unsigned int fDomainOfs;
|
---|
141 | HINSTANCE fModHandle;
|
---|
142 | XMLCh* fMsgDomain;
|
---|
143 | };
|
---|
144 |
|
---|
145 | XERCES_CPP_NAMESPACE_END
|
---|
146 |
|
---|
147 | #endif
|
---|