CFURLCreateWithBytes(_:_:_:_:_:)
Creates a CFURL object using a given character bytes.
Declaration
func CFURLCreateWithBytes(_ allocator: CFAllocator!, _ URLBytes: UnsafePointer<UInt8>!, _ length: CFIndex, _ encoding: CFStringEncoding, _ baseURL: CFURL!) -> CFURL!Parameters
- allocator:
The allocator to use to allocate memory for the new
CFURLobject. PassNULLor Kcfallocatordefault to use the current default allocator. - URLBytes:
The character bytes to convert into a
CFURLobject. - length:
The number of bytes in
URLBytes. - encoding:
The string encoding of the
URLBytesstring. This encoding is also used to interpret percent escape sequences. - baseURL:
The URL to which
URLBytesis relative. PassNULLifURLBytescontains an absolute URL or if you want to create a relative URL. IfURLBytescontains an absolute URL, this parameter is ignored.
Return Value
A new CFURL object. Ownership follows the create rule. See The Create Rule.
Discussion
The specified string encoding will be used both to interpret URLBytes, and to interpret any percent-escapes within the string.
See Also
Creating a CFURL
CFURLCopyAbsoluteURL(_:)CFURLCreateAbsoluteURLWithBytes(_:_:_:_:_:_:)CFURLCreateByResolvingBookmarkData(_:_:_:_:_:_:_:)CFURLCreateCopyAppendingPathComponent(_:_:_:_:)CFURLCreateCopyAppendingPathExtension(_:_:_:)CFURLCreateCopyDeletingLastPathComponent(_:_:)CFURLCreateCopyDeletingPathExtension(_:_:)CFURLCreateFilePathURL(_:_:_:)CFURLCreateFileReferenceURL(_:_:_:)CFURLCreateFromFileSystemRepresentation(_:_:_:_:)CFURLCreateFromFileSystemRepresentationRelativeToBase(_:_:_:_:_:)CFURLCreateFromFSRef(_:_:)CFURLCreateWithFileSystemPath(_:_:_:_:)CFURLCreateWithFileSystemPathRelativeToBase(_:_:_:_:_:)CFURLCreateWithString(_:_:_:)