APersistableBundle_getPersistableBundleKeys

Function APersistableBundle_getPersistableBundleKeys 

Source
pub unsafe extern "C" fn APersistableBundle_getPersistableBundleKeys(
    pBundle: *const APersistableBundle,
    outKeys: *mut *mut c_char,
    bufferSizeBytes: i32,
    stringAllocator: Option<unsafe extern "C" fn(arg1: i32, arg2: *mut c_void) -> *mut c_char>,
    context: *mut c_void,
) -> i32
Expand description

Get all of the keys associated with this specific type and place it in the provided pre-allocated buffer from the user. The user must provide an APersistableBundle_stringAllocator for the individual strings to be allocated. The caller is responsible for freeing the returned data in bytes.

This function returns the size in bytes required to fit the fill list of keys. The supplied buffer will be filled in based on the smaller of the supplied bufferSizeBytes or the actual size of the stored data. If the buffer is null or if the supplied bufferSizeBytes is smaller than the actual stored data, then not all of the stored data will be returned.

Users can call this function with null buffer and 0 bufferSizeBytes to get the required size of the buffer to use on a subsequent call.

\param pBundle to operate on \param outKeys pointer to a pre-allocated buffer to write the UTF-8 keys to \param bufferSizeBytes size of the pre-allocated buffer \param stringAllocator function pointer to the string allocator \param context pointer that will be passed to the stringAllocator

\return size of the buffer of keys in bytes. This is the required size of the pre-allocated user supplied buffer if all of the stored contents are desired. APERSISTABLEBUNDLE_ALLOCATOR_FAILED if the provided allocator fails