One Logo Pool Ball
System · IOS API REFERENCE

FilePath.Root

struct · iOS 15.0+ · SDK 27.1

struct Root

Represents a root of a file path. On Unix, a root is simply the directory separator `/`. On Windows, a root contains the entire path prefix up to and including the final separator. Examples: * Unix: * `/` * Windows: * `C:\` * `C:` * `\` * `\\server\share\` * `\\?\UNC\server\share\` * `\\?\Volume{12345678-abcd-1111-2222-123445789abc}\`

Members (10)

get · iOS 15.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of the path root. If the content of the path root isn't a well-formed Unicode string, this replaces invalid bytes with U+FFFD. See `String.init(decoding:)`.

init · iOS 15.0+

init

TypeScript
static initStringLiteral(stringLiteral: string): FilePath_Root
Swift declaration
init(stringLiteral: String)

Create a file path root from a string literal. Precondition: `stringLiteral` is non-empty and is a root.

init · iOS 15.0+

init

TypeScript
static initPlatformString(platformString: SDKHandle): (FilePath_Root) | null
Swift declaration
init?(platformString: UnsafePointer<CInterop.PlatformChar>)

Creates a file path root by copying bytes from a null-terminated platform string. Returns `nil` if `platformString` is empty or is not a root. - Parameter platformString: A pointer to a null-terminated platform string.

init · iOS 15.0+

init

TypeScript
static initPlatformString98740(platformString: string): (FilePath_Root) | null
Swift declaration
init?(platformString: String)
init · iOS 15.0+

init

TypeScript
static initPlatformString34288(platformString: Array<number>): (FilePath_Root) | null
Swift declaration
init?(platformString: [CInterop.PlatformChar])

Creates a file path root by copying bytes from a null-terminated platform string. It is a precondition that a null byte indicates the end of the string. The absence of a null byte will trigger a runtime error. Returns `nil` if `platformString` is empty or is not a root. - Note It is a precondition that `platformString` must be null-terminated. The absence of a null byte will trigger a runtime error. - Parameter platformString: A null-terminated platform string.

init · iOS 15.0+

init

TypeScript
static initPlatformString48946(platformString: number): { $ret: (FilePath_Root) | null; $out: { "platformString": number } }
Swift declaration
init?(platformString: inout CInterop.PlatformChar)

Omit the output parameters from the call. The result contains $ret and $out, with platformString inside $out.

get · iOS 15.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of the path root, suitable for debugging. If the content of the path root isn't a well-formed Unicode string, this replaces invalid bytes with U+FFFD. See `String.init(decoding:)`.

method · iOS 15.0+

withPlatformString

TypeScript
withPlatformString(body: ((arg0: SDKHandle) => unknown)): unknown
Swift declaration
func withPlatformString<Result>(_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result) rethrows -> Result

Calls the given closure with a pointer to the contents of the file path root, represented as a null-terminated platform string. If the path has a relative portion, an allocation will occur in order to add the null terminator. - Parameter body: A closure with a pointer parameter that points to a null-terminated platform string. If `body` has a return value, that value is also used as the return value for this method. - Returns: The return value, if any, of the `body` closure parameter. 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.

get · iOS 15.0+

string

TypeScript
get string(): string
Swift declaration
var string: String { get }

On Unix, this returns `"/"`. On Windows, interprets the root's content as UTF-16 on Windows. This property is equivalent to calling `String(decoding: root)`.

init · iOS 15.0+

init

TypeScript
static init(string: string): (FilePath_Root) | null
Swift declaration
init?(_ string: String)

Create a file path root from a string. Returns `nil` if `string` is empty or is not a root.

Skipped declarations

No declarations were skipped in this snapshot.

All System types →