#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h"
#include <gmodule.h>
#include <cstring>
#include "rapidjson/reader.h"
#include "rapidjson/writer.h"
Go to the source code of this file.
Classes | |
struct | _FlJsonMessageCodec |
struct | FlValueHandler |
Functions | |
G_DEFINE_TYPE (FlJsonMessageCodec, fl_json_message_codec, fl_message_codec_get_type()) static gboolean write_value(rapidjson | |
static GBytes * | fl_json_message_codec_encode_message (FlMessageCodec *codec, FlValue *message, GError **error) |
static FlValue * | fl_json_message_codec_decode_message (FlMessageCodec *codec, GBytes *message, GError **error) |
static void | fl_json_message_codec_class_init (FlJsonMessageCodecClass *klass) |
static void | fl_json_message_codec_init (FlJsonMessageCodec *self) |
G_MODULE_EXPORT FlJsonMessageCodec * | fl_json_message_codec_new () |
G_MODULE_EXPORT gchar * | fl_json_message_codec_encode (FlJsonMessageCodec *codec, FlValue *value, GError **error) |
G_MODULE_EXPORT FlValue * | fl_json_message_codec_decode (FlJsonMessageCodec *codec, const gchar *text, GError **error) |
|
static |
Definition at line 297 of file fl_json_message_codec.cc.
References fl_json_message_codec_decode_message(), and fl_json_message_codec_encode_message().
G_MODULE_EXPORT FlValue* fl_json_message_codec_decode | ( | FlJsonMessageCodec * | codec, |
const gchar * | text, | ||
GError ** | error | ||
) |
fl_json_message_codec_decode: @codec: an #FlJsonMessageCodec. @text: UTF-8 text in JSON format. @error: (allow-none): #GError location to store the error occurring, or NULL.
Decodes a value from a JSON string.
Returns: an FlValue or NULL on error.
Definition at line 326 of file fl_json_message_codec.cc.
References error, fl_json_message_codec_decode_message(), fl_value_ref(), and value.
Referenced by decode_error_message(), decode_message(), and TEST().
|
static |
Definition at line 258 of file fl_json_message_codec.cc.
References error, FlValueHandler::error, FL_JSON_MESSAGE_CODEC_ERROR, FL_JSON_MESSAGE_CODEC_ERROR_INVALID_JSON, FL_JSON_MESSAGE_CODEC_ERROR_INVALID_UTF8, fl_value_ref(), FlValueHandler::get_head(), and value.
Referenced by fl_json_message_codec_class_init(), and fl_json_message_codec_decode().
G_MODULE_EXPORT gchar* fl_json_message_codec_encode | ( | FlJsonMessageCodec * | codec, |
FlValue * | value, | ||
GError ** | error | ||
) |
fl_json_message_codec_encode: @codec: an #FlJsonMessageCodec. @value: value to encode. @error: (allow-none): #GError location to store the error occurring, or NULL.
Encodes a value to a JSON string.
Returns: a JSON representation of this value or NULL on error.
Definition at line 311 of file fl_json_message_codec.cc.
References buffer, error, and value.
Referenced by encode_error_message(), encode_message(), and TEST().
|
static |
Definition at line 243 of file fl_json_message_codec.cc.
Referenced by fl_json_message_codec_class_init().
|
static |
Definition at line 304 of file fl_json_message_codec.cc.
G_MODULE_EXPORT FlJsonMessageCodec* fl_json_message_codec_new | ( | ) |
Definition at line 306 of file fl_json_message_codec.cc.
Referenced by decode_error_message(), decode_message(), encode_error_message(), encode_message(), fl_json_method_codec_init(), fl_key_channel_responder_new(), fl_settings_handler_new(), MATCHER_P2(), and TEST().
G_DEFINE_TYPE | ( | FlJsonMessageCodec | , |
fl_json_message_codec | , | ||
fl_message_codec_get_type() | |||
) |
Definition at line 20 of file fl_json_message_codec.cc.
References error, FL_JSON_MESSAGE_CODEC_ERROR, FL_JSON_MESSAGE_CODEC_ERROR_INVALID_OBJECT_KEY_TYPE, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE, fl_value_get_bool(), fl_value_get_float(), fl_value_get_float_list(), fl_value_get_int(), fl_value_get_int32_list(), fl_value_get_int64_list(), fl_value_get_length(), fl_value_get_list_value(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_get_string(), fl_value_get_type(), fl_value_get_uint8_list(), FL_VALUE_TYPE_BOOL, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_INT, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_LIST, FL_VALUE_TYPE_MAP, FL_VALUE_TYPE_NULL, FL_VALUE_TYPE_STRING, FL_VALUE_TYPE_UINT8_LIST, i, TRUE, and value.