[coop] Refactor/reuse mono_value_box_handle/mono_value_box_checked and reduce raw...
[mono-project.git] / mono / utils / json.h
blob03e6503fc9816d58f310493424012fddf1b24aae
1 /**
2 * \file
3 * JSON writer
5 * Author:
6 * Joao Matos (joao.matos@xamarin.com)
8 * Copyright 2015 Xamarin Inc (http://www.xamarin.com)
9 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
12 #ifndef __MONO_UTILS_JSON_H__
13 #define __MONO_UTILS_JSON_H__
15 #include <glib.h>
17 #define JSON_INDENT_VALUE 2
19 typedef struct JsonWriter {
20 GString* text;
21 int indent;
22 } JsonWriter;
24 void mono_json_writer_init (JsonWriter* writer);
25 void mono_json_writer_destroy (JsonWriter* writer);
26 void mono_json_writer_indent(JsonWriter* writer);
27 void mono_json_writer_indent_push(JsonWriter* writer);
28 void mono_json_writer_indent_pop(JsonWriter* writer);
29 void mono_json_writer_vprintf(JsonWriter* writer, const gchar *format, va_list args);
30 void mono_json_writer_printf(JsonWriter* writer, const gchar *format, ...);
31 void mono_json_writer_array_begin(JsonWriter* writer);
32 void mono_json_writer_array_end(JsonWriter* writer);
33 void mono_json_writer_object_begin(JsonWriter* writer);
34 void mono_json_writer_object_end(JsonWriter* writer);
35 void mono_json_writer_object_key(JsonWriter* writer, const gchar* format, ...);
37 #endif