日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

生成跨语言的类型声明和接口绑定的工具(Djinni )

發布時間:2023/12/18 编程问答 16 豆豆
生活随笔 收集整理的這篇文章主要介紹了 生成跨语言的类型声明和接口绑定的工具(Djinni ) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Djinni 是一個用來生成跨語言的類型聲明和接口綁定的工具,主要用于 C++ 和 Java 以及 Objective-C 間的互通。

示例接口定義文件:

1 # Multi-line comments can be added here. This comment will be propagated 2 # to each generated definition. 3 my_enum = enum { 4 option1; 5 option2; 6 option3; 7 } 8 9 my_record = record { 10 id: i32; 11 info: string; 12 store: set<string>; 13 hash: map<string, i32>; 14 15 values: list<another_record>; 16 17 # Comments can also be put here 18 19 # Constants can be included 20 const string_const: string = "Constants can be put here"; 21 const min_value: another_record = { 22 key1 = 0, 23 key2 = "" 24 }; 25 } 26 27 another_record = record { 28 key1: i32; 29 key2: string; 30 } deriving (eq, ord) 31 32 # This interface will be implemented in C++ and can be called from any language. 33 my_cpp_interface = interface +c { 34 method_returning_nothing(value: i32); 35 method_returning_some_type(key: string): another_record; 36 static get_version(): i32; 37 38 # Interfaces can also have constants 39 const version: i32 = 1; 40 } 41 42 # This interface will be implemented in Java and ObjC and can be called from C++. 43 my_client_interface = interface +j +o { 44 log_string(str: string): bool; 45 }

使用方法:

1 @import "relative/path/to/filename.djinni"

github地址:https://github.com/dropbox/djinni

?

轉載于:https://www.cnblogs.com/CharlesGrant/p/4724794.html

總結

以上是生活随笔為你收集整理的生成跨语言的类型声明和接口绑定的工具(Djinni )的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。