sl@0
|
1 |
/*
|
sl@0
|
2 |
******************************************************************************
|
sl@0
|
3 |
*
|
sl@0
|
4 |
* Copyright (C) 1996-2005, International Business Machines Corporation
|
sl@0
|
5 |
* and others. All Rights Reserved.
|
sl@0
|
6 |
*
|
sl@0
|
7 |
******************************************************************************
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* File resbund.h
|
sl@0
|
10 |
*
|
sl@0
|
11 |
* CREATED BY
|
sl@0
|
12 |
* Richard Gillam
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Modification History:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
* Date Name Description
|
sl@0
|
17 |
* 2/5/97 aliu Added scanForLocaleInFile. Added
|
sl@0
|
18 |
* constructor which attempts to read resource bundle
|
sl@0
|
19 |
* from a specific file, without searching other files.
|
sl@0
|
20 |
* 2/11/97 aliu Added UErrorCode return values to constructors. Fixed
|
sl@0
|
21 |
* infinite loops in scanForFile and scanForLocale.
|
sl@0
|
22 |
* Modified getRawResourceData to not delete storage
|
sl@0
|
23 |
* in localeData and resourceData which it doesn't own.
|
sl@0
|
24 |
* Added Mac compatibility #ifdefs for tellp() and
|
sl@0
|
25 |
* ios::nocreate.
|
sl@0
|
26 |
* 2/18/97 helena Updated with 100% documentation coverage.
|
sl@0
|
27 |
* 3/13/97 aliu Rewrote to load in entire resource bundle and store
|
sl@0
|
28 |
* it as a Hashtable of ResourceBundleData objects.
|
sl@0
|
29 |
* Added state table to govern parsing of files.
|
sl@0
|
30 |
* Modified to load locale index out of new file
|
sl@0
|
31 |
* distinct from default.txt.
|
sl@0
|
32 |
* 3/25/97 aliu Modified to support 2-d arrays, needed for timezone
|
sl@0
|
33 |
* data. Added support for custom file suffixes. Again,
|
sl@0
|
34 |
* needed to support timezone data.
|
sl@0
|
35 |
* 4/7/97 aliu Cleaned up.
|
sl@0
|
36 |
* 03/02/99 stephen Removed dependency on FILE*.
|
sl@0
|
37 |
* 03/29/99 helena Merged Bertrand and Stephen's changes.
|
sl@0
|
38 |
* 06/11/99 stephen Removed parsing of .txt files.
|
sl@0
|
39 |
* Reworked to use new binary format.
|
sl@0
|
40 |
* Cleaned up.
|
sl@0
|
41 |
* 06/14/99 stephen Removed methods taking a filename suffix.
|
sl@0
|
42 |
* 11/09/99 weiv Added getLocale(), fRealLocale, removed fRealLocaleID
|
sl@0
|
43 |
******************************************************************************
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
|
sl@0
|
46 |
#ifndef RESBUND_H
|
sl@0
|
47 |
#define RESBUND_H
|
sl@0
|
48 |
|
sl@0
|
49 |
#include "unicode/utypes.h"
|
sl@0
|
50 |
#include "unicode/uobject.h"
|
sl@0
|
51 |
#include "unicode/ures.h"
|
sl@0
|
52 |
#include "unicode/unistr.h"
|
sl@0
|
53 |
#include "unicode/locid.h"
|
sl@0
|
54 |
|
sl@0
|
55 |
/**
|
sl@0
|
56 |
* \file
|
sl@0
|
57 |
* \brief C++ API: Resource Bundle
|
sl@0
|
58 |
*/
|
sl@0
|
59 |
|
sl@0
|
60 |
U_NAMESPACE_BEGIN
|
sl@0
|
61 |
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
* A class representing a collection of resource information pertaining to a given
|
sl@0
|
64 |
* locale. A resource bundle provides a way of accessing locale- specfic information in
|
sl@0
|
65 |
* a data file. You create a resource bundle that manages the resources for a given
|
sl@0
|
66 |
* locale and then ask it for individual resources.
|
sl@0
|
67 |
* <P>
|
sl@0
|
68 |
* Resource bundles in ICU4C are currently defined using text files which conform to the following
|
sl@0
|
69 |
* <a href="http://dev.icu-project.org/cgi-bin/viewcvs.cgi/~checkout~/icuhtml/design/bnf_rb.txt">BNF definition</a>.
|
sl@0
|
70 |
* More on resource bundle concepts and syntax can be found in the
|
sl@0
|
71 |
* <a href="http://icu.sourceforge.net/userguide/ResourceManagement.html">Users Guide</a>.
|
sl@0
|
72 |
* <P>
|
sl@0
|
73 |
*
|
sl@0
|
74 |
* The ResourceBundle class is not suitable for subclassing.
|
sl@0
|
75 |
*
|
sl@0
|
76 |
* @stable ICU 2.0
|
sl@0
|
77 |
*/
|
sl@0
|
78 |
class U_COMMON_API ResourceBundle : public UObject {
|
sl@0
|
79 |
public:
|
sl@0
|
80 |
/**
|
sl@0
|
81 |
* Constructor
|
sl@0
|
82 |
*
|
sl@0
|
83 |
* @param packageName The packageName and locale together point to an ICU udata object,
|
sl@0
|
84 |
* as defined by <code> udata_open( packageName, "res", locale, err) </code>
|
sl@0
|
85 |
* or equivalent. Typically, packageName will refer to a (.dat) file, or to
|
sl@0
|
86 |
* a package registered with udata_setAppData(). Using a full file or directory
|
sl@0
|
87 |
* pathname for packageName is deprecated.
|
sl@0
|
88 |
* @param locale This is the locale this resource bundle is for. To get resources
|
sl@0
|
89 |
* for the French locale, for example, you would create a
|
sl@0
|
90 |
* ResourceBundle passing Locale::FRENCH for the "locale" parameter,
|
sl@0
|
91 |
* and all subsequent calls to that resource bundle will return
|
sl@0
|
92 |
* resources that pertain to the French locale. If the caller doesn't
|
sl@0
|
93 |
* pass a locale parameter, the default locale for the system (as
|
sl@0
|
94 |
* returned by Locale::getDefault()) will be used.
|
sl@0
|
95 |
* @param err The Error Code.
|
sl@0
|
96 |
* The UErrorCode& err parameter is used to return status information to the user. To
|
sl@0
|
97 |
* check whether the construction succeeded or not, you should check the value of
|
sl@0
|
98 |
* U_SUCCESS(err). If you wish more detailed information, you can check for
|
sl@0
|
99 |
* informational error results which still indicate success. U_USING_FALLBACK_WARNING
|
sl@0
|
100 |
* indicates that a fall back locale was used. For example, 'de_CH' was requested,
|
sl@0
|
101 |
* but nothing was found there, so 'de' was used. U_USING_DEFAULT_WARNING indicates that
|
sl@0
|
102 |
* the default locale data was used; neither the requested locale nor any of its
|
sl@0
|
103 |
* fall back locales could be found.
|
sl@0
|
104 |
* @stable ICU 2.0
|
sl@0
|
105 |
*/
|
sl@0
|
106 |
ResourceBundle(const UnicodeString& packageName,
|
sl@0
|
107 |
const Locale& locale,
|
sl@0
|
108 |
UErrorCode& err);
|
sl@0
|
109 |
|
sl@0
|
110 |
/**
|
sl@0
|
111 |
* Construct a resource bundle for the default bundle in the specified package.
|
sl@0
|
112 |
*
|
sl@0
|
113 |
* @param packageName The packageName and locale together point to an ICU udata object,
|
sl@0
|
114 |
* as defined by <code> udata_open( packageName, "res", locale, err) </code>
|
sl@0
|
115 |
* or equivalent. Typically, packageName will refer to a (.dat) file, or to
|
sl@0
|
116 |
* a package registered with udata_setAppData(). Using a full file or directory
|
sl@0
|
117 |
* pathname for packageName is deprecated.
|
sl@0
|
118 |
* @param err A UErrorCode value
|
sl@0
|
119 |
* @stable ICU 2.0
|
sl@0
|
120 |
*/
|
sl@0
|
121 |
ResourceBundle(const UnicodeString& packageName,
|
sl@0
|
122 |
UErrorCode& err);
|
sl@0
|
123 |
|
sl@0
|
124 |
/**
|
sl@0
|
125 |
* Construct a resource bundle for the ICU default bundle.
|
sl@0
|
126 |
*
|
sl@0
|
127 |
* @param err A UErrorCode value
|
sl@0
|
128 |
* @stable ICU 2.0
|
sl@0
|
129 |
*/
|
sl@0
|
130 |
ResourceBundle(UErrorCode &err);
|
sl@0
|
131 |
|
sl@0
|
132 |
/**
|
sl@0
|
133 |
* Standard constructor, onstructs a resource bundle for the locale-specific
|
sl@0
|
134 |
* bundle in the specified package.
|
sl@0
|
135 |
*
|
sl@0
|
136 |
* @param packageName The packageName and locale together point to an ICU udata object,
|
sl@0
|
137 |
* as defined by <code> udata_open( packageName, "res", locale, err) </code>
|
sl@0
|
138 |
* or equivalent. Typically, packageName will refer to a (.dat) file, or to
|
sl@0
|
139 |
* a package registered with udata_setAppData(). Using a full file or directory
|
sl@0
|
140 |
* pathname for packageName is deprecated.
|
sl@0
|
141 |
* NULL is used to refer to ICU data.
|
sl@0
|
142 |
* @param locale The locale for which to open a resource bundle.
|
sl@0
|
143 |
* @param err A UErrorCode value
|
sl@0
|
144 |
* @stable ICU 2.0
|
sl@0
|
145 |
*/
|
sl@0
|
146 |
ResourceBundle(const char* packageName,
|
sl@0
|
147 |
const Locale& locale,
|
sl@0
|
148 |
UErrorCode& err);
|
sl@0
|
149 |
|
sl@0
|
150 |
/**
|
sl@0
|
151 |
* Copy constructor.
|
sl@0
|
152 |
*
|
sl@0
|
153 |
* @param original The resource bundle to copy.
|
sl@0
|
154 |
* @stable ICU 2.0
|
sl@0
|
155 |
*/
|
sl@0
|
156 |
ResourceBundle(const ResourceBundle &original);
|
sl@0
|
157 |
|
sl@0
|
158 |
/**
|
sl@0
|
159 |
* Constructor from a C UResourceBundle. The resource bundle is
|
sl@0
|
160 |
* copied and not adopted. ures_close will still need to be used on the
|
sl@0
|
161 |
* original resource bundle.
|
sl@0
|
162 |
*
|
sl@0
|
163 |
* @param res A pointer to the C resource bundle.
|
sl@0
|
164 |
* @param status A UErrorCode value.
|
sl@0
|
165 |
* @stable ICU 2.0
|
sl@0
|
166 |
*/
|
sl@0
|
167 |
ResourceBundle(UResourceBundle *res,
|
sl@0
|
168 |
UErrorCode &status);
|
sl@0
|
169 |
|
sl@0
|
170 |
/**
|
sl@0
|
171 |
* Assignment operator.
|
sl@0
|
172 |
*
|
sl@0
|
173 |
* @param other The resource bundle to copy.
|
sl@0
|
174 |
* @stable ICU 2.0
|
sl@0
|
175 |
*/
|
sl@0
|
176 |
ResourceBundle&
|
sl@0
|
177 |
operator=(const ResourceBundle& other);
|
sl@0
|
178 |
|
sl@0
|
179 |
/** Destructor.
|
sl@0
|
180 |
* @stable ICU 2.0
|
sl@0
|
181 |
*/
|
sl@0
|
182 |
virtual ~ResourceBundle();
|
sl@0
|
183 |
|
sl@0
|
184 |
/**
|
sl@0
|
185 |
* Clone this object.
|
sl@0
|
186 |
* Clones can be used concurrently in multiple threads.
|
sl@0
|
187 |
* If an error occurs, then NULL is returned.
|
sl@0
|
188 |
* The caller must delete the clone.
|
sl@0
|
189 |
*
|
sl@0
|
190 |
* @return a clone of this object
|
sl@0
|
191 |
*
|
sl@0
|
192 |
* @see getDynamicClassID
|
sl@0
|
193 |
* @stable ICU 2.8
|
sl@0
|
194 |
*/
|
sl@0
|
195 |
ResourceBundle *clone() const;
|
sl@0
|
196 |
|
sl@0
|
197 |
/**
|
sl@0
|
198 |
* Returns the size of a resource. Size for scalar types is always 1, and for vector/table types is
|
sl@0
|
199 |
* the number of child resources.
|
sl@0
|
200 |
* @warning Integer array is treated as a scalar type. There are no
|
sl@0
|
201 |
* APIs to access individual members of an integer array. It
|
sl@0
|
202 |
* is always returned as a whole.
|
sl@0
|
203 |
*
|
sl@0
|
204 |
* @return number of resources in a given resource.
|
sl@0
|
205 |
* @stable ICU 2.0
|
sl@0
|
206 |
*/
|
sl@0
|
207 |
int32_t
|
sl@0
|
208 |
getSize(void) const;
|
sl@0
|
209 |
|
sl@0
|
210 |
/**
|
sl@0
|
211 |
* returns a string from a string resource type
|
sl@0
|
212 |
*
|
sl@0
|
213 |
* @param status fills in the outgoing error code
|
sl@0
|
214 |
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
|
sl@0
|
215 |
* could be a warning
|
sl@0
|
216 |
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
|
sl@0
|
217 |
* @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
|
sl@0
|
218 |
* @stable ICU 2.0
|
sl@0
|
219 |
*/
|
sl@0
|
220 |
UnicodeString
|
sl@0
|
221 |
getString(UErrorCode& status) const;
|
sl@0
|
222 |
|
sl@0
|
223 |
/**
|
sl@0
|
224 |
* returns a binary data from a resource. Can be used at most primitive resource types (binaries,
|
sl@0
|
225 |
* strings, ints)
|
sl@0
|
226 |
*
|
sl@0
|
227 |
* @param len fills in the length of resulting byte chunk
|
sl@0
|
228 |
* @param status fills in the outgoing error code
|
sl@0
|
229 |
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
|
sl@0
|
230 |
* could be a warning
|
sl@0
|
231 |
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
|
sl@0
|
232 |
* @return a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.
|
sl@0
|
233 |
* @stable ICU 2.0
|
sl@0
|
234 |
*/
|
sl@0
|
235 |
const uint8_t*
|
sl@0
|
236 |
getBinary(int32_t& len, UErrorCode& status) const;
|
sl@0
|
237 |
|
sl@0
|
238 |
|
sl@0
|
239 |
/**
|
sl@0
|
240 |
* returns an integer vector from a resource.
|
sl@0
|
241 |
*
|
sl@0
|
242 |
* @param len fills in the length of resulting integer vector
|
sl@0
|
243 |
* @param status fills in the outgoing error code
|
sl@0
|
244 |
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
|
sl@0
|
245 |
* could be a warning
|
sl@0
|
246 |
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
|
sl@0
|
247 |
* @return a pointer to a vector of integers that lives in a memory mapped/DLL file.
|
sl@0
|
248 |
* @stable ICU 2.0
|
sl@0
|
249 |
*/
|
sl@0
|
250 |
const int32_t*
|
sl@0
|
251 |
getIntVector(int32_t& len, UErrorCode& status) const;
|
sl@0
|
252 |
|
sl@0
|
253 |
/**
|
sl@0
|
254 |
* returns an unsigned integer from a resource.
|
sl@0
|
255 |
* This integer is originally 28 bits.
|
sl@0
|
256 |
*
|
sl@0
|
257 |
* @param status fills in the outgoing error code
|
sl@0
|
258 |
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
|
sl@0
|
259 |
* could be a warning
|
sl@0
|
260 |
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
|
sl@0
|
261 |
* @return an unsigned integer value
|
sl@0
|
262 |
* @stable ICU 2.0
|
sl@0
|
263 |
*/
|
sl@0
|
264 |
uint32_t
|
sl@0
|
265 |
getUInt(UErrorCode& status) const;
|
sl@0
|
266 |
|
sl@0
|
267 |
/**
|
sl@0
|
268 |
* returns a signed integer from a resource.
|
sl@0
|
269 |
* This integer is originally 28 bit and the sign gets propagated.
|
sl@0
|
270 |
*
|
sl@0
|
271 |
* @param status fills in the outgoing error code
|
sl@0
|
272 |
* could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
|
sl@0
|
273 |
* could be a warning
|
sl@0
|
274 |
* e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
|
sl@0
|
275 |
* @return a signed integer value
|
sl@0
|
276 |
* @stable ICU 2.0
|
sl@0
|
277 |
*/
|
sl@0
|
278 |
int32_t
|
sl@0
|
279 |
getInt(UErrorCode& status) const;
|
sl@0
|
280 |
|
sl@0
|
281 |
/**
|
sl@0
|
282 |
* Checks whether the resource has another element to iterate over.
|
sl@0
|
283 |
*
|
sl@0
|
284 |
* @return TRUE if there are more elements, FALSE if there is no more elements
|
sl@0
|
285 |
* @stable ICU 2.0
|
sl@0
|
286 |
*/
|
sl@0
|
287 |
UBool
|
sl@0
|
288 |
hasNext(void) const;
|
sl@0
|
289 |
|
sl@0
|
290 |
/**
|
sl@0
|
291 |
* Resets the internal context of a resource so that iteration starts from the first element.
|
sl@0
|
292 |
*
|
sl@0
|
293 |
* @stable ICU 2.0
|
sl@0
|
294 |
*/
|
sl@0
|
295 |
void
|
sl@0
|
296 |
resetIterator(void);
|
sl@0
|
297 |
|
sl@0
|
298 |
/**
|
sl@0
|
299 |
* Returns the key associated with this resource. Not all the resources have a key - only
|
sl@0
|
300 |
* those that are members of a table.
|
sl@0
|
301 |
*
|
sl@0
|
302 |
* @return a key associated to this resource, or NULL if it doesn't have a key
|
sl@0
|
303 |
* @stable ICU 2.0
|
sl@0
|
304 |
*/
|
sl@0
|
305 |
const char*
|
sl@0
|
306 |
getKey(void) const;
|
sl@0
|
307 |
|
sl@0
|
308 |
/**
|
sl@0
|
309 |
* Gets the locale ID of the resource bundle as a string.
|
sl@0
|
310 |
* Same as getLocale().getName() .
|
sl@0
|
311 |
*
|
sl@0
|
312 |
* @return the locale ID of the resource bundle as a string
|
sl@0
|
313 |
* @stable ICU 2.0
|
sl@0
|
314 |
*/
|
sl@0
|
315 |
const char*
|
sl@0
|
316 |
getName(void) const;
|
sl@0
|
317 |
|
sl@0
|
318 |
|
sl@0
|
319 |
/**
|
sl@0
|
320 |
* Returns the type of a resource. Available types are defined in enum UResType
|
sl@0
|
321 |
*
|
sl@0
|
322 |
* @return type of the given resource.
|
sl@0
|
323 |
* @stable ICU 2.0
|
sl@0
|
324 |
*/
|
sl@0
|
325 |
UResType
|
sl@0
|
326 |
getType(void) const;
|
sl@0
|
327 |
|
sl@0
|
328 |
/**
|
sl@0
|
329 |
* Returns the next resource in a given resource or NULL if there are no more resources
|
sl@0
|
330 |
*
|
sl@0
|
331 |
* @param status fills in the outgoing error code
|
sl@0
|
332 |
* @return ResourceBundle object.
|
sl@0
|
333 |
* @stable ICU 2.0
|
sl@0
|
334 |
*/
|
sl@0
|
335 |
ResourceBundle
|
sl@0
|
336 |
getNext(UErrorCode& status);
|
sl@0
|
337 |
|
sl@0
|
338 |
/**
|
sl@0
|
339 |
* Returns the next string in a resource or NULL if there are no more resources
|
sl@0
|
340 |
* to iterate over.
|
sl@0
|
341 |
*
|
sl@0
|
342 |
* @param status fills in the outgoing error code
|
sl@0
|
343 |
* @return an UnicodeString object.
|
sl@0
|
344 |
* @stable ICU 2.0
|
sl@0
|
345 |
*/
|
sl@0
|
346 |
UnicodeString
|
sl@0
|
347 |
getNextString(UErrorCode& status);
|
sl@0
|
348 |
|
sl@0
|
349 |
/**
|
sl@0
|
350 |
* Returns the next string in a resource or NULL if there are no more resources
|
sl@0
|
351 |
* to iterate over.
|
sl@0
|
352 |
*
|
sl@0
|
353 |
* @param key fill in for key associated with this string
|
sl@0
|
354 |
* @param status fills in the outgoing error code
|
sl@0
|
355 |
* @return an UnicodeString object.
|
sl@0
|
356 |
* @stable ICU 2.0
|
sl@0
|
357 |
*/
|
sl@0
|
358 |
UnicodeString
|
sl@0
|
359 |
getNextString(const char ** key,
|
sl@0
|
360 |
UErrorCode& status);
|
sl@0
|
361 |
|
sl@0
|
362 |
/**
|
sl@0
|
363 |
* Returns the resource in a resource at the specified index.
|
sl@0
|
364 |
*
|
sl@0
|
365 |
* @param index an index to the wanted resource.
|
sl@0
|
366 |
* @param status fills in the outgoing error code
|
sl@0
|
367 |
* @return ResourceBundle object. If there is an error, resource is invalid.
|
sl@0
|
368 |
* @stable ICU 2.0
|
sl@0
|
369 |
*/
|
sl@0
|
370 |
ResourceBundle
|
sl@0
|
371 |
get(int32_t index,
|
sl@0
|
372 |
UErrorCode& status) const;
|
sl@0
|
373 |
|
sl@0
|
374 |
/**
|
sl@0
|
375 |
* Returns the string in a given resource at the specified index.
|
sl@0
|
376 |
*
|
sl@0
|
377 |
* @param index an index to the wanted string.
|
sl@0
|
378 |
* @param status fills in the outgoing error code
|
sl@0
|
379 |
* @return an UnicodeString object. If there is an error, string is bogus
|
sl@0
|
380 |
* @stable ICU 2.0
|
sl@0
|
381 |
*/
|
sl@0
|
382 |
UnicodeString
|
sl@0
|
383 |
getStringEx(int32_t index,
|
sl@0
|
384 |
UErrorCode& status) const;
|
sl@0
|
385 |
|
sl@0
|
386 |
/**
|
sl@0
|
387 |
* Returns a resource in a resource that has a given key. This procedure works only with table
|
sl@0
|
388 |
* resources.
|
sl@0
|
389 |
*
|
sl@0
|
390 |
* @param key a key associated with the wanted resource
|
sl@0
|
391 |
* @param status fills in the outgoing error code.
|
sl@0
|
392 |
* @return ResourceBundle object. If there is an error, resource is invalid.
|
sl@0
|
393 |
* @stable ICU 2.0
|
sl@0
|
394 |
*/
|
sl@0
|
395 |
ResourceBundle
|
sl@0
|
396 |
get(const char* key,
|
sl@0
|
397 |
UErrorCode& status) const;
|
sl@0
|
398 |
|
sl@0
|
399 |
/**
|
sl@0
|
400 |
* Returns a string in a resource that has a given key. This procedure works only with table
|
sl@0
|
401 |
* resources.
|
sl@0
|
402 |
*
|
sl@0
|
403 |
* @param key a key associated with the wanted string
|
sl@0
|
404 |
* @param status fills in the outgoing error code
|
sl@0
|
405 |
* @return an UnicodeString object. If there is an error, string is bogus
|
sl@0
|
406 |
* @stable ICU 2.0
|
sl@0
|
407 |
*/
|
sl@0
|
408 |
UnicodeString
|
sl@0
|
409 |
getStringEx(const char* key,
|
sl@0
|
410 |
UErrorCode& status) const;
|
sl@0
|
411 |
|
sl@0
|
412 |
/**
|
sl@0
|
413 |
* Return the version number associated with this ResourceBundle as a string. Please
|
sl@0
|
414 |
* use getVersion, as this method is going to be deprecated.
|
sl@0
|
415 |
*
|
sl@0
|
416 |
* @return A version number string as specified in the resource bundle or its parent.
|
sl@0
|
417 |
* The caller does not own this string.
|
sl@0
|
418 |
* @see getVersion
|
sl@0
|
419 |
* @deprecated ICU 2.8 Use getVersion instead.
|
sl@0
|
420 |
*/
|
sl@0
|
421 |
const char*
|
sl@0
|
422 |
getVersionNumber(void) const;
|
sl@0
|
423 |
|
sl@0
|
424 |
/**
|
sl@0
|
425 |
* Return the version number associated with this ResourceBundle as a UVersionInfo array.
|
sl@0
|
426 |
*
|
sl@0
|
427 |
* @param versionInfo A UVersionInfo array that is filled with the version number
|
sl@0
|
428 |
* as specified in the resource bundle or its parent.
|
sl@0
|
429 |
* @stable ICU 2.0
|
sl@0
|
430 |
*/
|
sl@0
|
431 |
void
|
sl@0
|
432 |
getVersion(UVersionInfo versionInfo) const;
|
sl@0
|
433 |
|
sl@0
|
434 |
/**
|
sl@0
|
435 |
* Return the Locale associated with this ResourceBundle.
|
sl@0
|
436 |
*
|
sl@0
|
437 |
* @return a Locale object
|
sl@0
|
438 |
* @deprecated ICU 2.8 Use getLocale(ULocDataLocaleType type, UErrorCode &status) overload instead.
|
sl@0
|
439 |
*/
|
sl@0
|
440 |
const Locale&
|
sl@0
|
441 |
getLocale(void) const;
|
sl@0
|
442 |
|
sl@0
|
443 |
/**
|
sl@0
|
444 |
* Return the Locale associated with this ResourceBundle.
|
sl@0
|
445 |
* @param type You can choose between requested, valid and actual
|
sl@0
|
446 |
* locale. For description see the definition of
|
sl@0
|
447 |
* ULocDataLocaleType in uloc.h
|
sl@0
|
448 |
* @param status just for catching illegal arguments
|
sl@0
|
449 |
*
|
sl@0
|
450 |
* @return a Locale object
|
sl@0
|
451 |
* @stable ICU 2.8
|
sl@0
|
452 |
*/
|
sl@0
|
453 |
const Locale
|
sl@0
|
454 |
getLocale(ULocDataLocaleType type, UErrorCode &status) const;
|
sl@0
|
455 |
/**
|
sl@0
|
456 |
* This API implements multilevel fallback
|
sl@0
|
457 |
* @internal
|
sl@0
|
458 |
*/
|
sl@0
|
459 |
ResourceBundle
|
sl@0
|
460 |
getWithFallback(const char* key, UErrorCode& status);
|
sl@0
|
461 |
/**
|
sl@0
|
462 |
* ICU "poor man's RTTI", returns a UClassID for the actual class.
|
sl@0
|
463 |
*
|
sl@0
|
464 |
* @stable ICU 2.2
|
sl@0
|
465 |
*/
|
sl@0
|
466 |
virtual UClassID getDynamicClassID() const;
|
sl@0
|
467 |
|
sl@0
|
468 |
/**
|
sl@0
|
469 |
* ICU "poor man's RTTI", returns a UClassID for this class.
|
sl@0
|
470 |
*
|
sl@0
|
471 |
* @stable ICU 2.2
|
sl@0
|
472 |
*/
|
sl@0
|
473 |
static UClassID U_EXPORT2 getStaticClassID();
|
sl@0
|
474 |
|
sl@0
|
475 |
private:
|
sl@0
|
476 |
ResourceBundle(); // default constructor not implemented
|
sl@0
|
477 |
|
sl@0
|
478 |
UResourceBundle *fResource;
|
sl@0
|
479 |
void constructForLocale(const UnicodeString& path, const Locale& locale, UErrorCode& error);
|
sl@0
|
480 |
Locale *fLocale;
|
sl@0
|
481 |
|
sl@0
|
482 |
};
|
sl@0
|
483 |
|
sl@0
|
484 |
U_NAMESPACE_END
|
sl@0
|
485 |
#endif
|