Esempio n. 1
0
 /// <summary>
 /// Converts the managed object returned from a native callback into its native jsonnet equivalent.
 /// </summary>
 public static JsonnetJsonValue ConvertToNative(JsonnetVmHandle vm, object v)
 {
     return(v switch
     {
         null => NativeMethods.jsonnet_json_make_null(vm),
         string str => NativeMethods.jsonnet_json_make_string(vm, str),
         bool b => NativeMethods.jsonnet_json_make_bool(vm, b),
         int i => NativeMethods.jsonnet_json_make_number(vm, i),
         double d => NativeMethods.jsonnet_json_make_number(vm, d),
         IDictionary <string, object> dictionary => ConvertDictionaryToNative(vm, dictionary),
         IEnumerable enumerable => ConvertEnumerableToNative(vm, enumerable),
         _ => ConvertObjectPropertiesToNative(vm, v)
     });
Esempio n. 2
0
 public static extern void jsonnet_json_destroy(JsonnetVmHandle vm, JsonnetJsonValue v);
Esempio n. 3
0
 public static extern void jsonnet_json_object_append(JsonnetVmHandle vm, JsonnetJsonValue obj, string f, JsonnetJsonValue v);
Esempio n. 4
0
 public static extern JsonnetJsonValue jsonnet_json_make_object(JsonnetVmHandle vm);
Esempio n. 5
0
 public static extern void jsonnet_gc_min_objects(JsonnetVmHandle vm, uint v);
Esempio n. 6
0
 public static extern void jsonnet_jpath_add(JsonnetVmHandle vm, string v);
Esempio n. 7
0
 public static extern void jsonnet_tla_code(JsonnetVmHandle vm, string key, string value);
Esempio n. 8
0
 public static extern void jsonnet_native_callback(
     JsonnetVmHandle vm, string name, JsonnetNativeCallback cb, IntPtr ctx, string[] parms);
Esempio n. 9
0
 public static extern JsonnetJsonValue jsonnet_json_make_string(JsonnetVmHandle vm, string v);
Esempio n. 10
0
 public static extern bool jsonnet_json_extract_null(JsonnetVmHandle vm, JsonnetJsonValue v);
Esempio n. 11
0
 public static extern int jsonnet_json_extract_bool(JsonnetVmHandle vm, JsonnetJsonValue v);
Esempio n. 12
0
 public static extern bool jsonnet_json_extract_number(JsonnetVmHandle vm, JsonnetJsonValue v, out double outVal);
Esempio n. 13
0
 public static extern IntPtr jsonnet_json_extract_string(JsonnetVmHandle vm, JsonnetJsonValue v);
Esempio n. 14
0
 public static extern void jsonnet_string_output(JsonnetVmHandle vm, int v);
Esempio n. 15
0
 public static extern void jsonnet_gc_growth_trigger(JsonnetVmHandle vm, double v);
Esempio n. 16
0
 public static extern IntPtr jsonnet_realloc(JsonnetVmHandle vm, IntPtr buf, UIntPtr sz);
Esempio n. 17
0
 public static extern void jsonnet_import_callback(JsonnetVmHandle vm, JsonnetImportCallback cb, IntPtr ctx);
Esempio n. 18
0
 public static extern JsonnetJsonValue jsonnet_json_make_number(JsonnetVmHandle vm, double v);
Esempio n. 19
0
 public static extern void jsonnet_ext_var(JsonnetVmHandle vm, string key, string value);
Esempio n. 20
0
 public static extern JsonnetJsonValue jsonnet_json_make_bool(JsonnetVmHandle vm, bool v);
Esempio n. 21
0
 public static extern void jsonnet_max_trace(JsonnetVmHandle vm, uint v);
Esempio n. 22
0
 public static extern JsonnetJsonValue jsonnet_json_make_array(JsonnetVmHandle vm);
Esempio n. 23
0
 public static extern void jsonnet_json_array_append(JsonnetVmHandle vm, JsonnetJsonValue arr, JsonnetJsonValue v);
Esempio n. 24
0
 public static extern IntPtr jsonnet_evaluate_snippet(JsonnetVmHandle vm, string filename, string snippet, out bool error);