<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Djinni跨語言類型聲明和接口綁定

          聯(lián)合創(chuàng)作 · 2023-09-28 17:02

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

          示例接口定義文件:

          # Multi-line comments can be added here. This comment will be propagated
          # to each generated definition.
          my_enum = enum {
              option1;
              option2;
              option3;
          }
          
          my_record = record {
              id: i32;
              info: string;
              store: set<string>;
              hash: map<string, i32>;
          
              values: list<another_record>;
          
              # Comments can also be put here
          
              # Constants can be included
              const string_const: string = "Constants can be put here";
              const min_value: another_record = {
                  key1 = 0,
                  key2 = ""
              };
          }
          
          another_record = record {
              key1: i32;
              key2: string;
          } deriving (eq, ord)
          
          # This interface will be implemented in C++ and can be called from any language.
          my_cpp_interface = interface +c {
              method_returning_nothing(value: i32);
              method_returning_some_type(key: string): another_record;
              static get_version(): i32;
          
              # Interfaces can also have constants
              const version: i32 = 1;
          }
          
          # This interface will be implemented in Java and ObjC and can be called from C++.
          my_client_interface = interface +j +o {
              log_string(str: string): bool;
          }

          使用方法:

          @import "relative/path/to/filename.djinni"
          瀏覽 26
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  先锋影音麻豆 | 国产黄色av | 国产精品高清无码在线播放 | 日本无码一区二区三区 | 日本大色情www成人亚洲 |