Function CFStringTokenizerGetCurrentSubTokens

Source
pub unsafe extern "C-unwind" fn CFStringTokenizerGetCurrentSubTokens(
    tokenizer: &CFStringTokenizer,
    ranges: *mut CFRange,
    max_range_length: CFIndex,
    derived_sub_tokens: Option<&CFMutableArray>,
) -> CFIndex
Available on crate features CFArray and CFBase and CFStringTokenizer only.
Expand description

Retrieves the subtokens or derived subtokens contained in the compound token.

Parameter tokenizer: The reference to CFStringTokenizer returned by CFStringTokenizerCreate.

Parameter ranges: An array of CFRange to fill in with the ranges of subtokens. The filled in ranges are relative to the string specified to CFStringTokenizerCreate. This parameter can be NULL.

Parameter maxRangeLength: The maximum number of ranges to return.

Parameter derivedSubTokens: An array of CFMutableArray to which the derived subtokens are to be added. This parameter can be NULL.

Returns: number of subtokens.

If token type is kCFStringTokenizerTokenNone, the ranges array and derivedSubTokens array are untouched and the return value is 0. If token type is kCFStringTokenizerTokenNormal, the ranges array has one item filled in with the entire range of the token (if maxRangeLength >= 1) and a string taken from the entire token range is added to the derivedSubTokens array and the return value is 1. If token type is kCFStringTokenizerTokenHasSubTokensMask or kCFStringTokenizerTokenHasDerivedSubTokensMask, the ranges array is filled in with as many items as there are subtokens (up to a limit of maxRangeLength). The derivedSubTokens array will have sub tokens added even when the sub token is a substring of the token. If token type is kCFStringTokenizerTokenHasSubTokensMask, the ordinary non-derived subtokens are added to the derivedSubTokens array.