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

U_STABLE UEnumeration* U_EXPORT2 ucsdet_getAllDetectableCharsets ( const UCharsetDetector ucsd,
UErrorCode status 
)

Get an iterator over the set of all detectable charsets - over the charsets that are known to the charset detection service.

The returned UEnumeration provides access to the names of the charsets.

The state of the Charset detector that is passed in does not affect the result of this function, but requiring a valid, open charset detector as a parameter insures that the charset detection service has been safely initialized and that the required detection data is available.

Parameters:
ucsd a Charset detector.
status Any error conditions are reported back in this variable.
Returns:
an iterator providing access to the detectable charset names. ICU 3.6

Definition at line 394 of file csdetect.cpp.

References U_FAILURE, and U_NAMESPACE_USE.

{
    U_NAMESPACE_USE

    if(U_FAILURE(*status)) {
        return 0;
    }

    /* Initialize recognized charsets. */
    CharsetDetector::getDetectableCount();

    UEnumeration *en = NEW_ARRAY(UEnumeration, 1);
    memcpy(en, &gCSDetEnumeration, sizeof(UEnumeration));
    en->context = (void*)NEW_ARRAY(Context, 1);
    uprv_memset(en->context, 0, sizeof(Context));
    return en;
}


Generated by  Doxygen 1.6.0   Back to index