|
import Foundation |
|
|
|
protocol OptionalProtocol { |
|
var isNonNil: Bool { get } |
|
} |
|
|
|
extension Optional: OptionalProtocol { |
|
var isNonNil: Bool { |
|
self != nil |
|
} |
|
|
|
var _description: String { |
|
"\(describe(value: self))" |
|
} |
|
} |
|
|
|
extension Bool { |
|
var _description: String { |
|
description |
|
} |
|
} |
|
|
|
extension String { |
|
var _description: String { |
|
"\"\(description)\"" |
|
} |
|
} |
|
|
|
// NOTE: _internal layout probably doesn't really match actual layout. |
|
// This is mostly fine because it's to keep the structs ~appropriately sized. |
|
|
|
public struct Path { |
|
var _internal: (String) |
|
|
|
@_silgen_name("$s7XCBUtil4PathV3strSSvg") |
|
func str() -> String |
|
} |
|
|
|
extension Path { |
|
var _description: String { |
|
"XCBUtil.Path(str: \(str()._description))" |
|
} |
|
} |
|
|
|
public struct ArenaInfo { |
|
var _internal: (Path, Path, Path, Path, Path, Path?, Bool) |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV15derivedDataPath7XCBUtil0F0Vvg") |
|
func derivedDataPath() -> Path |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV17buildProductsPath7XCBUtil0F0Vvg") |
|
func buildProductsPath() -> Path |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV22buildIntermediatesPath7XCBUtil0F0Vvg") |
|
func buildIntermediatesPath() -> Path |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV7pchPath7XCBUtil0E0Vvg") |
|
func pchPath() -> Path |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV12indexPCHPath7XCBUtil4PathVvg") |
|
func indexPCHPath() -> Path |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV24indexDataStoreFolderPath7XCBUtil0H0VSgvg") |
|
func indexDataStoreFolderPath() -> Path? |
|
|
|
@_silgen_name("$s11XCBProtocol9ArenaInfoV20indexEnableDataStoreSbvg") |
|
func indexEnableDataStore() -> Bool |
|
} |
|
|
|
extension ArenaInfo { |
|
var _description: String { |
|
"XCBProtocol.ArenaInfo(derivedDataPath: \(derivedDataPath()._description), buildProductsPath: \(buildProductsPath()._description), buildIntermediatesPath: \(buildIntermediatesPath()._description), pchPath: \(pchPath()._description), indexPCHPath: \(indexPCHPath()._description), indexDataStoreFolderPath: \(indexDataStoreFolderPath()._description), indexEnableDataStore: \(indexEnableDataStore()._description))" |
|
} |
|
} |
|
|
|
public struct OrderedSet<T: Hashable> { |
|
var _internal: ([T], Set<T>) |
|
|
|
@_silgen_name("$s7XCBUtil10OrderedSetV11descriptionSSvg") |
|
func description() -> String |
|
} |
|
|
|
extension OrderedSet { |
|
var _description: String { |
|
description() |
|
} |
|
} |
|
|
|
public struct RunDestinationInfo { |
|
var _internal: (String, String, String?, String, OrderedSet<String>, Bool) |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV8platformSSvg") |
|
func platform() -> String |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV3sdkSSvg") |
|
func sdk() -> String |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV10sdkVariantSSSgvg") |
|
func sdkVariant() -> String? |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV18targetArchitectureSSvg") |
|
func targetArchitecture() -> String |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV22supportedArchitectures7XCBUtil10OrderedSetVySSGvg") |
|
func supportedArchitectures() -> OrderedSet<String> |
|
|
|
@_silgen_name("$s11XCBProtocol18RunDestinationInfoV21disableOnlyActiveArchSbvg") |
|
func disableOnlyActiveArch() -> Bool |
|
} |
|
|
|
extension RunDestinationInfo { |
|
var _description: String { |
|
"XCBProtocol.RunDestinationInfo(platform: \(platform()._description), sdk: \(sdk()._description), sdkVariant: \(sdkVariant()._description), targetArchitecture: \(targetArchitecture()._description), supportedArchitectures: \(supportedArchitectures()._description), disableOnlyActiveArch: \(disableOnlyActiveArch()._description))" |
|
} |
|
} |
|
|
|
func describe<T>(value: T) -> String { |
|
// Ideally this would use _getTypeName but it doesn't quite work |
|
if _typeName(T.self) == "Swift.Optional<XCBProtocol.ArenaInfo>", ((value as? OptionalProtocol)?.isNonNil)! { |
|
return withUnsafePointer(to: value) { |
|
"Optional(\(UnsafeRawPointer($0).assumingMemoryBound(to: ArenaInfo.self).pointee._description))" |
|
} |
|
} else if _typeName(T.self) == "Swift.Optional<XCBProtocol.RunDestinationInfo>", ((value as? OptionalProtocol)?.isNonNil)! { |
|
return withUnsafePointer(to: value) { |
|
"Optional(\(UnsafeRawPointer($0).assumingMemoryBound(to: RunDestinationInfo.self).pointee._description))" |
|
} |
|
} else if T.self == Path?.self, ((value as? OptionalProtocol)?.isNonNil)! { |
|
return withUnsafePointer(to: value) { |
|
"Optional(\(UnsafeRawPointer($0).assumingMemoryBound(to: Path.self).pointee._description))" |
|
} |
|
} else { |
|
return String(describing: value) |
|
} |
|
} |
|
|
|
@_silgen_name("String_init_describing") |
|
func String_init_describing<T>(describing value: T) -> String { |
|
describe(value: value) |
|
} |