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_PATH_H__
0024 #define __JSON_PATH_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_PATH (json_path_get_type ())
0035 #define JSON_PATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), JSON_TYPE_PATH, JsonPath))
0036 #define JSON_IS_PATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), JSON_TYPE_PATH))
0037
0038
0039
0040
0041
0042
0043
0044
0045 #define JSON_PATH_ERROR (json_path_error_quark ())
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 typedef enum {
0058 JSON_PATH_ERROR_INVALID_QUERY
0059 } JsonPathError;
0060
0061 typedef struct _JsonPath JsonPath;
0062 typedef struct _JsonPathClass JsonPathClass;
0063
0064 JSON_AVAILABLE_IN_1_0
0065 GType json_path_get_type (void) G_GNUC_CONST;
0066 JSON_AVAILABLE_IN_1_0
0067 GQuark json_path_error_quark (void);
0068
0069 JSON_AVAILABLE_IN_1_0
0070 JsonPath * json_path_new (void);
0071
0072 JSON_AVAILABLE_IN_1_0
0073 gboolean json_path_compile (JsonPath *path,
0074 const char *expression,
0075 GError **error);
0076 JSON_AVAILABLE_IN_1_0
0077 JsonNode * json_path_match (JsonPath *path,
0078 JsonNode *root);
0079
0080 JSON_AVAILABLE_IN_1_0
0081 JsonNode * json_path_query (const char *expression,
0082 JsonNode *root,
0083 GError **error);
0084
0085 #ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
0086 G_DEFINE_AUTOPTR_CLEANUP_FUNC (JsonPath, g_object_unref)
0087 #endif
0088
0089 G_END_DECLS
0090
0091 #endif