File indexing completed on 2025-01-18 10:01:42
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 #ifndef __JSON_BUILDER_H__
0024 #define __JSON_BUILDER_H__
0025
0026 #if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
0027 #error "Only <json-glib/json-glib.h> can be included directly."
0028 #endif
0029
0030 #include <json-glib/json-types.h>
0031
0032 G_BEGIN_DECLS
0033
0034 #define JSON_TYPE_BUILDER (json_builder_get_type ())
0035 #define JSON_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_BUILDER, JsonBuilder))
0036 #define JSON_IS_BUILDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_BUILDER))
0037 #define JSON_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), JSON_TYPE_BUILDER, JsonBuilderClass))
0038 #define JSON_IS_BUILDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), JSON_TYPE_BUILDER))
0039 #define JSON_BUILDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), JSON_TYPE_BUILDER, JsonBuilderClass))
0040
0041 typedef struct _JsonBuilder JsonBuilder;
0042 typedef struct _JsonBuilderPrivate JsonBuilderPrivate;
0043 typedef struct _JsonBuilderClass JsonBuilderClass;
0044
0045 struct _JsonBuilder
0046 {
0047
0048 GObject parent_instance;
0049
0050 JsonBuilderPrivate *priv;
0051 };
0052
0053 struct _JsonBuilderClass
0054 {
0055
0056 GObjectClass parent_class;
0057
0058
0059 void (* _json_reserved1) (void);
0060 void (* _json_reserved2) (void);
0061 };
0062
0063 JSON_AVAILABLE_IN_1_0
0064 GType json_builder_get_type (void) G_GNUC_CONST;
0065
0066 JSON_AVAILABLE_IN_1_0
0067 JsonBuilder *json_builder_new (void);
0068 JSON_AVAILABLE_IN_1_2
0069 JsonBuilder *json_builder_new_immutable (void);
0070 JSON_AVAILABLE_IN_1_0
0071 JsonNode *json_builder_get_root (JsonBuilder *builder);
0072 JSON_AVAILABLE_IN_1_0
0073 void json_builder_reset (JsonBuilder *builder);
0074
0075 JSON_AVAILABLE_IN_1_0
0076 JsonBuilder *json_builder_begin_array (JsonBuilder *builder);
0077 JSON_AVAILABLE_IN_1_0
0078 JsonBuilder *json_builder_end_array (JsonBuilder *builder);
0079 JSON_AVAILABLE_IN_1_0
0080 JsonBuilder *json_builder_begin_object (JsonBuilder *builder);
0081 JSON_AVAILABLE_IN_1_0
0082 JsonBuilder *json_builder_end_object (JsonBuilder *builder);
0083
0084 JSON_AVAILABLE_IN_1_0
0085 JsonBuilder *json_builder_set_member_name (JsonBuilder *builder,
0086 const gchar *member_name);
0087 JSON_AVAILABLE_IN_1_0
0088 JsonBuilder *json_builder_add_value (JsonBuilder *builder,
0089 JsonNode *node);
0090 JSON_AVAILABLE_IN_1_0
0091 JsonBuilder *json_builder_add_int_value (JsonBuilder *builder,
0092 gint64 value);
0093 JSON_AVAILABLE_IN_1_0
0094 JsonBuilder *json_builder_add_double_value (JsonBuilder *builder,
0095 gdouble value);
0096 JSON_AVAILABLE_IN_1_0
0097 JsonBuilder *json_builder_add_boolean_value (JsonBuilder *builder,
0098 gboolean value);
0099 JSON_AVAILABLE_IN_1_0
0100 JsonBuilder *json_builder_add_string_value (JsonBuilder *builder,
0101 const gchar *value);
0102 JSON_AVAILABLE_IN_1_0
0103 JsonBuilder *json_builder_add_null_value (JsonBuilder *builder);
0104
0105 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
0106 G_DEFINE_AUTOPTR_CLEANUP_FUNC (JsonBuilder, g_object_unref)
0107 #endif
0108
0109 G_END_DECLS
0110
0111 #endif