Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:42

0001 /* json-path.h - JSONPath implementation
0002  *
0003  * This file is part of JSON-GLib
0004  * Copyright © 2011  Intel Corp.
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Lesser General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2.1 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Lesser General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Lesser General Public
0017  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
0018  *
0019  * Author:
0020  *   Emmanuele Bassi  <ebassi@linux.intel.com>
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  * JSON_PATH_ERROR:
0040  *
0041  * Error domain for `JsonPath`.
0042  *
0043  * Since: 0.14
0044  */
0045 #define JSON_PATH_ERROR         (json_path_error_quark ())
0046 
0047 /**
0048  * JsonPathError:
0049  * @JSON_PATH_ERROR_INVALID_QUERY: Invalid query
0050  *
0051  * Error codes for `JSON_PATH_ERROR`.
0052  *
0053  * This enumeration can be extended at later date
0054  *
0055  * Since: 0.14
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 /* __JSON_PATH_H__ */