#include "flutter/shell/platform/linux/public/flutter_linux/fl_value.h"
#include <gmodule.h>
#include <cstring>
Go to the source code of this file.
Classes | |
struct | _FlValue |
struct | FlValueBool |
struct | FlValueInt |
struct | FlValueDouble |
struct | FlValueString |
struct | FlValueUint8List |
struct | FlValueInt32List |
struct | FlValueInt64List |
struct | FlValueFloat32List |
struct | FlValueFloatList |
struct | FlValueList |
struct | FlValueMap |
Functions | |
static FlValue * | fl_value_new (FlValueType type, size_t size) |
static void | fl_value_destroy (gpointer value) |
static ssize_t | fl_value_lookup_index (FlValue *self, FlValue *key) |
static void | int_to_string (int64_t value, GString *buffer) |
static void | float_to_string (double value, GString *buffer) |
static void | value_to_string (FlValue *value, GString *buffer) |
G_MODULE_EXPORT FlValue * | fl_value_new_null () |
G_MODULE_EXPORT FlValue * | fl_value_new_bool (bool value) |
G_MODULE_EXPORT FlValue * | fl_value_new_int (int64_t value) |
G_MODULE_EXPORT FlValue * | fl_value_new_float (double value) |
G_MODULE_EXPORT FlValue * | fl_value_new_string (const gchar *value) |
G_MODULE_EXPORT FlValue * | fl_value_new_string_sized (const gchar *value, size_t value_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_uint8_list (const uint8_t *data, size_t data_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_uint8_list_from_bytes (GBytes *data) |
G_MODULE_EXPORT FlValue * | fl_value_new_int32_list (const int32_t *data, size_t data_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_int64_list (const int64_t *data, size_t data_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_float32_list (const float *data, size_t data_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_float_list (const double *data, size_t data_length) |
G_MODULE_EXPORT FlValue * | fl_value_new_list () |
G_MODULE_EXPORT FlValue * | fl_value_new_list_from_strv (const gchar *const *str_array) |
G_MODULE_EXPORT FlValue * | fl_value_new_map () |
G_MODULE_EXPORT FlValue * | fl_value_ref (FlValue *self) |
G_MODULE_EXPORT void | fl_value_unref (FlValue *self) |
G_MODULE_EXPORT FlValueType | fl_value_get_type (FlValue *self) |
G_MODULE_EXPORT bool | fl_value_equal (FlValue *a, FlValue *b) |
G_MODULE_EXPORT void | fl_value_append (FlValue *self, FlValue *value) |
G_MODULE_EXPORT void | fl_value_append_take (FlValue *self, FlValue *value) |
G_MODULE_EXPORT void | fl_value_set (FlValue *self, FlValue *key, FlValue *value) |
G_MODULE_EXPORT void | fl_value_set_take (FlValue *self, FlValue *key, FlValue *value) |
G_MODULE_EXPORT void | fl_value_set_string (FlValue *self, const gchar *key, FlValue *value) |
G_MODULE_EXPORT void | fl_value_set_string_take (FlValue *self, const gchar *key, FlValue *value) |
G_MODULE_EXPORT bool | fl_value_get_bool (FlValue *self) |
G_MODULE_EXPORT int64_t | fl_value_get_int (FlValue *self) |
G_MODULE_EXPORT double | fl_value_get_float (FlValue *self) |
const G_MODULE_EXPORT gchar * | fl_value_get_string (FlValue *self) |
const G_MODULE_EXPORT uint8_t * | fl_value_get_uint8_list (FlValue *self) |
const G_MODULE_EXPORT int32_t * | fl_value_get_int32_list (FlValue *self) |
const G_MODULE_EXPORT int64_t * | fl_value_get_int64_list (FlValue *self) |
const G_MODULE_EXPORT float * | fl_value_get_float32_list (FlValue *self) |
const G_MODULE_EXPORT double * | fl_value_get_float_list (FlValue *self) |
G_MODULE_EXPORT size_t | fl_value_get_length (FlValue *self) |
G_MODULE_EXPORT FlValue * | fl_value_get_list_value (FlValue *self, size_t index) |
G_MODULE_EXPORT FlValue * | fl_value_get_map_key (FlValue *self, size_t index) |
G_MODULE_EXPORT FlValue * | fl_value_get_map_value (FlValue *self, size_t index) |
G_MODULE_EXPORT FlValue * | fl_value_lookup (FlValue *self, FlValue *key) |
G_MODULE_EXPORT FlValue * | fl_value_lookup_string (FlValue *self, const gchar *key) |
G_MODULE_EXPORT gchar * | fl_value_to_string (FlValue *value) |
fl_value_append: @value: an FlValue of type FL_VALUE_TYPE_LIST. @child: an FlValue.
Adds @child to the end of @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_LIST is a programming error.
Definition at line 552 of file fl_value.cc.
References fl_value_append_take(), fl_value_ref(), FL_VALUE_TYPE_LIST, self, and value.
Referenced by FlValueHandler::add(), cancel_channel(), listen_channel(), read_list_value(), TEST(), update_editing_state(), and update_editing_state_with_delta().
fl_value_append_take: @value: an FlValue of type FL_VALUE_TYPE_LIST. @child: (transfer full): an FlValue.
Adds @child to the end of @value. Ownership of @child is taken by @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_LIST is a programming error.
Definition at line 560 of file fl_value.cc.
References FL_VALUE_TYPE_LIST, self, value, and FlValueList::values.
Referenced by build_list(), cancel_channel(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_success_envelope(), fl_value_append(), fl_value_new_list_from_strv(), listen_channel(), perform_action(), resize_channel(), set_allow_channel_overflow(), TEST(), update_editing_state(), and update_editing_state_with_delta().
|
static |
Definition at line 85 of file fl_value.cc.
References fl_value_unref(), and value.
Referenced by fl_value_new_list(), fl_value_new_map(), and fl_value_set_take().
fl_value_equal: : an FlValue. : an FlValue.
Compares two FlValue to see if they are equivalent. Two values are considered equivalent if they are of the same type and their data is the same including any child values. For values of type FL_VALUE_TYPE_MAP the order of the values does not matter.
Returns: TRUE if both values are equivalent.
Definition at line 433 of file fl_value.cc.
References fl_value_equal(), 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_uint8_list(), fl_value_lookup(), FL_VALUE_TYPE_BOOL, 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, and FlValueString::value.
Referenced by args_cancel_cb(), args_listen_cb(), decode_response_with_error(), decode_response_with_success(), fl_value_equal(), fl_value_lookup_index(), MATCHER_P(), MATCHER_P2(), and TEST().
G_MODULE_EXPORT bool fl_value_get_bool | ( | FlValue * | value | ) |
fl_value_get_bool: @value: an FlValue of type FL_VALUE_TYPE_BOOL.
Gets the boolean value of @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_BOOL is a programming error.
Returns: a boolean value.
Definition at line 621 of file fl_value.cc.
References FL_VALUE_TYPE_BOOL, self, and FlValueBool::value.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), handle_response(), set_client(), TEST(), and value_to_string().
G_MODULE_EXPORT double fl_value_get_float | ( | FlValue * | value | ) |
fl_value_get_float: @value: an FlValue of type FL_VALUE_TYPE_FLOAT.
Gets the floating point number of @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_FLOAT is a programming error.
Returns: a floating point number.
Definition at line 635 of file fl_value.cc.
References FL_VALUE_TYPE_FLOAT, self, and FlValueDouble::value.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), set_editable_size_and_transform(), set_marked_text_rect(), TEST(), and value_to_string().
const G_MODULE_EXPORT float* fl_value_get_float32_list | ( | FlValue * | value | ) |
fl_value_get_float32_list: @value: an FlValue of type FL_VALUE_TYPE_FLOAT32_LIST.
Gets the array of floating point numbers @value contains. The data contains fl_value_get_length() elements. Calling this with an FlValue that is not of type FL_VALUE_TYPE_FLOAT32_LIST is a programming error.
Returns: an array of floating point numbers.
Definition at line 670 of file fl_value.cc.
References FL_VALUE_TYPE_FLOAT32_LIST, self, and FlValueFloat32List::values.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), TEST(), and value_to_string().
const G_MODULE_EXPORT double* fl_value_get_float_list | ( | FlValue * | value | ) |
fl_value_get_float_list: @value: an FlValue of type FL_VALUE_TYPE_FLOAT_LIST.
Gets the array of floating point numbers @value contains. The data contains fl_value_get_length() elements. Calling this with an FlValue that is not of type FL_VALUE_TYPE_FLOAT_LIST is a programming error.
Returns: an array of floating point numbers.
Definition at line 677 of file fl_value.cc.
References FL_VALUE_TYPE_FLOAT_LIST, self, and FlValueFloatList::values.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), TEST(), and value_to_string().
G_MODULE_EXPORT int64_t fl_value_get_int | ( | FlValue * | value | ) |
fl_value_get_int: @value: an FlValue of type FL_VALUE_TYPE_INT.
Gets the integer number of @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_INT is a programming error.
Returns: an integer number.
Definition at line 628 of file fl_value.cc.
References FL_VALUE_TYPE_INT, self, and FlValueInt::value.
Referenced by fl_standard_message_codec_write_value(), fl_test_codec_encode_error_envelope(), fl_test_codec_encode_message(), fl_test_codec_encode_method_call(), fl_test_codec_encode_success_envelope(), fl_value_equal(), G_DEFINE_TYPE(), send_events_events_cb(), set_client(), set_editing_state(), TEST(), and value_to_string().
const G_MODULE_EXPORT int32_t* fl_value_get_int32_list | ( | FlValue * | value | ) |
fl_value_get_int32_list: @value: an FlValue of type FL_VALUE_TYPE_INT32_LIST.
Gets the array of 32 bit integers @value contains. The data contains fl_value_get_length() elements. Calling this with an FlValue that is not of type FL_VALUE_TYPE_INT32_LIST is a programming error.
Returns: an array of 32 bit integers.
Definition at line 656 of file fl_value.cc.
References FL_VALUE_TYPE_INT32_LIST, self, and FlValueInt32List::values.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), TEST(), and value_to_string().
const G_MODULE_EXPORT int64_t* fl_value_get_int64_list | ( | FlValue * | value | ) |
fl_value_get_int64_list: @value: an FlValue of type FL_VALUE_TYPE_INT64_LIST.
Gets the array of 64 bit integers @value contains. The data contains fl_value_get_length() elements. Calling this with an FlValue that is not of type FL_VALUE_TYPE_INT64_LIST is a programming error.
Returns: an array of 64 bit integers.
Definition at line 663 of file fl_value.cc.
References FL_VALUE_TYPE_INT64_LIST, self, and FlValueInt64List::values.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), TEST(), and value_to_string().
G_MODULE_EXPORT size_t fl_value_get_length | ( | FlValue * | value | ) |
fl_value_get_length: @value: an FlValue of type FL_VALUE_TYPE_UINT8_LIST, FL_VALUE_TYPE_INT32_LIST, FL_VALUE_TYPE_INT64_LIST, FL_VALUE_TYPE_FLOAT32_LIST, FL_VALUE_TYPE_FLOAT_LIST, FL_VALUE_TYPE_LIST or FL_VALUE_TYPE_MAP.
Gets the number of elements @value contains. This is only valid for list and map types. Calling this with other types is a programming error.
Returns: the number of elements inside @value.
Definition at line 684 of file fl_value.cc.
References FL_VALUE_TYPE_BOOL, 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, FlValueMap::keys, self, FlValueList::values, FlValueUint8List::values_length, FlValueInt32List::values_length, FlValueInt64List::values_length, FlValueFloat32List::values_length, and FlValueFloatList::values_length.
Referenced by fl_binary_codec_encode_message(), fl_json_method_codec_decode_response(), fl_standard_message_codec_write_value(), fl_value_equal(), fl_value_lookup_index(), G_DEFINE_TYPE(), set_client(), set_editable_size_and_transform(), TEST(), and value_to_string().
fl_value_get_list_value: @value: an FlValue of type FL_VALUE_TYPE_LIST. @index: an index in the list.
Gets a child element of the list. It is a programming error to request an index that is outside the size of the list as returned from fl_value_get_length(). Calling this with an FlValue that is not of type FL_VALUE_TYPE_LIST is a programming error.
Returns: an FlValue.
Definition at line 735 of file fl_value.cc.
References FL_VALUE_TYPE_LIST, self, and FlValueList::values.
Referenced by fl_json_method_codec_decode_response(), fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), set_client(), set_editable_size_and_transform(), TEST(), and value_to_string().
fl_value_get_map_key: @value: an FlValue of type FL_VALUE_TYPE_MAP. @index: an index in the map.
Gets a key from the map. It is a programming error to request an index that is outside the size of the list as returned from fl_value_get_length(). Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Returns: an FlValue.
Definition at line 743 of file fl_value.cc.
References FL_VALUE_TYPE_MAP, FlValueMap::keys, and self.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), fl_value_lookup_index(), G_DEFINE_TYPE(), TEST(), and value_to_string().
fl_value_get_map_value: @value: an FlValue of type FL_VALUE_TYPE_MAP. @index: an index in the map.
Gets a value from the map. It is a programming error to request an index that is outside the size of the list as returned from fl_value_get_length(). Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Returns: an FlValue.
Definition at line 751 of file fl_value.cc.
References FL_VALUE_TYPE_MAP, self, and FlValueMap::values.
Referenced by fl_standard_message_codec_write_value(), fl_value_equal(), fl_value_lookup(), G_DEFINE_TYPE(), TEST(), and value_to_string().
const G_MODULE_EXPORT gchar* fl_value_get_string | ( | FlValue * | value | ) |
fl_value_get_string: @value: an FlValue of type FL_VALUE_TYPE_STRING.
Gets the UTF-8 text contained in @value. Calling this with an FlValue that is not of type FL_VALUE_TYPE_STRING is a programming error.
Returns: a UTF-8 encoded string.
Definition at line 642 of file fl_value.cc.
References FL_VALUE_TYPE_STRING, self, and FlValueString::value.
Referenced by activate_system_cursor(), clipboard_get_data_async(), clipboard_set_data(), echo_response_cb(), error_response_cb(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_decode_response(), fl_standard_message_codec_write_value(), fl_standard_method_codec_decode_method_call(), fl_standard_method_codec_decode_response(), fl_string_codec_encode_message(), G_DEFINE_TYPE(), get_exit_response(), message_cb(), method_call_error_cb(), method_call_error_response_cb(), method_call_not_implemented_cb(), method_call_success_cb(), method_call_success_response_cb(), method_response_cb(), response_cb(), set_client(), set_editing_state(), system_exit_application(), system_sound_play(), TEST(), and value_to_string().
G_MODULE_EXPORT FlValueType fl_value_get_type | ( | FlValue * | value | ) |
fl_value_get_type: @value: an FlValue.
Gets the type of @value.
Returns: an FlValueType.
Definition at line 428 of file fl_value.cc.
References FL_VALUE_TYPE_NULL.
Referenced by activate_system_cursor(), FlValueHandler::add(), cancel_cancel_cb(), clipboard_get_data_async(), clipboard_set_data(), echo_response_cb(), error_response_cb(), fl_binary_codec_encode_message(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_decode_response(), fl_standard_message_codec_write_value(), fl_standard_method_codec_decode_method_call(), fl_standard_method_codec_decode_response(), fl_string_codec_encode_message(), fl_test_codec_encode_error_envelope(), fl_test_codec_encode_message(), fl_test_codec_encode_method_call(), fl_test_codec_encode_success_envelope(), G_DEFINE_TYPE(), get_exit_response(), listen_listen_cb(), message_cb(), method_call_error_cb(), method_call_error_response_cb(), method_call_not_implemented_cb(), method_call_success_cb(), method_call_success_response_cb(), method_response_cb(), null_message_response_cb(), nullptr_args_response_cb(), response_cb(), send_events_events_cb(), set_client(), system_exit_application(), system_sound_play(), and TEST().
const G_MODULE_EXPORT uint8_t* fl_value_get_uint8_list | ( | FlValue * | value | ) |
fl_value_get_uint8_list: @value: an FlValue of type FL_VALUE_TYPE_UINT8_LIST.
Gets the array of unisigned 8 bit integers @value contains. The data contains fl_value_get_length() elements. Calling this with an FlValue that is not of type FL_VALUE_TYPE_UINT8_LIST is a programming error.
Returns: an array of unsigned 8 bit integers.
Definition at line 649 of file fl_value.cc.
References FL_VALUE_TYPE_UINT8_LIST, self, and FlValueUint8List::values.
Referenced by fl_binary_codec_encode_message(), fl_standard_message_codec_write_value(), fl_value_equal(), G_DEFINE_TYPE(), TEST(), and value_to_string().
fl_value_lookup: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: a key value.
Gets the map entry that matches @key. Keys are checked using fl_value_equal(). Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Map lookups are not optimized for performance - if you have a large map or need frequent access you should copy the data into another structure, e.g. #GHashTable.
Returns: (allow-none): the value with this key or NULL if not one present.
Definition at line 759 of file fl_value.cc.
References fl_value_get_map_value(), fl_value_lookup_index(), FL_VALUE_TYPE_MAP, and self.
Referenced by fl_value_equal(), fl_value_lookup_string(), and TEST().
Definition at line 92 of file fl_value.cc.
References fl_value_equal(), fl_value_get_length(), fl_value_get_map_key(), FL_VALUE_TYPE_MAP, and self.
Referenced by fl_value_lookup(), and fl_value_set_take().
fl_value_lookup_string: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: a key value.
Gets the map entry that matches @key. Keys are checked using fl_value_equal(). Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Map lookups are not optimized for performance - if you have a large map or need frequent access you should copy the data into another structure, e.g. #GHashTable.
Returns: (allow-none): the value with this key or NULL if not one present.
Definition at line 770 of file fl_value.cc.
References fl_value_lookup(), fl_value_new_string(), fl_value_unref(), and value.
Referenced by activate_system_cursor(), clipboard_set_data(), fl_json_method_codec_decode_method_call(), get_exit_response(), handle_response(), MATCHER_P2(), set_client(), set_editable_size_and_transform(), set_editing_state(), set_marked_text_rect(), system_exit_application(), and TEST().
|
static |
Definition at line 77 of file fl_value.cc.
Referenced by fl_value_new_bool(), fl_value_new_float(), fl_value_new_float32_list(), fl_value_new_float_list(), fl_value_new_int(), fl_value_new_int32_list(), fl_value_new_int64_list(), fl_value_new_list(), fl_value_new_map(), fl_value_new_null(), fl_value_new_string(), fl_value_new_string_sized(), and fl_value_new_uint8_list().
G_MODULE_EXPORT FlValue* fl_value_new_bool | ( | bool | value | ) |
fl_value_new_bool: @value: the value.
Creates an FlValue that contains a boolean value. The equivalent Dart type is a bool.
Returns: a new FlValue.
Definition at line 244 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_BOOL, FlValueBool::value, and value.
Referenced by FlValueHandler::Bool(), build_editing_delta(), build_editing_state(), build_input_config(), clipboard_text_has_strings_cb(), echo_response_cb(), encode_bool(), fl_accessible_text_field_perform_action(), fl_standard_message_codec_read_value(), set_allow_channel_overflow(), TEST(), update_editing_state(), update_editing_state_with_delta(), and update_settings().
G_MODULE_EXPORT FlValue* fl_value_new_float | ( | double | value | ) |
fl_value_new_float: @value: the value.
Creates an FlValue that contains a floating point number. The equivalent Dart type is a num.
Returns: a new FlValue.
Definition at line 258 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_FLOAT, FlValueDouble::value, and value.
Referenced by FlValueHandler::Double(), encode_float(), read_float64_value(), TEST(), FlValueHandler::Uint64(), and update_settings().
G_MODULE_EXPORT FlValue* fl_value_new_float32_list | ( | const float * | value, |
size_t | value_length | ||
) |
fl_value_new_float32_list: @value: an array of floating point numbers. @value_length: number of elements in @value.
Creates an ordered list containing 32 bit floating point numbers. The equivalent Dart type is a Float32List.
Returns: a new FlValue.
Definition at line 318 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_FLOAT32_LIST, self, and FlValueFloat32List::values_length.
Referenced by read_float32_list_value(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_float_list | ( | const double * | value, |
size_t | value_length | ||
) |
fl_value_new_float_list: @value: an array of floating point numbers. @value_length: number of elements in @value.
Creates an ordered list containing floating point numbers. The equivalent Dart type is a Float64List.
Returns: a new FlValue.
Definition at line 328 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_FLOAT_LIST, self, and FlValueFloatList::values_length.
Referenced by read_float64_list_value(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_int | ( | int64_t | value | ) |
fl_value_new_int: @value: the value.
Creates an FlValue that contains an integer number. The equivalent Dart type is a num.
Returns: a new FlValue.
Definition at line 251 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_INT, FlValueInt::value, and value.
Referenced by build_editing_delta(), build_editing_state(), build_input_config(), encode_int(), fl_key_channel_responder_handle_event(), fl_test_codec_decode_message(), fl_test_codec_decode_response(), get_keyboard_state(), FlValueHandler::Int(), FlValueHandler::Int64(), method_call_error_error_cb(), method_call_success_error_cb(), perform_action(), perform_set_selection_action(), read_int32_value(), read_int64_value(), resize_channel(), send_events_listen_cb(), TEST(), FlValueHandler::Uint(), FlValueHandler::Uint64(), update_editing_state(), and update_editing_state_with_delta().
G_MODULE_EXPORT FlValue* fl_value_new_int32_list | ( | const int32_t * | value, |
size_t | value_length | ||
) |
fl_value_new_int32_list: @value: an array of signed 32 bit integers. @value_length: number of elements in @value.
Creates an ordered list containing 32 bit integers. The equivalent Dart type is a Int32List.
Returns: a new FlValue.
Definition at line 298 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_INT32_LIST, self, and FlValueInt32List::values_length.
Referenced by fl_view_accessible_handle_update_semantics_node(), read_int32_list_value(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_int64_list | ( | const int64_t * | value, |
size_t | value_length | ||
) |
fl_value_new_int64_list: @value: an array of signed 64 bit integers. @value_length: number of elements in @value.
Creates an ordered list containing 64 bit integers. The equivalent Dart type is a Int64List.
Returns: a new FlValue.
Definition at line 308 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_INT64_LIST, self, and FlValueInt64List::values_length.
Referenced by read_int64_list_value(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_list | ( | ) |
fl_value_new_list:
Creates an ordered list. Children can be added to the list using fl_value_append(). The children are accessed using fl_value_get_length() and fl_value_get_list_value(). The equivalent Dart type is a List<dynamic>.
The following example shows a simple list of values:
|[ g_autoptr(FlValue) value = fl_value_new_list (); fl_value_append_take (value, fl_value_new_string ("one"); fl_value_append_take (value, fl_value_new_int (2); fl_value_append_take (value, fl_value_new_double (3.0); ]|
This value can be decoded using:
|[ g_assert (fl_value_get_type (value) == FL_VALUE_TYPE_LIST); for (size_t i = 0; i < fl_value_get_length (value); i++) { FlValue *child = fl_value_get_list_value (value, i); process_value (child); } ]|
Returns: a new FlValue.
Definition at line 338 of file fl_value.cc.
References fl_value_destroy(), fl_value_new(), FL_VALUE_TYPE_LIST, and FlValueList::values.
Referenced by build_list(), cancel_channel(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_success_envelope(), fl_value_new_list_from_strv(), listen_channel(), perform_action(), read_list_value(), resize_channel(), set_allow_channel_overflow(), FlValueHandler::StartArray(), TEST(), update_editing_state(), and update_editing_state_with_delta().
G_MODULE_EXPORT FlValue* fl_value_new_list_from_strv | ( | const gchar *const * | value | ) |
fl_value_new_list_from_strv: @value: a NULL-terminated array of strings.
Creates an ordered list containing #FlString values.
Returns: a new FlValue.
Definition at line 345 of file fl_value.cc.
References fl_value_append_take(), fl_value_new_list(), fl_value_new_string(), fl_value_ref(), and value.
Referenced by TEST().
G_MODULE_EXPORT FlValue* fl_value_new_map | ( | ) |
fl_value_new_map:
Creates an ordered associative array. Children can be added to the map using fl_value_set(), fl_value_set_take(), fl_value_set_string(), fl_value_set_string_take(). The children are accessed using fl_value_get_length(), fl_value_get_map_key(), fl_value_get_map_value(), fl_value_lookup() and fl_value_lookup_string(). The equivalent Dart type is a Map<dynamic>.
The following example shows how to create a map of values keyed by strings:
|[ g_autoptr(FlValue) value = fl_value_new_map (); fl_value_set_string_take (value, "name", fl_value_new_string ("Gandalf")); fl_value_set_string_take (value, "occupation", fl_value_new_string ("Wizard")); fl_value_set_string_take (value, "age", fl_value_new_int (2019)); ]|
This value can be decoded using: |[ g_assert (fl_value_get_type (value) == FL_VALUE_TYPE_MAP); FlValue *name = fl_value_lookup_string (value, "name"); g_assert (fl_value_get_type (name) == FL_VALUE_TYPE_STRING); FlValue *age = fl_value_lookup_string (value, "age"); g_assert (fl_value_get_type (age) == FL_VALUE_TYPE_INT); g_message ("Next customer is %s (%d years old)", fl_value_get_string (name), fl_value_get_int (age)); ]|
Returns: a new FlValue.
Definition at line 355 of file fl_value.cc.
References fl_value_destroy(), fl_value_new(), FL_VALUE_TYPE_MAP, and FlValueMap::keys.
Referenced by build_map(), clipboard_text_cb(), clipboard_text_has_strings_cb(), echo_response_cb(), fl_json_method_codec_encode_method_call(), fl_key_channel_responder_handle_event(), get_keyboard_state(), perform_set_selection_action(), read_map_value(), request_app_exit(), request_app_exit_response_cb(), FlValueHandler::StartObject(), system_exit_application(), TEST(), update_editing_state(), update_editing_state_with_delta(), and update_settings().
G_MODULE_EXPORT FlValue* fl_value_new_null | ( | ) |
fl_value_new_null:
Creates an FlValue that contains a null value. The equivalent Dart type is null.
Returns: a new FlValue.
Definition at line 240 of file fl_value.cc.
References fl_value_new(), and FL_VALUE_TYPE_NULL.
Referenced by cancel_channel(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_method_call(), fl_json_method_codec_encode_success_envelope(), fl_message_codec_encode_message(), fl_standard_message_codec_decode_message(), fl_standard_message_codec_read_value(), fl_test_codec_decode_method_call(), listen_channel(), FlValueHandler::Null(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_string | ( | const gchar * | value | ) |
fl_value_new_string: @value: a NULL-terminated UTF-8 string.
Creates an FlValue that contains UTF-8 text. The equivalent Dart type is a String.
Returns: a new FlValue.
Definition at line 265 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_STRING, FlValueString::value, and value.
Referenced by args_cancel_cb(), args_listen_cb(), build_editing_delta(), build_editing_state(), build_input_config(), cancel_channel(), clipboard_text_cb(), encode_string(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_method_call(), fl_key_channel_responder_handle_event(), fl_standard_method_codec_encode_error_envelope(), fl_standard_method_codec_encode_method_call(), fl_test_codec_decode_response(), fl_value_lookup_string(), fl_value_new_list_from_strv(), fl_value_set_string(), fl_value_set_string_take(), listen_channel(), message_cb(), method_call_error_cb(), method_call_success_cb(), perform_action(), perform_set_text_action(), reassign_method_cb(), request_app_exit(), request_app_exit_response_cb(), resize_channel(), set_allow_channel_overflow(), set_app_lifecycle_state(), system_exit_application(), TEST(), update_editing_state(), update_editing_state_with_delta(), and update_settings().
G_MODULE_EXPORT FlValue* fl_value_new_string_sized | ( | const gchar * | value, |
size_t | value_length | ||
) |
fl_value_new_string_sized: @value: a buffer containing UTF-8 text. It does not require a nul terminator. @value_length: the number of bytes to use from @value.
Creates an FlValue that contains UTF-8 text. The equivalent Dart type is a String.
Returns: a new FlValue.
Definition at line 272 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_STRING, FlValueString::value, and value.
Referenced by fl_string_codec_decode_message(), FlValueHandler::Key(), read_string_value(), FlValueHandler::String(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_uint8_list | ( | const uint8_t * | value, |
size_t | value_length | ||
) |
fl_value_new_uint8_list: @value: an array of unsigned 8 bit integers. @value_length: number of elements in @value.
Creates an ordered list containing 8 bit unsigned integers. The data is copied. The equivalent Dart type is a Uint8List.
Returns: a new FlValue.
Definition at line 281 of file fl_value.cc.
References fl_value_new(), FL_VALUE_TYPE_UINT8_LIST, self, and FlValueUint8List::values_length.
Referenced by fl_binary_codec_decode_message(), fl_value_new_uint8_list_from_bytes(), read_uint8_list_value(), and TEST().
G_MODULE_EXPORT FlValue* fl_value_new_uint8_list_from_bytes | ( | GBytes * | value | ) |
fl_value_new_uint8_list_from_bytes: @value: a #GBytes.
Creates an ordered list containing 8 bit unsigned integers. The data is copied. The equivalent Dart type is a Uint8List.
Returns: a new FlValue.
Definition at line 291 of file fl_value.cc.
References fl_value_new_uint8_list().
fl_value_ref: @value: an FlValue.
Increases the reference count of an FlValue.
Returns: the value that was referenced.
Definition at line 363 of file fl_value.cc.
Referenced by FlValueHandler::add(), cancel_channel(), decode_message(), fl_json_message_codec_decode(), fl_json_message_codec_decode_message(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_method_call(), fl_json_method_codec_encode_success_envelope(), fl_method_call_new(), fl_method_error_response_new(), fl_method_success_response_new(), fl_standard_message_codec_decode_message(), fl_standard_message_codec_read_value(), fl_standard_method_codec_decode_method_call(), fl_value_append(), fl_value_new_list_from_strv(), fl_value_set(), fl_value_set_string(), listen_channel(), FlValueHandler::push(), read_list_value(), and read_map_value().
fl_value_set: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: an FlValue. @child_value: an FlValue.
Sets @key in @value to @child_value. If an existing value was in the map with the same key it is replaced. Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Definition at line 569 of file fl_value.cc.
References fl_value_ref(), fl_value_set_take(), FL_VALUE_TYPE_MAP, self, and value.
Referenced by read_map_value(), and TEST().
G_MODULE_EXPORT void fl_value_set_string | ( | FlValue * | value, |
const gchar * | key, | ||
FlValue * | child_value | ||
) |
fl_value_set_string: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: a UTF-8 text key. @child_value: an FlValue.
Sets a value in the map with a text key. If an existing value was in the map with the same key it is replaced. Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Definition at line 599 of file fl_value.cc.
References fl_value_new_string(), fl_value_ref(), fl_value_set_take(), FL_VALUE_TYPE_MAP, self, and value.
Referenced by TEST(), and update_editing_state_with_delta().
G_MODULE_EXPORT void fl_value_set_string_take | ( | FlValue * | value, |
const gchar * | key, | ||
FlValue * | child_value | ||
) |
fl_value_set_string_take: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: a UTF-8 text key. @child_value: (transfer full): an FlValue.
Sets a value in the map with a text key, taking ownership of the value. If an existing value was in the map with the same key it is replaced. Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Definition at line 610 of file fl_value.cc.
References fl_value_new_string(), fl_value_set_take(), FL_VALUE_TYPE_MAP, self, and value.
Referenced by build_map(), clipboard_text_cb(), clipboard_text_has_strings_cb(), echo_response_cb(), fl_key_channel_responder_handle_event(), perform_set_selection_action(), request_app_exit(), request_app_exit_response_cb(), system_exit_application(), TEST(), update_editing_state(), update_editing_state_with_delta(), and update_settings().
fl_value_set_take: @value: an FlValue of type FL_VALUE_TYPE_MAP. @key: (transfer full): an FlValue. @child_value: (transfer full): an FlValue.
Sets @key in @value to @child_value. Ownership of both @key and @child_value is taken by @value. If an existing value was in the map with the same key it is replaced. Calling this with an FlValue that is not of type FL_VALUE_TYPE_MAP is a programming error.
Definition at line 578 of file fl_value.cc.
References fl_value_destroy(), fl_value_lookup_index(), FL_VALUE_TYPE_MAP, FlValueMap::keys, self, value, and FlValueMap::values.
Referenced by FlValueHandler::add(), fl_json_method_codec_encode_method_call(), fl_value_set(), fl_value_set_string(), fl_value_set_string_take(), get_keyboard_state(), and TEST().
G_MODULE_EXPORT gchar* fl_value_to_string | ( | FlValue * | value | ) |
fl_value_to_string: @value: an FlValue.
Converts an FlValue to a text representation, suitable for logging purposes. The text is formatted to be the equivalent of Dart toString() methods.
Returns: UTF-8 text.
Definition at line 781 of file fl_value.cc.
References buffer, value, and value_to_string().
Referenced by echo_response_cb(), fl_method_response_get_result(), and TEST().
G_MODULE_EXPORT void fl_value_unref | ( | FlValue * | value | ) |
fl_value_unref: @value: an FlValue.
Decreases the reference count of an FlValue. When the reference count hits zero @value is destroyed and no longer valid.
Definition at line 369 of file fl_value.cc.
References FL_VALUE_TYPE_BOOL, 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, FlValueMap::keys, self, FlValueString::value, FlValueUint8List::values, FlValueInt32List::values, FlValueInt64List::values, FlValueFloat32List::values, FlValueFloatList::values, FlValueList::values, and FlValueMap::values.
Referenced by fl_method_call_dispose(), fl_method_error_response_dispose(), fl_method_success_response_dispose(), fl_value_destroy(), fl_value_lookup_string(), fl_view_accessible_init(), FlValueHandler::FlValueHandler(), FlValueHandler::Key(), TEST(), and FlValueHandler::~FlValueHandler().
|
static |
|
static |
Definition at line 105 of file fl_value.cc.
Referenced by value_to_string().
|
static |
Definition at line 129 of file fl_value.cc.
References buffer, 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_uint8_list(), FL_VALUE_TYPE_BOOL, 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, float_to_string(), int_to_string(), and value.
Referenced by fl_value_to_string().