---
title: "CFURLGetByteRangeForComponent(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfurlgetbyterangeforcomponent(_:_:_:)"
---

# CFURLGetByteRangeForComponent(_:_:_:)

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

## Declaration

```swift
func CFURLGetByteRangeForComponent(_ url: CFURL!, _ component: CFURLComponentType, _ rangeIncludingSeparators: UnsafeMutablePointer<CFRange>!) -> CFRange
```

## Parameters

- `url`: The URL containing component.
- `component`: The type of component in anURL whose range you want to obtain. See doc://com.apple.corefoundation/documentation/CoreFoundation/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

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

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(_:)](corefoundation/cfurlgetbaseurl(_:).md)
- [CFURLGetBytes(_:_:_:)](corefoundation/cfurlgetbytes(_:_:_:).md)
- [CFURLGetTypeID()](corefoundation/cfurlgettypeid().md)
- [CFURLResourceIsReachable(_:_:)](corefoundation/cfurlresourceisreachable(_:_:).md)
