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 Builder : GLib.Object {
35 [CCode (has_construct_function = false)]
37 public unowned Json.Builder add_boolean_value (bool value);
38 public unowned Json.Builder add_double_value (double value);
39 public unowned Json.Builder add_int_value (int64 value);
40 public unowned Json.Builder add_null_value ();
41 public unowned Json.Builder add_string_value (string value);
42 public unowned Json.Builder add_value (Json.Node node);
43 public unowned Json.Builder begin_array ();
44 public unowned Json.Builder begin_object ();
45 public unowned Json.Builder end_array ();
46 public unowned Json.Builder end_object ();
47 public unowned Json.Node get_root ();
49 public unowned Json.Builder set_member_name (string member_name);
51 [CCode (cheader_filename = "json-glib/json-glib.h")]
52 public class Generator : GLib.Object {
53 [CCode (has_construct_function = false)]
55 public void set_root (Json.Node node);
56 public string to_data (out size_t length);
57 public bool to_file (string filename) throws GLib.Error;
58 public bool to_stream (GLib.OutputStream stream, GLib.Cancellable cancellable) throws GLib.Error;
60 public uint indent { get; set; }
62 public uint indent_char { get; set; }
64 public bool pretty { get; set; }
66 public Json.Node root { owned get; set; }
69 [CCode (copy_function = "json_node_copy", type_id = "JSON_TYPE_NODE", cheader_filename = "json-glib/json-glib.h")]
71 [CCode (has_construct_function = false)]
72 public Node (Json.NodeType type);
73 public Json.Node copy ();
74 public Json.Array dup_array ();
75 public Json.Object dup_object ();
76 public string dup_string ();
77 public unowned Json.Array get_array ();
78 public bool get_boolean ();
79 public double get_double ();
80 public int64 get_int ();
81 public Json.NodeType get_node_type ();
82 public unowned Json.Object get_object ();
83 public unowned Json.Node get_parent ();
84 public unowned string get_string ();
85 public void get_value (out GLib.Value value);
86 public GLib.Type get_value_type ();
87 public bool is_null ();
88 public void set_array (Json.Array array);
89 public void set_boolean (bool value);
90 public void set_double (double value);
91 public void set_int (int64 value);
92 public void set_object (Json.Object object);
93 public void set_parent (Json.Node parent);
94 public void set_string (string value);
95 public void set_value (GLib.Value value);
96 public void take_array (owned Json.Array array);
97 public void take_object (owned Json.Object object);
98 public unowned string type_name ();
101 [CCode (ref_function = "json_object_ref", unref_function = "json_object_unref", type_id = "JSON_TYPE_OBJECT", cheader_filename = "json-glib/json-glib.h")]
102 public class Object {
103 [CCode (has_construct_function = false)]
105 public void add_member (string member_name, owned Json.Node node);
106 public unowned Json.Node dup_member (string member_name);
107 public void foreach_member (Json.ObjectForeach func);
108 public unowned Json.Array get_array_member (string member_name);
109 public bool get_boolean_member (string member_name);
110 public double get_double_member (string member_name);
111 public int64 get_int_member (string member_name);
112 public unowned Json.Node get_member (string member_name);
113 public GLib.List<weak string> get_members ();
114 public bool get_null_member (string member_name);
115 public unowned Json.Object get_object_member (string member_name);
116 public uint get_size ();
117 public unowned string get_string_member (string member_name);
118 public GLib.List<weak Json.Node> get_values ();
119 public bool has_member (string member_name);
120 public void remove_member (string member_name);
121 public void set_array_member (string member_name, owned Json.Array value);
122 public void set_boolean_member (string member_name, bool value);
123 public void set_double_member (string member_name, double value);
124 public void set_int_member (string member_name, int64 value);
125 public void set_member (string member_name, Json.Node node);
126 public void set_null_member (string member_name);
127 public void set_object_member (string member_name, owned Json.Object value);
128 public void set_string_member (string member_name, string value);
130 [CCode (cheader_filename = "json-glib/json-glib.h")]
131 public class Parser : GLib.Object {
132 [CCode (has_construct_function = false)]
134 public static GLib.Quark error_quark ();
135 public uint get_current_line ();
136 public uint get_current_pos ();
137 public unowned Json.Node get_root ();
138 public bool has_assignment (out unowned string variable_name);
139 public bool load_from_data (string data, ssize_t length = -1) throws GLib.Error;
140 public bool load_from_file (string filename) throws GLib.Error;
141 public bool load_from_stream (GLib.InputStream stream, GLib.Cancellable cancellable) throws GLib.Error;
142 public async bool load_from_stream_async (GLib.InputStream stream, GLib.Cancellable cancellable) throws GLib.Error;
143 public virtual signal void array_element (Json.Array array, int index_);
144 public virtual signal void array_end (Json.Array array);
145 public virtual signal void array_start ();
146 public virtual signal void error (void* error);
147 public virtual signal void object_end (Json.Object object);
148 public virtual signal void object_member (Json.Object object, string member_name);
149 public virtual signal void object_start ();
150 public virtual signal void parse_end ();
151 public virtual signal void parse_start ();
153 [CCode (cheader_filename = "json-glib/json-glib.h")]
154 public class Reader : GLib.Object {
155 [CCode (has_construct_function = false)]
156 public Reader (Json.Node node);
157 public int count_elements ();
158 public int count_members ();
159 public void end_element ();
160 public void end_member ();
161 public static GLib.Quark error_quark ();
162 public bool get_boolean_value ();
163 public double get_double_value ();
164 public unowned GLib.Error get_error ();
165 public int64 get_int_value ();
166 public bool get_null_value ();
167 public unowned string get_string_value ();
168 public unowned Json.Node get_value ();
169 public bool is_array ();
170 public bool is_object ();
171 public bool is_value ();
172 public bool read_element (uint index_);
173 public bool read_member (string member_name);
174 public void set_root (Json.Node root);
176 public Json.Node root { owned get; set construct; }
178 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
179 public interface Serializable {
180 public bool default_deserialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node);
181 public unowned Json.Node default_serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec);
182 public abstract bool deserialize_property (string property_name, out GLib.Value value, GLib.ParamSpec pspec, Json.Node property_node);
183 public abstract Json.Node serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec);
185 [CCode (cprefix = "JSON_NODE_", cheader_filename = "json-glib/json-glib.h")]
186 public enum NodeType {
192 [CCode (cprefix = "JSON_PARSER_ERROR_", cheader_filename = "json-glib/json-glib.h")]
193 public enum ParserError {
201 [CCode (cprefix = "JSON_READER_ERROR_", cheader_filename = "json-glib/json-glib.h")]
202 public enum ReaderError {
208 [CCode (cheader_filename = "json-glib/json-glib.h")]
209 public delegate void ArrayForeach (Json.Array array, uint index_, Json.Node element_node);
210 [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)]
211 public delegate void* BoxedDeserializeFunc (Json.Node node);
212 [CCode (cheader_filename = "json-glib/json-glib.h", has_target = false)]
213 public delegate unowned Json.Node BoxedSerializeFunc (void* boxed);
214 [CCode (cheader_filename = "json-glib/json-glib.h")]
215 public delegate void ObjectForeach (Json.Object object, string member_name, Json.Node member_node);
216 [CCode (cheader_filename = "json-glib/json-glib.h")]
217 public const int MAJOR_VERSION;
218 [CCode (cheader_filename = "json-glib/json-glib.h")]
219 public const int MICRO_VERSION;
220 [CCode (cheader_filename = "json-glib/json-glib.h")]
221 public const int MINOR_VERSION;
222 [CCode (cheader_filename = "json-glib/json-glib.h")]
223 public const int VERSION_HEX;
224 [CCode (cheader_filename = "json-glib/json-glib.h")]
225 public const string VERSION_S;
226 [CCode (cheader_filename = "json-glib/json-glib.h")]
227 public static bool boxed_can_deserialize (GLib.Type gboxed_type, Json.NodeType node_type);
228 [CCode (cheader_filename = "json-glib/json-glib.h")]
229 public static bool boxed_can_serialize (GLib.Type gboxed_type, Json.NodeType node_type);
230 [CCode (cheader_filename = "json-glib/json-glib.h")]
231 public static void* boxed_deserialize (GLib.Type gboxed_type, Json.Node node);
232 [CCode (cheader_filename = "json-glib/json-glib.h")]
233 public static void boxed_register_deserialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedDeserializeFunc deserialize_func);
234 [CCode (cheader_filename = "json-glib/json-glib.h")]
235 public static void boxed_register_serialize_func (GLib.Type gboxed_type, Json.NodeType node_type, Json.BoxedSerializeFunc serialize_func);
236 [CCode (cheader_filename = "json-glib/json-glib.h")]
237 public static unowned Json.Node boxed_serialize (GLib.Type gboxed_type, void* boxed);
238 [Deprecated (since = "0.10", replacement = "Json.gobject_from_data")]
239 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
240 public static GLib.Object construct_gobject (GLib.Type gtype, string data, size_t length) throws GLib.Error;
241 [CCode (cheader_filename = "json-glib/json-glib.h")]
242 public static GLib.Object gobject_deserialize (GLib.Type gtype, Json.Node node);
243 [CCode (cheader_filename = "json-glib/json-glib.h")]
244 public static GLib.Object gobject_from_data (GLib.Type gtype, string data, ssize_t length = -1) throws GLib.Error;
245 [CCode (cheader_filename = "json-glib/json-glib.h")]
246 public static Json.Node gobject_serialize (GLib.Object gobject);
247 [CCode (cheader_filename = "json-glib/json-glib.h")]
248 public static string gobject_to_data (GLib.Object gobject, out size_t length);
249 [Deprecated (since = "0.10", replacement = "Json.gobject_to_data")]
250 [CCode (cheader_filename = "json-glib/json-glib.h,json-glib/json-gobject.h")]
251 public static string serialize_gobject (GLib.Object gobject, out size_t length);