mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Added Foundation bindings
This commit is contained in:
@@ -13,6 +13,23 @@ Data_init :: proc "c" (self: ^Data) -> ^Data {
|
||||
return msgSend(^Data, self, "init")
|
||||
}
|
||||
|
||||
@(objc_type = Data, objc_name = "initWithBytes")
|
||||
Data_initWithBytes :: proc "c" (self: ^Data, bytes: []byte) -> ^Data {
|
||||
return msgSend(^Data, self, "initWithBytes:length:", raw_data(bytes), len(bytes))
|
||||
}
|
||||
|
||||
@(objc_type = Data, objc_name = "initWithBytesNoCopy")
|
||||
Data_initWithBytesNoCopy :: proc "c" (self: ^Data, bytes: []byte, freeWhenDone: ns.BOOL) -> ^Data {
|
||||
return msgSend(
|
||||
^Data,
|
||||
self,
|
||||
"initWithBytesNoCopy:length:freeWhenDone:",
|
||||
raw_data(bytes),
|
||||
len(bytes),
|
||||
freeWhenDone,
|
||||
)
|
||||
}
|
||||
|
||||
@(objc_type=Data, objc_name="mutableBytes")
|
||||
Data_mutableBytes :: proc "c" (self: ^Data) -> rawptr {
|
||||
return msgSend(rawptr, self, "mutableBytes")
|
||||
|
||||
Reference in New Issue
Block a user