Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE USet* U_EXPORT2 ulocdata_getExemplarSet ( ULocaleData uld,
USet fillIn,
uint32_t  options,
ULocaleDataExemplarSetType  extype,
UErrorCode status 

Returns the set of exemplar characters for a locale.

uld Pointer to the locale data object from which the exemplar character set is to be retrieved.
fillIn Pointer to a USet object to receive the exemplar character set for the given locale. Previous contents of fillIn are lost. If fillIn is NULL, then a new USet is created and returned. The caller owns the result and must dispose of it by calling uset_close.
options Bitmask for options to apply to the exemplar pattern. Specify zero to retrieve the exemplar set as it is defined in the locale data. Specify USET_CASE_INSENSITIVE to retrieve a case-folded exemplar set. See uset_applyPattern for a complete list of valid options. The USET_IGNORE_SPACE bit is always set, regardless of the value of 'options'.
extype Specifies the type of exemplar set to be retrieved.
status Pointer to an input-output error code value; must not be NULL.
USet* Either fillIn, or if fillIn is NULL, a pointer to a newly-allocated USet that the user must close. ICU 3.4

Definition at line 100 of file ulocdata.c.



    static const char* const exemplarSetTypes[] = { "ExemplarCharacters", "AuxExemplarCharacters" };
    const UChar *exemplarChars = NULL;
    int32_t len = 0;
    UErrorCode localStatus = U_ZERO_ERROR;

    if (U_FAILURE(*status))
        return NULL;

    exemplarChars = ures_getStringByKey(uld->bundle, exemplarSetTypes[extype], &len, &localStatus);
    if ( (localStatus == U_USING_DEFAULT_WARNING) && uld->noSubstitute ) {
        localStatus = U_MISSING_RESOURCE_ERROR;

    if (localStatus != U_ZERO_ERROR) {
        *status = localStatus;

    if (U_FAILURE(*status))
        return NULL;

    if(fillIn != NULL)
        uset_applyPattern(fillIn, exemplarChars, len,
                          USET_IGNORE_SPACE | options, status);
        fillIn = uset_openPatternOptions(exemplarChars, len,
                                         USET_IGNORE_SPACE | options, status);

    return fillIn;


Generated by  Doxygen 1.6.0   Back to index