1b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
2b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru**********************************************************************
3fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius*   Copyright (C) 1997-2012,2014, International Business Machines
4b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   Corporation and others.  All Rights Reserved.
5b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru**********************************************************************
6b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
7b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* File URES.H (formerly CRESBUND.H)
8b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
9b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru* Modification History:
10b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*
11b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   Date        Name        Description
12b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/01/97    aliu        Creation.
13b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   02/22/99    damiba      overhaul.
14b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/04/99    helena      Fixed internal header inclusion.
15b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   04/15/99    Madhu       Updated Javadoc
16b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   06/14/99    stephen     Removed functions taking a filename suffix.
17b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   07/20/99    stephen     Language-independent ypedef to void*
18b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   11/09/99    weiv        Added ures_getLocale()
19b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*   06/24/02    weiv        Added support for resource sharing
20b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru******************************************************************************
21b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/
22b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
23b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef URES_H
24b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#define URES_H
25b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
26b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/utypes.h"
27b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/uloc.h"
2850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#include "unicode/localpointer.h"
29b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
30b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
31b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \file
32b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * \brief C API: Resource Bundle
33b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
34b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <h2>C API: Resource Bundle</h2>
35b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
36b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * C API representing a collection of resource information pertaining to a given
37b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * locale. A resource bundle provides a way of accessing locale- specific information in
38b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * a data file. You create a resource bundle that manages the resources for a given
39b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * locale and then ask it for individual resources.
40b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <P>
41b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Resource bundles in ICU4C are currently defined using text files which conform to the following
42b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <a href="http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt">BNF definition</a>.
43b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * More on resource bundle concepts and syntax can be found in the
44b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <a href="http://icu-project.org/userguide/ResourceManagement.html">Users Guide</a>.
45b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * <P>
46b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
47b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
48b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
49b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UResourceBundle is an opaque type for handles for resource bundles in C APIs.
50b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
51b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
52b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querustruct UResourceBundle;
53b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
54b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
55b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
56b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
57b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef struct UResourceBundle UResourceBundle;
58b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
59b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
60b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Numeric constants for types of resource items.
61b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getType
62b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
63b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
64b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Querutypedef enum {
65b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** Resource type constant for "no resource". @stable ICU 2.6 */
66b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_NONE=-1,
67b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
68b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** Resource type constant for 16-bit Unicode strings. @stable ICU 2.6 */
69b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_STRING=0,
70b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
71b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** Resource type constant for binary data. @stable ICU 2.6 */
72b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_BINARY=1,
73b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
74b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** Resource type constant for tables of key-value pairs. @stable ICU 2.6 */
75b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_TABLE=2,
76b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
77b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
78b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Resource type constant for aliases;
79b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * internally stores a string which identifies the actual resource
80b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * storing the data (can be in a different resource bundle).
81b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Resolved internally before delivering the actual resource through the API.
82b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.6
83b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
84b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_ALIAS=3,
85b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
86b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
87b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Resource type constant for a single 28-bit integer, interpreted as
88b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * signed or unsigned by the ures_getInt() or ures_getUInt() function.
89b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see ures_getInt
90b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see ures_getUInt
91b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.6
92b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
93b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_INT=7,
94b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
95b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** Resource type constant for arrays of resources. @stable ICU 2.6 */
96b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_ARRAY=8,
97b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
98b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /**
99b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * Resource type constant for vectors of 32-bit integers.
100b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @see ures_getIntVector
101b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     * @stable ICU 2.6
102b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru     */
103b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_INT_VECTOR = 14,
104b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#ifndef U_HIDE_DEPRECATED_API
105b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
106b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_NONE=URES_NONE,
107b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
108b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_STRING=URES_STRING,
109b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
110b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_BINARY=URES_BINARY,
111b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
112b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_TABLE=URES_TABLE,
113b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
114b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_ALIAS=URES_ALIAS,
115b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
116b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_INT=URES_INT,
117b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
118b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_ARRAY=URES_ARRAY,
119b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Use the URES_ constant instead. */
120b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_INT_VECTOR=URES_INT_VECTOR,
121b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    /** @deprecated ICU 2.6 Not used. */
122b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    RES_RESERVED=15,
123b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /* U_HIDE_DEPRECATED_API */
124b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
125b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    URES_LIMIT = 16
126b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru} UResType;
127b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
128b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*
129b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Functions to create and destroy resource bundles.
130b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
131b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
132b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
133b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Opens a UResourceBundle, from which users can extract strings by using
134b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * their corresponding keys.
135b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Note that the caller is responsible of calling <TT>ures_close</TT> on each succesfully
136b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * opened resource bundle.
137b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param packageName   The packageName and locale together point to an ICU udata object,
138b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      as defined by <code> udata_open( packageName, "res", locale, err) </code>
139b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      or equivalent.  Typically, packageName will refer to a (.dat) file, or to
140b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      a package registered with udata_setAppData(). Using a full file or directory
141b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      pathname for packageName is deprecated. If NULL, ICU data will be used.
142b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale  specifies the locale for which we want to open the resource
143b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                if NULL, the default locale will be used. If strlen(locale) == 0
144b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                root locale will be used.
145b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
146b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status  fills in the outgoing error code.
147b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The UErrorCode err parameter is used to return status information to the user. To
148b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * check whether the construction succeeded or not, you should check the value of
149b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U_SUCCESS(err). If you wish more detailed information, you can check for
150b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * informational status results which still indicate success. U_USING_FALLBACK_WARNING
151b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * indicates that a fall back locale was used. For example, 'de_CH' was requested,
152b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * but nothing was found there, so 'de' was used. U_USING_DEFAULT_WARNING indicates that
153b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the default locale data or root locale data was used; neither the requested locale
154b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * nor any of its fall back locales could be found. Please see the users guide for more
155b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * information on this topic.
156b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return      a newly allocated resource bundle.
157b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_close
158b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
159b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
160b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle*  U_EXPORT2
161b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_open(const char*    packageName,
162b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru          const char*  locale,
163b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru          UErrorCode*     status);
164b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
165b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
166b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/** This function does not care what kind of localeID is passed in. It simply opens a bundle with
167b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *  that name. Fallback mechanism is disabled for the new bundle. If the requested bundle contains
168b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *  an %%ALIAS directive, the results are undefined.
169b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param packageName   The packageName and locale together point to an ICU udata object,
170b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      as defined by <code> udata_open( packageName, "res", locale, err) </code>
171b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      or equivalent.  Typically, packageName will refer to a (.dat) file, or to
172b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      a package registered with udata_setAppData(). Using a full file or directory
173b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      pathname for packageName is deprecated. If NULL, ICU data will be used.
174b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale  specifies the locale for which we want to open the resource
175b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                if NULL, the default locale will be used. If strlen(locale) == 0
176b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                root locale will be used.
177b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
178b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status fills in the outgoing error code. Either U_ZERO_ERROR or U_MISSING_RESOURCE_ERROR
179b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return      a newly allocated resource bundle or NULL if it doesn't exist.
180b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_close
181b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
182b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
183b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle* U_EXPORT2
184b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_openDirect(const char* packageName,
185b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                const char* locale,
186b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                UErrorCode* status);
187b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
188b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
189b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Same as ures_open() but takes a const UChar *path.
190b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This path will be converted to char * using the default converter,
191b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * then ures_open() is called.
192b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
193b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param packageName   The packageName and locale together point to an ICU udata object,
194b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      as defined by <code> udata_open( packageName, "res", locale, err) </code>
195b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      or equivalent.  Typically, packageName will refer to a (.dat) file, or to
196b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      a package registered with udata_setAppData(). Using a full file or directory
197b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      pathname for packageName is deprecated. If NULL, ICU data will be used.
198b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param locale  specifies the locale for which we want to open the resource
199b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                if NULL, the default locale will be used. If strlen(locale) == 0
200b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                root locale will be used.
201b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status  fills in the outgoing error code.
202b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return      a newly allocated resource bundle.
203b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_open
204b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
205b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
206b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle* U_EXPORT2
207b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_openU(const UChar* packageName,
208b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru           const char* locale,
209b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru           UErrorCode* status);
210b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
211103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_DEPRECATED_API
212b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
213b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the number of strings/arrays in resource bundles.
214b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Better to use ures_getSize, as this function will be deprecated.
215b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
216b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *@param resourceBundle resource bundle containing the desired strings
217b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *@param resourceKey key tagging the resource
218b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *@param err fills in the outgoing error code
219b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
220b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
221b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_FALLBACK_WARNING </TT>
222b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *@return: for    <STRONG>Arrays</STRONG>: returns the number of resources in the array
223b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                <STRONG>Tables</STRONG>: returns the number of resources in the table
224b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                <STRONG>single string</STRONG>: returns 1
225b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *@see ures_getSize
226b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @deprecated ICU 2.8 User ures_getSize instead
227b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
228b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_DEPRECATED int32_t U_EXPORT2
229b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_countArrayItems(const UResourceBundle* resourceBundle,
230b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     const char* resourceKey,
231b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     UErrorCode* err);
232103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_DEPRECATED_API */
233fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius
234b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
235b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Close a resource bundle, all pointers returned from the various ures_getXXX calls
236b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * on this particular bundle should be considered invalid henceforth.
237b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
238b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a pointer to a resourceBundle struct. Can be NULL.
239b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_open
240b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
241b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
242b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2
243b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_close(UResourceBundle* resourceBundle);
244b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
24550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#if U_SHOW_CPLUSPLUS_API
24650294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
24750294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_NAMESPACE_BEGIN
24850294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
24950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho/**
25050294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * \class LocalUResourceBundlePointer
25150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * "Smart pointer" class, closes a UResourceBundle via ures_close().
25250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * For most methods see the LocalPointerBase base class.
25350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho *
25450294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @see LocalPointerBase
25550294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @see LocalPointer
25627f654740f2a26ad62a5c155af9199af9e69b889claireho * @stable ICU 4.4
25750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho */
25850294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_DEFINE_LOCAL_OPEN_POINTER(LocalUResourceBundlePointer, UResourceBundle, ures_close);
25950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
26050294ead5e5d23f5bbfed76e00e6b510bd41eee1clairehoU_NAMESPACE_END
26150294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
26250294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#endif
26350294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho
264103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_DEPRECATED_API
265b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
266b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the version number associated with this ResourceBundle as a string. Please
267b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * use ures_getVersion as this function is going to be deprecated.
268b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
269b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle The resource bundle for which the version is checked.
270b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return  A version number string as specified in the resource bundle or its parent.
271b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          The caller does not own this string.
272b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getVersion
273b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @deprecated ICU 2.8 Use ures_getVersion instead.
274b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
275b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_DEPRECATED const char* U_EXPORT2
276b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getVersionNumber(const UResourceBundle*   resourceBundle);
277103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_DEPRECATED_API */
278b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
279b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
280b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the version number associated with this ResourceBundle as an
281b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * UVersionInfo array.
282b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
283b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB The resource bundle for which the version is checked.
284b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param versionInfo A UVersionInfo array that is filled with the version number
285b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                    as specified in the resource bundle or its parent.
286b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
287b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
288b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2
289b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getVersion(const UResourceBundle* resB,
290b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                UVersionInfo versionInfo);
291b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
292103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_DEPRECATED_API
293b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
294b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the name of the Locale associated with this ResourceBundle. This API allows
295b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * you to query for the real locale of the resource. For example, if you requested
296b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * "en_US_CALIFORNIA" and only "en_US" bundle exists, "en_US" will be returned.
297b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * For subresources, the locale where this resource comes from will be returned.
298b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If fallback has occured, getLocale will reflect this.
299b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
300b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle resource bundle in question
301b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status just for catching illegal arguments
302b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return  A Locale name
303b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @deprecated ICU 2.8 Use ures_getLocaleByType instead.
304b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
305b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_DEPRECATED const char* U_EXPORT2
306b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getLocale(const UResourceBundle* resourceBundle,
307b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru               UErrorCode* status);
308103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_DEPRECATED_API */
309b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
310b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
311b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Return the name of the Locale associated with this ResourceBundle.
312b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * You can choose between requested, valid and real locale.
313b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
314b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle resource bundle in question
315b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param type You can choose between requested, valid and actual
316b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *             locale. For description see the definition of
317b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *             ULocDataLocaleType in uloc.h
318b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status just for catching illegal arguments
319b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return  A Locale name
320b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.8
321b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
322b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char* U_EXPORT2
323b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getLocaleByType(const UResourceBundle* resourceBundle,
324b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     ULocDataLocaleType type,
325b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     UErrorCode* status);
326b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
327b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
328103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#ifndef U_HIDE_INTERNAL_API
329b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
330b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Same as ures_open() but uses the fill-in parameter instead of allocating
331b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * a bundle, if r!=NULL.
332b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * TODO need to revisit usefulness of this function
333b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *      and usage model for fillIn parameters without knowing sizeof(UResourceBundle)
334b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param r The resourcebundle to open
335b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param packageName   The packageName and locale together point to an ICU udata object,
336b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      as defined by <code> udata_open( packageName, "res", locale, err) </code>
337b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      or equivalent.  Typically, packageName will refer to a (.dat) file, or to
338b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      a package registered with udata_setAppData(). Using a full file or directory
339b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                      pathname for packageName is deprecated. If NULL, ICU data will be used.
340b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param localeID specifies the locale for which we want to open the resource
341b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status The error code
342b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return a newly allocated resource bundle or NULL if it doesn't exist.
343b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @internal
344b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
345b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_INTERNAL void U_EXPORT2
346b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_openFillIn(UResourceBundle *r,
347b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                const char* packageName,
348b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                const char* localeID,
349b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                UErrorCode* status);
350103e9ffba2cba345d0078eb8b8db33249f81840aCraig Cornelius#endif  /* U_HIDE_INTERNAL_API */
351b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
352b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
353b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a string from a string resource type
354b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
355b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a string resource
356b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len    fills in the length of resulting string
357b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status fills in the outgoing error code
358b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
359b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                Always check the value of status. Don't count on returning NULL.
360b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
361b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
362b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
363b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getBinary
364b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getIntVector
365b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getInt
366b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getUInt
367b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
368b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
369b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const UChar* U_EXPORT2
370b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getString(const UResourceBundle* resourceBundle,
371b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru               int32_t* len,
372b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru               UErrorCode* status);
373b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
374b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
375b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a UTF-8 string from a string resource.
376b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The UTF-8 string may be returnable directly as a pointer, or
377b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
378b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or equivalent.
379b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
380b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==TRUE, then the string is always written to the dest buffer
381b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and dest is returned.
382b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
383b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==FALSE, then the string is returned as a pointer if possible,
384b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * without needing a dest buffer (it can be NULL). If the string needs to be
385b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * copied or transformed, then it may be placed into dest at an arbitrary offset.
386b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
387b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
388b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
389b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
390b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is transformed from UTF-16, then a conversion error may occur
391b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * if an unpaired surrogate is encountered. If the function is successful, then
392b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the output UTF-8 string is always well-formed.
393b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
394b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB Resource bundle.
395b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
396b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param length Input: Capacity of destination buffer.
397b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Output: Actual length of the UTF-8 string, not counting the
398b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
399b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Can be NULL, meaning capacity=0 and the string length is not
400b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               returned to the caller.
401b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param forceCopy If TRUE, then the output string will always be written to
402b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  dest, with U_BUFFER_OVERFLOW_ERROR and
403b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  U_STRING_NOT_TERMINATED_WARNING set if appropriate.
404b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If FALSE, then the dest buffer may or may not contain a
405b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  copy of the string. dest may or may not be modified.
406b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If a copy needs to be written, then the UErrorCode parameter
407b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  indicates overflow etc. as usual.
408b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status Pointer to a standard ICU error code. Its input value must
409b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               pass the U_SUCCESS() test, or else the function returns
410b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               immediately. Check for U_FAILURE() on output or use with
411b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               function chaining. (See User Guide for details.)
412b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The pointer to the UTF-8 string. It may be dest, or at some offset
413b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         from dest (only if !forceCopy), or in unrelated memory.
414b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         Always NUL-terminated unless the string was written to dest and
415b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
416b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
417b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getString
418b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see u_strToUTF8
419b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
420b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
421b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2
422b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUTF8String(const UResourceBundle *resB,
423b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   char *dest, int32_t *length,
424b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   UBool forceCopy,
425b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   UErrorCode *status);
426b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
427b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
428b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a binary data from a binary resource.
429b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
430b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a string resource
431b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len    fills in the length of resulting byte chunk
432b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status fills in the outgoing error code
433b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
434b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                Always check the value of status. Don't count on returning NULL.
435b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
436b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
43750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return a pointer to a chunk of unsigned bytes which live in a memory mapped/DLL file.
438b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getString
439b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getIntVector
440b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getInt
441b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getUInt
442b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
443b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
444b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const uint8_t* U_EXPORT2
445b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getBinary(const UResourceBundle* resourceBundle,
446b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru               int32_t* len,
447b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru               UErrorCode* status);
448b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
449b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
450b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a 32 bit integer array from a resource.
451b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
452b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle an int vector resource
453b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len    fills in the length of resulting byte chunk
454b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status fills in the outgoing error code
455b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
456b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                Always check the value of status. Don't count on returning NULL.
457b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
458b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
45950294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho * @return a pointer to a chunk of integers which live in a memory mapped/DLL file.
460b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getBinary
461b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getString
462b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getInt
463b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getUInt
464b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
465b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
466b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const int32_t* U_EXPORT2
467b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getIntVector(const UResourceBundle* resourceBundle,
468b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                  int32_t* len,
469b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                  UErrorCode* status);
470b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
471b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
472b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns an unsigned integer from a resource.
473b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This integer is originally 28 bits.
474b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
475b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a string resource
476b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status fills in the outgoing error code
477b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
478b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
479b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
480b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return an integer value
481b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getInt
482b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getIntVector
483b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getBinary
484b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getString
485b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
486b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
487b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE uint32_t U_EXPORT2
488b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUInt(const UResourceBundle* resourceBundle,
489b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru             UErrorCode *status);
490b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
491b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
492b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a signed integer from a resource.
493b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This integer is originally 28 bit and the sign gets propagated.
494b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
495b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a string resource
496b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status  fills in the outgoing error code
497b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
498b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
499b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
500b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return an integer value
501b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getUInt
502b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getIntVector
503b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getBinary
504b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getString
505b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
506b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
507b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2
508b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getInt(const UResourceBundle* resourceBundle,
509b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru            UErrorCode *status);
510b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
511b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
512b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the size of a resource. Size for scalar types is always 1,
513b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and for vector/table types is the number of child resources.
514b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @warning Integer array is treated as a scalar type. There are no
515b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          APIs to access individual members of an integer array. It
516b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *          is always returned as a whole.
517b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a resource
518b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return number of resources in a given resource.
519b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
520b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
521b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE int32_t U_EXPORT2
522b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getSize(const UResourceBundle *resourceBundle);
523b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
524b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
525b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the type of a resource. Available types are defined in enum UResType
526b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
527b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a resource
528b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return type of the given resource.
529b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see UResType
530b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
531b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
532b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResType U_EXPORT2
533b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getType(const UResourceBundle *resourceBundle);
534b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
535b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
536b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the key associated with a given resource. Not all the resources have a key - only
537b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * those that are members of a table.
538b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
539b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a resource
540b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return a key associated to this resource, or NULL if it doesn't have a key
541b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
542b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
543b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2
544b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getKey(const UResourceBundle *resourceBundle);
545b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
546b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/* ITERATION API
547b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    This API provides means for iterating through a resource
548b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru*/
549b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
550b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
551b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Resets the internal context of a resource so that iteration starts from the first element.
552b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
553b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a resource
554b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
555b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
556b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE void U_EXPORT2
557b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_resetIterator(UResourceBundle *resourceBundle);
558b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
559b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
560b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Checks whether the given resource has another element to iterate over.
561b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
562b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle a resource
563b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return TRUE if there are more elements, FALSE if there is no more elements
564b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
565b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
566b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UBool U_EXPORT2
567b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_hasNext(const UResourceBundle *resourceBundle);
568b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
569b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
570b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the next resource in a given resource or NULL if there are no more resources
571b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to iterate over. Features a fill-in parameter.
572b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
573b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle    a resource
574b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param fillIn            if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
575b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          Alternatively, you can supply a struct to be filled by this function.
576b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code. You may still get a non NULL result even if an
577b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          error occured. Check status instead.
578b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
579b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
580b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
581b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle* U_EXPORT2
582b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getNextResource(UResourceBundle *resourceBundle,
583b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     UResourceBundle *fillIn,
584b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                     UErrorCode *status);
585b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
586b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
587b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the next string in a given resource or NULL if there are no more resources
588b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to iterate over.
589b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
590b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle    a resource
591b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len               fill in length of the string
592b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key               fill in for key associated with this string. NULL if no key
593b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code. If an error occured, we may return NULL, but don't
594b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          count on it. Check status instead!
595b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
596b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
597b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
598b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const UChar* U_EXPORT2
599b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getNextString(UResourceBundle *resourceBundle,
600b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   int32_t* len,
601b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   const char ** key,
602b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                   UErrorCode *status);
603b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
604b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
605b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the resource in a given resource at the specified index. Features a fill-in parameter.
606b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
607b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle    the resource bundle from which to get a sub-resource
608b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param indexR            an index to the wanted resource.
609b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param fillIn            if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
610b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          Alternatively, you can supply a struct to be filled by this function.
611b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code. Don't count on NULL being returned if an error has
612b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          occured. Check status instead.
613b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
614b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
615b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
616b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle* U_EXPORT2
617b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getByIndex(const UResourceBundle *resourceBundle,
618b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                int32_t indexR,
619b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                UResourceBundle *fillIn,
620b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                UErrorCode *status);
621b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
622b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
623b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the string in a given resource at the specified index.
624b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
625b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle    a resource
626b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param indexS            an index to the wanted string.
627b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len               fill in length of the string
628b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code. If an error occured, we may return NULL, but don't
629b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          count on it. Check status instead!
630b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
631b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
632b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
633b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const UChar* U_EXPORT2
634b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getStringByIndex(const UResourceBundle *resourceBundle,
635b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                      int32_t indexS,
636b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                      int32_t* len,
637b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                      UErrorCode *status);
638b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
639b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
640b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a UTF-8 string from a resource at the specified index.
641b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The UTF-8 string may be returnable directly as a pointer, or
642b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
643b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or equivalent.
644b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
645b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==TRUE, then the string is always written to the dest buffer
646b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and dest is returned.
647b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
648b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==FALSE, then the string is returned as a pointer if possible,
649b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * without needing a dest buffer (it can be NULL). If the string needs to be
650b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * copied or transformed, then it may be placed into dest at an arbitrary offset.
651b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
652b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
653b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
654b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
655b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is transformed from UTF-16, then a conversion error may occur
656b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * if an unpaired surrogate is encountered. If the function is successful, then
657b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the output UTF-8 string is always well-formed.
658b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
659b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB Resource bundle.
660b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru * @param stringIndex An index to the wanted string.
661b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
662b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pLength Input: Capacity of destination buffer.
663b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Output: Actual length of the UTF-8 string, not counting the
664b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
665b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Can be NULL, meaning capacity=0 and the string length is not
666b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               returned to the caller.
667b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param forceCopy If TRUE, then the output string will always be written to
668b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  dest, with U_BUFFER_OVERFLOW_ERROR and
669b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  U_STRING_NOT_TERMINATED_WARNING set if appropriate.
670b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If FALSE, then the dest buffer may or may not contain a
671b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  copy of the string. dest may or may not be modified.
672b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If a copy needs to be written, then the UErrorCode parameter
673b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  indicates overflow etc. as usual.
674b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status Pointer to a standard ICU error code. Its input value must
675b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               pass the U_SUCCESS() test, or else the function returns
676b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               immediately. Check for U_FAILURE() on output or use with
677b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               function chaining. (See User Guide for details.)
678b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The pointer to the UTF-8 string. It may be dest, or at some offset
679b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         from dest (only if !forceCopy), or in unrelated memory.
680b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         Always NUL-terminated unless the string was written to dest and
681b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
682b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
683b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getStringByIndex
684b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see u_strToUTF8
685b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
686b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
687b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2
688b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUTF8StringByIndex(const UResourceBundle *resB,
689b0ac937921a2c196d8b9da665135bf6ba01a1ccfJean-Baptiste Queru                          int32_t stringIndex,
690b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                          char *dest, int32_t *pLength,
691b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                          UBool forceCopy,
692b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                          UErrorCode *status);
693b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
694b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
695b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a resource in a given resource that has a given key. This procedure works only with table
696b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * resources. Features a fill-in parameter.
697b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
698b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resourceBundle    a resource
699b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key               a key associated with the wanted resource
700b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param fillIn            if NULL a new UResourceBundle struct is allocated and must be closed by the caller.
701b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          Alternatively, you can supply a struct to be filled by this function.
702b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code.
703b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  a pointer to a UResourceBundle struct. If fill in param was NULL, caller must close it
704b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
705b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
706b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UResourceBundle* U_EXPORT2
707b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getByKey(const UResourceBundle *resourceBundle,
708b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru              const char* key,
709b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru              UResourceBundle *fillIn,
710b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru              UErrorCode *status);
711b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
712b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
713b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a string in a given resource that has a given key. This procedure works only with table
714b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * resources.
715b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
716b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB              a resource
717b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key               a key associated with the wanted string
718b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param len               fill in length of the string
719b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code. If an error occured, we may return NULL, but don't
720b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                          count on it. Check status instead!
721b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  a pointer to a zero-terminated UChar array which lives in a memory mapped/DLL file.
722b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
723b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
724b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const UChar* U_EXPORT2
725b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getStringByKey(const UResourceBundle *resB,
726b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                    const char* key,
727b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                    int32_t* len,
728b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                    UErrorCode *status);
729b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
730b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
731b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a UTF-8 string from a resource and a key.
732b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This function works only with table resources.
733b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
734b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * The UTF-8 string may be returnable directly as a pointer, or
735b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * it may need to be copied, or transformed from UTF-16 using u_strToUTF8()
736b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * or equivalent.
737b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
738b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==TRUE, then the string is always written to the dest buffer
739b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * and dest is returned.
740b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
741b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If forceCopy==FALSE, then the string is returned as a pointer if possible,
742b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * without needing a dest buffer (it can be NULL). If the string needs to be
743b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * copied or transformed, then it may be placed into dest at an arbitrary offset.
744b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
745b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is to be written to dest, then U_BUFFER_OVERFLOW_ERROR and
746b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * U_STRING_NOT_TERMINATED_WARNING are set if appropriate, as usual.
747b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
748b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * If the string is transformed from UTF-16, then a conversion error may occur
749b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * if an unpaired surrogate is encountered. If the function is successful, then
750b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the output UTF-8 string is always well-formed.
751b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
752b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB Resource bundle.
753b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key  A key associated with the wanted resource
754b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param dest Destination buffer. Can be NULL only if capacity=*length==0.
755b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param pLength Input: Capacity of destination buffer.
756b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Output: Actual length of the UTF-8 string, not counting the
757b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               terminating NUL, even in case of U_BUFFER_OVERFLOW_ERROR.
758b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               Can be NULL, meaning capacity=0 and the string length is not
759b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               returned to the caller.
760b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param forceCopy If TRUE, then the output string will always be written to
761b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  dest, with U_BUFFER_OVERFLOW_ERROR and
762b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  U_STRING_NOT_TERMINATED_WARNING set if appropriate.
763b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If FALSE, then the dest buffer may or may not contain a
764b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  copy of the string. dest may or may not be modified.
765b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  If a copy needs to be written, then the UErrorCode parameter
766b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                  indicates overflow etc. as usual.
767b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status Pointer to a standard ICU error code. Its input value must
768b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               pass the U_SUCCESS() test, or else the function returns
769b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               immediately. Check for U_FAILURE() on output or use with
770b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *               function chaining. (See User Guide for details.)
771b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return The pointer to the UTF-8 string. It may be dest, or at some offset
772b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         from dest (only if !forceCopy), or in unrelated memory.
773b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         Always NUL-terminated unless the string was written to dest and
774b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *         length==capacity (in which case U_STRING_NOT_TERMINATED_WARNING is set).
775b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
776b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see ures_getStringByKey
777b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @see u_strToUTF8
778b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.6
779b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
780b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE const char * U_EXPORT2
781b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUTF8StringByKey(const UResourceBundle *resB,
782b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        const char *key,
783b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        char *dest, int32_t *pLength,
784b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        UBool forceCopy,
785b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                        UErrorCode *status);
786b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
78750294ead5e5d23f5bbfed76e00e6b510bd41eee1claireho#if U_SHOW_CPLUSPLUS_API
788b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#include "unicode/unistr.h"
789b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
790b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_NAMESPACE_BEGIN
791b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
792b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * returns a string from a string resource type
793b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
794b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB    a resource
795b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status: fills in the outgoing error code
796b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be <TT>U_MISSING_RESOURCE_ERROR</TT> if the key is not found
797b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                could be a non-failing error
798b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *                e.g.: <TT>U_USING_FALLBACK_WARNING</TT>,<TT>U_USING_DEFAULT_WARNING </TT>
799b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return        a UnicodeString object. If there is an error, string is bogus
800b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
801b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
802b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline UnicodeString
803b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUnicodeString(const UResourceBundle *resB,
804b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                      UErrorCode* status)
805b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru{
806b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    int32_t len = 0;
807b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    const UChar *r = ures_getString(resB, &len, status);
808b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return UnicodeString(TRUE, r, len);
809b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
810b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
811b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
812b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the next string in a resource or NULL if there are no more resources
813b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * to iterate over.
814b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
815b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB              a resource
816b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key               fill in for key associated with this string
817b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code
818b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return an UnicodeString object.
819b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
820b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
821b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline UnicodeString
822b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getNextUnicodeString(UResourceBundle *resB,
823b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                          const char ** key,
824b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                          UErrorCode* status)
825b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru{
826b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    int32_t len = 0;
827b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    const UChar* r = ures_getNextString(resB, &len, key, status);
828b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return UnicodeString(TRUE, r, len);
829b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
830b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
831b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
832b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns the string in a given resource at the specified index.
833b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
834b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB              a resource
83554dcd9b6a06071f647dac967e9e267abb9410720Craig Cornelius * @param indexS            an index to the wanted string.
836b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code
837b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  an UnicodeString object. If there is an error, string is bogus
838b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
839b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
840b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline UnicodeString
841b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUnicodeStringByIndex(const UResourceBundle *resB,
842b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                             int32_t indexS,
843b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                             UErrorCode* status)
844b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru{
845b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    int32_t len = 0;
846b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    const UChar* r = ures_getStringByIndex(resB, indexS, &len, status);
847b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return UnicodeString(TRUE, r, len);
848b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
849b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
850b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
851b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Returns a string in a resource that has a given key. This procedure works only with table
852b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * resources.
853b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru *
854b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param resB              a resource
855b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param key               a key associated with the wanted string
856b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status            fills in the outgoing error code
857b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @return                  an UnicodeString object. If there is an error, string is bogus
858b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 2.0
859b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
860b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruinline UnicodeString
861b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_getUnicodeStringByKey(const UResourceBundle *resB,
862b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                           const char* key,
863b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru                           UErrorCode* status)
864b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru{
865b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    int32_t len = 0;
866b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    const UChar* r = ures_getStringByKey(resB, key, &len, status);
867b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru    return UnicodeString(TRUE, r, len);
868b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru}
869b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
870b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_NAMESPACE_END
871b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
872b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif
873b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
874b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/**
875b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * Create a string enumerator, owned by the caller, of all locales located within
876b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * the specified resource tree.
877b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param packageName name of the tree, such as (NULL) or U_ICUDATA_ALIAS or  or "ICUDATA-coll"
878b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * This call is similar to uloc_getAvailable().
879b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @param status error code
880b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru * @stable ICU 3.2
881b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru */
882b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste QueruU_STABLE UEnumeration* U_EXPORT2
883b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queruures_openAvailableLocales(const char *packageName, UErrorCode *status);
884b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
885b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru
886b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru#endif /*_URES*/
887b13da9df870a61b11249bf741347908dbea0edd8Jean-Baptiste Queru/*eof*/
888