1 /* json-glib-1.0.vapi generated by vapigen, do not modify. */
3 [CCode (cprefix = "Json", lower_case_cprefix = "json_")]
6 [CCode (ref_function = "json_array_ref", unref_function = "json_array_unref", type_id = "JSON_TYPE_ARRAY", cheader_filename = "json-glib/json-glib.h")]
8 [CCode (has_construct_function = false)]
10 public void add_array_element (owned Json.Array value);
11 public void add_boolean_element (bool value);
12 public void add_double_element (double value);
13 public void add_element (owned Json.Node node);
14 public void add_int_element (int64 value);
15 public void add_null_element ();
16 public void add_object_element (owned Json.Object value);
17 public void add_string_element (string value);
18 public unowned Json.Node dup_element (uint index_);
19 public void foreach_element (Json.ArrayForeach func);
20 public unowned Json.Array get_array_element (uint index_);
21 public bool get_boolean_element (uint index_);
22 public double get_double_element (uint index_);
23 public unowned Json.Node get_element (uint index_);
24 public GLib.List<weak Json.Node> get_elements ();
25 public int64 get_int_element (uint index_);
26 public uint get_length ();
27 public bool get_null_element (uint index_);
28 public unowned Json.Object get_object_element (uint index_);
29 public unowned string get_string_element (uint index_);
30 public void remove_element (uint index_);
31 public static unowned Json.Array sized_new (uint n_elements);
33 [CCode (cheader_filename = "json-glib/json-glib.h")]
34 public class Generator : GLib.Object {
35 [CCode (has_construct_function = false)]
37 public void set_root (Json.Node node);
38 public string to_data (out size_t length);
39 public bool to_file (string filename) throws GLib.Error;
41 public uint indent { get; set; }
43 public uint indent_char { get; set; }
45 public bool pretty { get; set; }
47 public Json.Node root { owned get; set; }
50 [CCode (copy_function = "json_node_copy", type_id = "JSON_TYPE_NODE", cheader_filename = "json-glib/json-glib.h")]
52 [CCode (has_construct_function = false)]
53 public Node (Json.NodeType type);
54 public Json.Node copy ();
55 public Json.Array dup_array ();
56 public Json.Object dup_object ();
57 public string dup_string ();
58 public unowned Json.Array get_array ();
59 public bool get_boolean ();
60 public double get_double ();
61 public int64 get_int ();
62 public Json.NodeType get_node_type ();
63 public unowned Json.Object get_object ();
64 public unowned Json.Node get_parent ();
65 public unowned string get_string ();
66 public void get_value (out GLib.Value value);
67 public GLib.Type get_value_type ();
68 public bool is_null ();
69 public void set_array (Json.Array array);
70 public void set_boolean (bool value);
71 public void set_double (double value);
72 public void set_int (int64 value);
73 public void set_object (Json.Object object);
74 public void set_parent (Json.Node parent);
75 public void set_string (string value);
76 public void set_value (GLib.Value value);
77 public void take_array (owned Json.Array array);
78 public void take_object (owned Json.Object object);
79 public unowned string type_name ();
82 [CCode (ref_function = "json_object_ref", unref_function = "json_object_unref", type_id = "JSON_TYPE_OBJECT", cheader_filename = "json-glib/json-glib.h")]
84 [CCode (has_construct_function = false)]
86 public void add_member (string member_name, owned Json.Node node);
87 public unowned Json.Node dup_member (string member_name);
88 public void foreach_member (Json.ObjectForeach func);
89 public unowned Json.Array get_array_member (string member_name);
90 public bool get_boolean_member (string member_name);
91 public double get_double_member (string member_name);
92 public int64 get_int_member (string member_name);
93 public unowned Json.Node get_member (string member_name);
94 public GLib.List<weak string> get_members ();
95 public bool get_null_member (string member_name);
96 public unowned Json.Object get_object_member (string member_name);
97 public uint get_size ();
98 public unowned string get_string_member (string member_name);
99 public GLib.List<weak Json.Node> get_values ();
100 public bool has_member (string member_name);
101 public void remove_member (string member_name);
102 public void set_array_member (string member_name, owned Json.Array value);
103 public void set_boolean_member (string member_name, bool value);
104 public void set_double_member (string member_name, double value);
105 public void set_int_member (string member_name, int64 value);
106 public void set_member (string member_name, Json.Node node);
107 public void set_null_member (string member_name);
108 public void set_object_member (string member_name, owned Json.Object value);
109 public void set_string_member (string member_name, string value);
111 [CCode (cheader_filename = "json-glib/json-glib.h")]
112 public class Parser : GLib.Object {
113 [CCode (has_construct_function = false)]
115 public static GLib.Quark error_quark ();
116 public uint get_current_line ();
117 public uint get_current_pos ();
118 public unowned Json.Node get_root ();
119 public bool has_assignment (out unowned string variable_name);
120 public bool load_from_data (string data, ssize_t length = -1) throws GLib.Error;
121 public bool load_from_file (string filename) throws GLib.Error;
122 public virtual signal void array_element (Json.Array array, int index_);
123 public virtual signal void array_end (Json.Array array);
124 public virtual signal void array_start ();
125 public virtual signal void error (void* error);
126 public virtual signal void object_end (Json.Object object);
127 public virtual signal void object_member (Json.Object object, string member_name);
128 public virtual signal void object_start ();
129 public virtual signal void parse_end ();
130 public virtual signal void parse_start ();
132 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
133 public interface Serializable {
134 public bool default_deserialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node);
135 public unowned Json.Node default_serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec);
136 public abstract bool deserialize_property (string property_name, out GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node);
137 public abstract Json.Node serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec);
139 [CCode (cprefix = "JSON_NODE_", cheader_filename = "json-glib/json-glib.h")]
140 public enum NodeType {
146 [CCode (cprefix = "JSON_PARSER_ERROR_", cheader_filename = "json-glib/json-glib.h")]
147 public enum ParserError {
151 [CCode (cheader_filename = "json-glib/json-glib.h")]
152 public delegate void ArrayForeach (Json.Array array, uint index_, Json.Node element_node);
153 [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)]
154 public delegate void* BoxedDeserializeFunc (Json.Node node);
155 [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)]
156 public delegate unowned Json.Node BoxedSerializeFunc (void* boxed);
157 [CCode (cheader_filename = "json-glib/json-glib.h")]
158 public delegate void ObjectForeach (Json.Object object, string member_name, Json.Node member_node);
159 [CCode (cheader_filename = "json-glib/json-glib.h")]
160 public const int MAJOR_VERSION;
161 [CCode (cheader_filename = "json-glib/json-glib.h")]
162 public const int MICRO_VERSION;
163 [CCode (cheader_filename = "json-glib/json-glib.h")]
164 public const int MINOR_VERSION;
165 [CCode (cheader_filename = "json-glib/json-glib.h")]
166 public const int VERSION_HEX;
167 [CCode (cheader_filename = "json-glib/json-glib.h")]
168 public const string VERSION_S;
169 [CCode (cheader_filename = "json-glib/json-glib.h")]
170 public static bool boxed_can_deserialize (GLib.Type gboxed_type, Json.NodeType node_type);
171 [CCode (cheader_filename = "json-glib/json-glib.h")]
172 public static bool boxed_can_serialize (GLib.Type gboxed_type, Json.NodeType node_type);
173 [CCode (cheader_filename = "json-glib/json-glib.h")]
174 public static void* boxed_deserialize (GLib.Type gboxed_type, Json.Node node);
175 [CCode (cheader_filename = "json-glib/json-glib.h")]
176 public static void boxed_register_deserialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedDeserializeFunc deserialize_func);
177 [CCode (cheader_filename = "json-glib/json-glib.h")]
178 public static void boxed_register_serialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedSerializeFunc serialize_func);
179 [CCode (cheader_filename = "json-glib/json-glib.h")]
180 public static unowned Json.Node boxed_serialize (GLib.Type gboxed_type, void* boxed);
181 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
182 public static GLib.Object construct_gobject (GLib.Type gtype, string data, size_t length) throws GLib.Error;
183 [CCode (cheader_filename = "json-glib/json-glib.h")]
184 public static unowned GLib.Object gobject_deserialize (GLib.Type gtype, Json.Node node);
185 [CCode (cheader_filename = "json-glib/json-glib.h")]
186 public static unowned GLib.Object gobject_from_data (GLib.Type gtype, string data, ssize_t length) throws GLib.Error;
187 [CCode (cheader_filename = "json-glib/json-glib.h")]
188 public static unowned Json.Node gobject_serialize (GLib.Object gobject);
189 [CCode (cheader_filename = "json-glib/json-glib.h")]
190 public static string gobject_to_data (GLib.Object gobject, out size_t length);
191 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
192 public static string serialize_gobject (GLib.Object gobject, out size_t length);