Function

CFURLGetByteRangeForComponent

Returns the range of the specified component in the bytes of a URL.

Declaration

CFRange CFURLGetByteRangeForComponent(CFURLRef url, CFURLComponentType component, CFRange *rangeIncludingSeparators);

Parameters

anURL

The URL containing component.

component

The type of component in anURL whose range you want to obtain. See CFURLComponentType for possible values.

rangeIncludingSeparators

Specifies the range of component including the sequences that separate component from the previous and next components. If there is no previous or next components, this function will match the range of the component itself. If anURL does not contain component, rangeIncludingSeparators is set to the location where the component would be inserted.

Return Value

The range of bytes for component in the buffer returned by the CFURLGetBytes function. If anURL does not contain component, the first part of the returned range is set to kCFNotFound.

Discussion

This function is intended to be used in conjunction with the CFURLGetBytes function, since the range returned is only applicable to the bytes returned by CFURLGetBytes.

See Also

Getting URL Properties

CFURLGetBaseURL

Returns the base URL of a given URL if it exists.

CFURLGetBytes

Returns by reference the byte representation of a URL object.

CFURLGetTypeID

Returns the type identifier for the CFURL opaque type.

CFURLResourceIsReachable

Returns whether the resource pointed to by a file URL can be reached.