[System] Add new 'Mono.Security.Interface.MonoTlsProviderFactory' callback to let...
[mono.git] / mono / utils / json.h
1 /*
2  * json.h: JSON writer
3  *
4  * Author:
5  *   Joao Matos (joao.matos@xamarin.com)
6  *
7  * Copyright 2015 Xamarin Inc (http://www.xamarin.com)
8  */
9
10 #ifndef __MONO_UTILS_JSON_H__
11 #define __MONO_UTILS_JSON_H__
12
13  #include <glib.h>
14
15 #define JSON_INDENT_VALUE 2
16
17 typedef struct JsonWriter {
18         GString* text;
19         int indent;
20 } JsonWriter;
21
22 void mono_json_writer_init (JsonWriter* writer);
23 void mono_json_writer_destroy (JsonWriter* writer);
24 void mono_json_writer_indent(JsonWriter* writer);
25 void mono_json_writer_indent_push(JsonWriter* writer);
26 void mono_json_writer_indent_pop(JsonWriter* writer);
27 void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
28 void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...);
29 void mono_json_writer_array_begin(JsonWriter* writer);
30 void mono_json_writer_array_end(JsonWriter* writer);
31 void mono_json_writer_object_begin(JsonWriter* writer);
32 void mono_json_writer_object_end(JsonWriter* writer);
33 void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
34
35 #endif