#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_message_codec.h"#include <gmodule.h>#include <cstring>Go to the source code of this file.
Functions | |
| G_DEFINE_TYPE (FlStandardMessageCodec, fl_standard_message_codec, fl_message_codec_get_type()) static void write_uint8(GByteArray *buffer | |
| static void | write_uint16 (GByteArray *buffer, uint16_t value) |
| static void | write_uint32 (GByteArray *buffer, uint32_t value) |
| static void | write_int32 (GByteArray *buffer, int32_t value) |
| static void | write_int64 (GByteArray *buffer, int64_t value) |
| static void | write_float64 (GByteArray *buffer, double value) |
| static void | write_align (GByteArray *buffer, guint align) |
| static gboolean | check_size (GBytes *buffer, size_t offset, size_t required, GError **error) |
| static gboolean | read_align (GBytes *buffer, size_t *offset, size_t align, GError **error) |
| static const uint8_t * | get_data (GBytes *buffer, size_t *offset) |
| static gboolean | read_uint8 (GBytes *buffer, size_t *offset, uint8_t *value, GError **error) |
| static gboolean | read_uint16 (GBytes *buffer, size_t *offset, uint16_t *value, GError **error) |
| static gboolean | read_uint32 (GBytes *buffer, size_t *offset, uint32_t *value, GError **error) |
| static FlValue * | read_int32_value (GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_int64_value (GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_float64_value (GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_string_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_uint8_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_int32_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_int64_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_float32_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_float64_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_list_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static FlValue * | read_map_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
| static GBytes * | fl_standard_message_codec_encode_message (FlMessageCodec *codec, FlValue *message, GError **error) |
| static FlValue * | fl_standard_message_codec_decode_message (FlMessageCodec *codec, GBytes *message, GError **error) |
| static gboolean | fl_standard_message_codec_real_write_value (FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error) |
| static FlValue * | fl_standard_message_codec_read_value_of_type (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, int type, GError **error) |
| static void | fl_standard_message_codec_class_init (FlStandardMessageCodecClass *klass) |
| static void | fl_standard_message_codec_init (FlStandardMessageCodec *self) |
| G_MODULE_EXPORT FlStandardMessageCodec * | fl_standard_message_codec_new () |
| G_MODULE_EXPORT void | fl_standard_message_codec_write_size (FlStandardMessageCodec *codec, GByteArray *buffer, uint32_t size) |
| G_MODULE_EXPORT gboolean | fl_standard_message_codec_read_size (FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, uint32_t *value, GError **error) |
| G_MODULE_EXPORT gboolean | fl_standard_message_codec_write_value (FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error) |
| G_MODULE_EXPORT FlValue * | fl_standard_message_codec_read_value (FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error) |
Variables | |
| static constexpr int | kValueNull = 0 |
| static constexpr int | kValueTrue = 1 |
| static constexpr int | kValueFalse = 2 |
| static constexpr int | kValueInt32 = 3 |
| static constexpr int | kValueInt64 = 4 |
| static constexpr int | kValueFloat64 = 6 |
| static constexpr int | kValueString = 7 |
| static constexpr int | kValueUint8List = 8 |
| static constexpr int | kValueInt32List = 9 |
| static constexpr int | kValueInt64List = 10 |
| static constexpr int | kValueFloat64List = 11 |
| static constexpr int | kValueList = 12 |
| static constexpr int | kValueMap = 13 |
| static constexpr int | kValueFloat32List = 14 |
| uint8_t | value |
|
static |
Definition at line 73 of file fl_standard_message_codec.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA, and TRUE.
Referenced by read_align(), read_float32_list_value(), read_float64_list_value(), read_float64_value(), read_int32_list_value(), read_int32_value(), read_int64_list_value(), read_int64_value(), read_string_value(), read_uint16(), read_uint32(), read_uint8(), and read_uint8_list_value().
|
static |
Definition at line 625 of file fl_standard_message_codec.cc.
References fl_standard_message_codec_decode_message(), fl_standard_message_codec_encode_message(), fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
static |
Definition at line 415 of file fl_standard_message_codec.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA, fl_standard_message_codec_read_value(), fl_value_new_null(), fl_value_ref(), g_autoptr(), message, self, and value.
Referenced by fl_standard_message_codec_class_init().
|
static |
Definition at line 400 of file fl_standard_message_codec.cc.
References error, fl_standard_message_codec_write_value(), g_autoptr(), message, and self.
Referenced by fl_standard_message_codec_class_init().
|
static |
Definition at line 635 of file fl_standard_message_codec.cc.
| G_MODULE_EXPORT FlStandardMessageCodec * fl_standard_message_codec_new | ( | ) |
Definition at line 637 of file fl_standard_message_codec.cc.
Referenced by decode_error_value(), decode_message(), decode_semantic_data(), encode_message(), fl_accessible_text_field_perform_action(), fl_mock_binary_messenger_send_standard_message(), fl_mock_binary_messenger_set_standard_message_channel(), fl_mock_binary_messenger_standard_message_channel_respond(), fl_standard_method_codec_new(), perform_set_selection_action(), perform_set_text_action(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| G_MODULE_EXPORT gboolean fl_standard_message_codec_read_size | ( | FlStandardMessageCodec * | codec, |
| GBytes * | buffer, | ||
| size_t * | offset, | ||
| uint32_t * | value, | ||
| GError ** | error | ||
| ) |
fl_standard_message_codec_read_size: @codec: an #FlStandardMessageCodec. @buffer: buffer to read from. @offset: (inout): read position in @buffer. @value: location to read size. @error: (allow-none): #GError location to store the error occurring, or NULL.
Reads a size field in Flutter Standard encoding.
This method is intended for use by subclasses overriding FlStandardMessageCodec::read_value_of_type.
Returns: TRUE on success.
Definition at line 658 of file fl_standard_message_codec.cc.
References error, read_uint16(), read_uint32(), read_uint8(), TRUE, and value.
Referenced by read_custom_value(), read_custom_value1(), read_float32_list_value(), read_float64_list_value(), read_int32_list_value(), read_int64_list_value(), read_list_value(), read_map_value(), read_string_value(), and read_uint8_list_value().
| G_MODULE_EXPORT FlValue * fl_standard_message_codec_read_value | ( | FlStandardMessageCodec * | codec, |
| GBytes * | buffer, | ||
| size_t * | offset, | ||
| GError ** | error | ||
| ) |
fl_standard_message_codec_read_value: @codec: an #FlStandardMessageCodec. @buffer: buffer to read from. @offset: (inout): read position in @buffer. @value: location to read size. @error: (allow-none): #GError location to store the error occurring, or NULL.
Reads an FlValue in Flutter Standard encoding.
This method is intended for use by subclasses overriding FlStandardMessageCodec::read_value_of_type.
Returns: a new FlValue or NULL on error.
Definition at line 694 of file fl_standard_message_codec.cc.
References error, read_uint8(), self, and type.
Referenced by fl_standard_message_codec_decode_message(), fl_standard_method_codec_decode_method_call(), fl_standard_method_codec_decode_response(), read_list_value(), and read_map_value().
|
static |
Definition at line 580 of file fl_standard_message_codec.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE, fl_value_new_bool(), fl_value_new_null(), fl_value_ref(), g_autoptr(), kValueFalse, kValueFloat32List, kValueFloat64, kValueFloat64List, kValueInt32, kValueInt32List, kValueInt64, kValueInt64List, kValueList, kValueMap, kValueNull, kValueString, kValueTrue, kValueUint8List, read_float32_list_value(), read_float64_list_value(), read_float64_value(), read_int32_list_value(), read_int32_value(), read_int64_list_value(), read_int64_value(), read_list_value(), read_map_value(), read_string_value(), read_uint8_list_value(), self, TRUE, type, and value.
Referenced by fl_standard_message_codec_class_init().
|
static |
Definition at line 444 of file fl_standard_message_codec.cc.
References error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE, fl_standard_message_codec_write_size(), fl_standard_message_codec_write_value(), fl_value_get_bool(), fl_value_get_float(), fl_value_get_float32_list(), 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_CUSTOM, FL_VALUE_TYPE_FLOAT, FL_VALUE_TYPE_FLOAT32_LIST, 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, g_byte_array_append(), i, INT32_MAX, INT32_MIN, kValueFalse, kValueFloat32List, kValueFloat64, kValueFloat64List, kValueInt32, kValueInt32List, kValueInt64, kValueInt64List, kValueList, kValueMap, kValueNull, kValueString, kValueTrue, kValueUint8List, length, self, text, TRUE, value, write_align(), write_float64(), write_int32(), and write_int64().
Referenced by fl_standard_message_codec_class_init().
| G_MODULE_EXPORT void fl_standard_message_codec_write_size | ( | FlStandardMessageCodec * | codec, |
| GByteArray * | buffer, | ||
| uint32_t | size | ||
| ) |
fl_standard_message_codec_write_size: @codec: an #FlStandardMessageCodec. @buffer: buffer to write into. @size: size value to write.
Writes a size field in Flutter Standard encoding.
Definition at line 642 of file fl_standard_message_codec.cc.
References write_uint16(), and write_uint32().
Referenced by fl_standard_message_codec_real_write_value().
| G_MODULE_EXPORT gboolean fl_standard_message_codec_write_value | ( | FlStandardMessageCodec * | codec, |
| GByteArray * | buffer, | ||
| FlValue * | value, | ||
| GError ** | error | ||
| ) |
fl_standard_message_codec_write_value: @codec: an #FlStandardMessageCodec. @buffer: buffer to write into. @value: (allow-none): value to write. @error: (allow-none): #GError location to store the error occurring, or NULL.
Writes an FlValue in Flutter Standard encoding.
This method is intended for use by subclasses overriding FlStandardMessageCodec::write_value.
Returns: TRUE on success.
Definition at line 686 of file fl_standard_message_codec.cc.
References error, self, and value.
Referenced by fl_standard_message_codec_encode_message(), fl_standard_message_codec_real_write_value(), fl_standard_method_codec_encode_error_envelope(), fl_standard_method_codec_encode_method_call(), and fl_standard_method_codec_encode_success_envelope().
| G_DEFINE_TYPE | ( | FlStandardMessageCodec | , |
| fl_standard_message_codec | , | ||
| fl_message_codec_get_type() | |||
| ) |
|
static |
Definition at line 104 of file fl_standard_message_codec.cc.
Referenced by read_float32_list_value(), read_float64_list_value(), read_float64_value(), read_int32_list_value(), read_int32_value(), read_int64_list_value(), read_int64_value(), read_string_value(), read_uint16(), read_uint32(), read_uint8(), and read_uint8_list_value().
|
static |
Definition at line 86 of file fl_standard_message_codec.cc.
References check_size(), error, and TRUE.
Referenced by read_float32_list_value(), read_float64_list_value(), read_float64_value(), read_int32_list_value(), and read_int64_list_value().
|
static |
Definition at line 297 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_float32_list(), get_data(), length, read_align(), self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 321 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_float_list(), get_data(), length, read_align(), self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 189 of file fl_standard_message_codec.cc.
References check_size(), error, fl_value_new_float(), get_data(), read_align(), and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 249 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_int32_list(), get_data(), length, read_align(), self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 157 of file fl_standard_message_codec.cc.
References check_size(), error, fl_value_new_int(), get_data(), and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 273 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_int64_list(), get_data(), length, read_align(), self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 173 of file fl_standard_message_codec.cc.
References check_size(), error, fl_value_new_int(), get_data(), and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 345 of file fl_standard_message_codec.cc.
References error, fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value(), fl_value_append(), fl_value_new_list(), fl_value_ref(), g_autoptr(), i, length, and self.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 371 of file fl_standard_message_codec.cc.
References error, fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value(), fl_value_new_map(), fl_value_ref(), fl_value_set(), g_autoptr(), i, key, length, self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 208 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_string_sized(), get_data(), length, self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 126 of file fl_standard_message_codec.cc.
References check_size(), error, get_data(), TRUE, and value.
Referenced by fl_standard_message_codec_read_size().
|
static |
Definition at line 141 of file fl_standard_message_codec.cc.
References check_size(), error, get_data(), TRUE, and value.
Referenced by fl_standard_message_codec_read_size().
|
static |
Definition at line 111 of file fl_standard_message_codec.cc.
References check_size(), error, get_data(), TRUE, and value.
Referenced by fl_standard_message_codec_read_size(), and fl_standard_message_codec_read_value().
|
static |
Definition at line 229 of file fl_standard_message_codec.cc.
References check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_uint8_list(), get_data(), length, self, and value.
Referenced by fl_standard_message_codec_read_value_of_type().
|
static |
Definition at line 66 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_real_write_value().
|
static |
Definition at line 60 of file fl_standard_message_codec.cc.
References g_byte_array_append(), and value.
Referenced by fl_standard_message_codec_real_write_value().
|
static |
Definition at line 50 of file fl_standard_message_codec.cc.
References g_byte_array_append(), and value.
Referenced by fl_standard_message_codec_real_write_value().
|
static |
Definition at line 55 of file fl_standard_message_codec.cc.
References g_byte_array_append(), and value.
Referenced by fl_standard_message_codec_real_write_value().
|
static |
Definition at line 40 of file fl_standard_message_codec.cc.
References g_byte_array_append(), and value.
Referenced by fl_standard_message_codec_write_size().
|
static |
Definition at line 45 of file fl_standard_message_codec.cc.
References g_byte_array_append(), and value.
Referenced by fl_standard_message_codec_write_size().
|
staticconstexpr |
Definition at line 17 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 28 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 20 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 25 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 18 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 23 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 19 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 24 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 26 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 27 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 15 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 21 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 16 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
|
staticconstexpr |
Definition at line 22 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_read_value_of_type(), and fl_standard_message_codec_real_write_value().
| uint8_t value |
Definition at line 36 of file fl_standard_message_codec.cc.
Referenced by fl_standard_message_codec_decode_message(), fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value_of_type(), fl_standard_message_codec_real_write_value(), fl_standard_message_codec_write_value(), read_float32_list_value(), read_float64_list_value(), read_float64_value(), read_int32_list_value(), read_int32_value(), read_int64_list_value(), read_int64_value(), read_map_value(), read_string_value(), read_uint16(), read_uint32(), read_uint8(), read_uint8_list_value(), write_float64(), write_int32(), write_int64(), write_uint16(), and write_uint32().