From b6546a62362bafcb0aa2d97175a15c4218cc6023 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 9 Jun 2015 12:23:12 +0100 Subject: Add simple JSON/string utilities Wrap JsonParser and JsonGenerator in simple, easy to call functions that manage the objects for you. --- json-glib/json-utils.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 json-glib/json-utils.h (limited to 'json-glib/json-utils.h') diff --git a/json-glib/json-utils.h b/json-glib/json-utils.h new file mode 100644 index 0000000..e709ecd --- /dev/null +++ b/json-glib/json-utils.h @@ -0,0 +1,40 @@ +/* json-utils.h - JSON utility API + * + * This file is part of JSON-GLib + * Copyright 2015 Emmanuele Bassi + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#ifndef __JSON_UTILS_H__ +#define __JSON_UTILS_H__ + +#if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION) +#error "Only can be included directly." +#endif + +#include + +G_BEGIN_DECLS + +JSON_AVAILABLE_IN_1_2 +JsonNode * json_from_string (const char *str, + GError **error); +JSON_AVAILABLE_IN_1_2 +char * json_to_string (JsonNode *node, + gboolean pretty); + +G_END_DECLS + +#endif /* __JSON_UTILS_H__ */ -- cgit v1.2.1