1 /* json-path.h - JSONPath implementation
3 * This file is part of JSON-GLib
4 * Copyright © 2011 Intel Corp.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 * Emmanuele Bassi <ebassi@linux.intel.com>
23 #if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
24 #error "Only <json-glib/json-glib.h> can be included directly."
27 #ifndef __JSON_PATH_H__
28 #define __JSON_PATH_H__
30 #include <json-glib/json-types.h>
34 #define JSON_TYPE_PATH (json_path_get_type ())
35 #define JSON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_PATH, JsonPath))
36 #define JSON_IS_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_PATH))
41 * Error domain for #JsonPath errors
45 #define JSON_PATH_ERROR (json_path_error_quark ())
49 * @JSON_PATH_ERROR_INVALID_QUERY: Invalid query
51 * Error code enumeration for the %JSON_PATH_ERROR domain.
56 JSON_PATH_ERROR_INVALID_QUERY
62 * The <structname>JsonPath</structname> structure is an opaque object
63 * whose members cannot be directly accessed except through the provided
68 typedef struct _JsonPath JsonPath;
73 * The <structname>JsonPathClass</structname> structure is an opaque
74 * object class whose members cannot be directly accessed.
78 typedef struct _JsonPathClass JsonPathClass;
80 GType json_path_get_type (void) G_GNUC_CONST;
81 GQuark json_path_error_quark (void);
83 JsonPath * json_path_new (void);
85 gboolean json_path_compile (JsonPath *path,
86 const char *expression,
88 JsonNode * json_path_match (JsonPath *path,
91 JsonNode * json_path_query (const char *expression,
97 #endif /* __JSON_PATH_H__ */