withPlatformString(_:)
Calls the given closure with a pointer to the contents of the string, represented as a null-terminated platform string.
Declaration
func withPlatformString<Result>(_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result) rethrows -> ResultParameters
- body:
A closure with a pointer parameter that points to a null-terminated platform string. If
bodyhas a return value, that value is also used as the return value for this method.
Return Value
The return value, if any, of the body closure parameter.
Discussion
The pointer passed as an argument to body is valid only during the execution of this method. Don’t try to store the pointer for later use.