libpurple/protocols/facebook/json.h

changeset 37415
a06ade737f26
parent 37373
d6291cb2e46a
child 37471
32c1e77d0474
equal deleted inserted replaced
37414:252bb96afbe0 37415:a06ade737f26
165 fb_json_bldr_close(JsonBuilder *bldr, JsonNodeType type, gsize *size); 165 fb_json_bldr_close(JsonBuilder *bldr, JsonNodeType type, gsize *size);
166 166
167 /** 167 /**
168 * fb_json_bldr_arr_begin: 168 * fb_json_bldr_arr_begin:
169 * @bldr: The #JsonBuilder. 169 * @bldr: The #JsonBuilder.
170 * @name: The member name, or #NULL. 170 * @name: The member name or #NULL.
171 * 171 *
172 * Begins an array member in the #JsonBuilder. 172 * Begins an array member in the #JsonBuilder.
173 */ 173 */
174 void 174 void
175 fb_json_bldr_arr_begin(JsonBuilder *bldr, const gchar *name); 175 fb_json_bldr_arr_begin(JsonBuilder *bldr, const gchar *name);
184 fb_json_bldr_arr_end(JsonBuilder *bldr); 184 fb_json_bldr_arr_end(JsonBuilder *bldr);
185 185
186 /** 186 /**
187 * fb_json_bldr_obj_begin: 187 * fb_json_bldr_obj_begin:
188 * @bldr: The #JsonBuilder. 188 * @bldr: The #JsonBuilder.
189 * @name: The member name, or #NULL. 189 * @name: The member name or #NULL.
190 * 190 *
191 * Begins an object member in the #JsonBuilder. 191 * Begins an object member in the #JsonBuilder.
192 */ 192 */
193 void 193 void
194 fb_json_bldr_obj_begin(JsonBuilder *bldr, const gchar *name); 194 fb_json_bldr_obj_begin(JsonBuilder *bldr, const gchar *name);
203 fb_json_bldr_obj_end(JsonBuilder *bldr); 203 fb_json_bldr_obj_end(JsonBuilder *bldr);
204 204
205 /** 205 /**
206 * fb_json_bldr_add_bool: 206 * fb_json_bldr_add_bool:
207 * @bldr: The #JsonBuilder. 207 * @bldr: The #JsonBuilder.
208 * @name: The member name, or #NULL. 208 * @name: The member name or #NULL.
209 * @value: The value. 209 * @value: The value.
210 * 210 *
211 * Adds a boolean memeber to the #JsonBuilder. 211 * Adds a boolean memeber to the #JsonBuilder.
212 */ 212 */
213 void 213 void
214 fb_json_bldr_add_bool(JsonBuilder *bldr, const gchar *name, gboolean value); 214 fb_json_bldr_add_bool(JsonBuilder *bldr, const gchar *name, gboolean value);
215 215
216 /** 216 /**
217 * fb_json_bldr_add_dbl: 217 * fb_json_bldr_add_dbl:
218 * @bldr: The #JsonBuilder. 218 * @bldr: The #JsonBuilder.
219 * @name: The member name, or #NULL. 219 * @name: The member name or #NULL.
220 * @value: The value. 220 * @value: The value.
221 * 221 *
222 * Adds a floating point memeber to the #JsonBuilder. 222 * Adds a floating point memeber to the #JsonBuilder.
223 */ 223 */
224 void 224 void
225 fb_json_bldr_add_dbl(JsonBuilder *bldr, const gchar *name, gdouble value); 225 fb_json_bldr_add_dbl(JsonBuilder *bldr, const gchar *name, gdouble value);
226 226
227 /** 227 /**
228 * fb_json_bldr_add_int: 228 * fb_json_bldr_add_int:
229 * @bldr: The #JsonBuilder. 229 * @bldr: The #JsonBuilder.
230 * @name: The member name, or #NULL. 230 * @name: The member name or #NULL.
231 * @value: The value. 231 * @value: The value.
232 * 232 *
233 * Adds a integer memeber to the #JsonBuilder. 233 * Adds a integer memeber to the #JsonBuilder.
234 */ 234 */
235 void 235 void
236 fb_json_bldr_add_int(JsonBuilder *bldr, const gchar *name, gint64 value); 236 fb_json_bldr_add_int(JsonBuilder *bldr, const gchar *name, gint64 value);
237 237
238 /** 238 /**
239 * fb_json_bldr_add_str: 239 * fb_json_bldr_add_str:
240 * @bldr: The #JsonBuilder. 240 * @bldr: The #JsonBuilder.
241 * @name: The member name, or #NULL. 241 * @name: The member name or #NULL.
242 * @value: The value. 242 * @value: The value.
243 * 243 *
244 * Adds a string memeber to the #JsonBuilder. 244 * Adds a string memeber to the #JsonBuilder.
245 */ 245 */
246 void 246 void
247 fb_json_bldr_add_str(JsonBuilder *bldr, const gchar *name, const gchar *value); 247 fb_json_bldr_add_str(JsonBuilder *bldr, const gchar *name, const gchar *value);
248 248
249 /** 249 /**
250 * fb_json_bldr_add_strf: 250 * fb_json_bldr_add_strf:
251 * @bldr: The #JsonBuilder. 251 * @bldr: The #JsonBuilder.
252 * @name: The member name, or #NULL. 252 * @name: The member name or #NULL.
253 * @format: The format string literal. 253 * @format: The format string literal.
254 * @...: The arguments for @format. 254 * @...: The arguments for @format.
255 * 255 *
256 * Adds a formatted string memeber to the #JsonBuilder. 256 * Adds a formatted string memeber to the #JsonBuilder.
257 */ 257 */
261 G_GNUC_PRINTF(3, 4); 261 G_GNUC_PRINTF(3, 4);
262 262
263 /** 263 /**
264 * fb_json_node_new: 264 * fb_json_node_new:
265 * @data: The string JSON. 265 * @data: The string JSON.
266 * @size: The size of @json, or -1 if null-terminated. 266 * @size: The size of @json or -1 if null-terminated.
267 * @error: The return location for the #GError, or #NULL. 267 * @error: The return location for the #GError or #NULL.
268 * 268 *
269 * Creates a new #JsonNode. The returned #JsonBuilder should be freed 269 * Creates a new #JsonNode. The returned #JsonBuilder should be freed
270 * wuth #json_node_free() when no longer needed. 270 * wuth #json_node_free() when no longer needed.
271 * 271 *
272 * Returns: The new #JsonNode. 272 * Returns: The new #JsonNode.
276 276
277 /** 277 /**
278 * fb_json_node_get: 278 * fb_json_node_get:
279 * @root: The root #JsonNode. 279 * @root: The root #JsonNode.
280 * @expr: The #JsonPath expression. 280 * @expr: The #JsonPath expression.
281 * @error: The return location for the #GError, or #NULL. 281 * @error: The return location for the #GError or #NULL.
282 * 282 *
283 * Gets a new #JsonNode value from a parent #JsonNode with a #JsonPath 283 * Gets a new #JsonNode value from a parent #JsonNode with a #JsonPath
284 * expression. The returned #JsonNode should be freed with 284 * expression. The returned #JsonNode should be freed with
285 * #json_node_free() when no longer needed. 285 * #json_node_free() when no longer needed.
286 * 286 *
304 304
305 /** 305 /**
306 * fb_json_node_get_arr: 306 * fb_json_node_get_arr:
307 * @root: The root #JsonNode. 307 * @root: The root #JsonNode.
308 * @expr: The #JsonPath expression. 308 * @expr: The #JsonPath expression.
309 * @error: The return location for the #GError, or #NULL. 309 * @error: The return location for the #GError or #NULL.
310 * 310 *
311 * Gets a new #JsonArray value from a parent #JsonNode with a #JsonPath 311 * Gets a new #JsonArray value from a parent #JsonNode with a #JsonPath
312 * expression. The returned #JsonArray should be freed with 312 * expression. The returned #JsonArray should be freed with
313 * #json_array_unref() when no longer needed. 313 * #json_array_unref() when no longer needed.
314 * 314 *
319 319
320 /** 320 /**
321 * fb_json_node_get_bool: 321 * fb_json_node_get_bool:
322 * @root: The root #JsonNode. 322 * @root: The root #JsonNode.
323 * @expr: The #JsonPath expression. 323 * @expr: The #JsonPath expression.
324 * @error: The return location for the #GError, or #NULL. 324 * @error: The return location for the #GError or #NULL.
325 * 325 *
326 * Gets a boolean value from a parent #JsonNode with a #JsonPath 326 * Gets a boolean value from a parent #JsonNode with a #JsonPath
327 * expression. 327 * expression.
328 * 328 *
329 * Returns: The boolean value. 329 * Returns: The boolean value.
333 333
334 /** 334 /**
335 * fb_json_node_get_dbl: 335 * fb_json_node_get_dbl:
336 * @root: The root #JsonNode. 336 * @root: The root #JsonNode.
337 * @expr: The #JsonPath expression. 337 * @expr: The #JsonPath expression.
338 * @error: The return location for the #GError, or #NULL. 338 * @error: The return location for the #GError or #NULL.
339 * 339 *
340 * Gets a floating point value from a parent #JsonNode with a #JsonPath 340 * Gets a floating point value from a parent #JsonNode with a #JsonPath
341 * expression. 341 * expression.
342 * 342 *
343 * Returns: The floating point value. 343 * Returns: The floating point value.
347 347
348 /** 348 /**
349 * fb_json_node_get_int: 349 * fb_json_node_get_int:
350 * @root: The root #JsonNode. 350 * @root: The root #JsonNode.
351 * @expr: The #JsonPath expression. 351 * @expr: The #JsonPath expression.
352 * @error: The return location for the #GError, or #NULL. 352 * @error: The return location for the #GError or #NULL.
353 * 353 *
354 * Gets an integer value from a parent #JsonNode with a #JsonPath 354 * Gets an integer value from a parent #JsonNode with a #JsonPath
355 * expression. 355 * expression.
356 * 356 *
357 * Returns: The integer value. 357 * Returns: The integer value.
361 361
362 /** 362 /**
363 * fb_json_node_get_str: 363 * fb_json_node_get_str:
364 * @root: The root #JsonNode. 364 * @root: The root #JsonNode.
365 * @expr: The #JsonPath expression. 365 * @expr: The #JsonPath expression.
366 * @error: The return location for the #GError, or #NULL. 366 * @error: The return location for the #GError or #NULL.
367 * 367 *
368 * Gets an string value from a parent #JsonNode with a #JsonPath 368 * Gets an string value from a parent #JsonNode with a #JsonPath
369 * expression. The returned string should be freed with #g_free() 369 * expression. The returned string should be freed with #g_free()
370 * when no longer needed. 370 * when no longer needed.
371 * 371 *
402 /** 402 /**
403 * fb_json_values_get_root: 403 * fb_json_values_get_root:
404 * @values: The #FbJsonValues. 404 * @values: The #FbJsonValues.
405 * 405 *
406 * Gets the current working root #JsonNode. This is either the current 406 * Gets the current working root #JsonNode. This is either the current
407 * array #JsonNode, or the root #JsonNode. The returned #JsonNode 407 * array #JsonNode or the root #JsonNode. The returned #JsonNode should
408 * should not be freed. 408 * not be freed.
409 */ 409 */
410 JsonNode * 410 JsonNode *
411 fb_json_values_get_root(FbJsonValues *values); 411 fb_json_values_get_root(FbJsonValues *values);
412 412
413 /** 413 /**
423 const gchar *expr); 423 const gchar *expr);
424 424
425 /** 425 /**
426 * fb_json_values_update: 426 * fb_json_values_update:
427 * @values: The #FbJsonValues. 427 * @values: The #FbJsonValues.
428 * @error: The return location for the #GError, or #NULL. 428 * @error: The return location for the #GError or #NULL.
429 * 429 *
430 * Updates the current working root. This should be called after all of 430 * Updates the current working root. This should be called after all of
431 * the #FbJsonValue's have been added with #fb_json_values_add(). If an 431 * the #FbJsonValue's have been added with #fb_json_values_add(). If an
432 * array was set with #fb_json_values_set_array(), then this should be 432 * array was set with #fb_json_values_set_array(), then this should be
433 * called in a while loop, until #FALSE is returned. 433 * called in a while loop, until #FALSE is returned.

mercurial