| Flutter Linux Embedder |

Classes | Functions | Variables
fl_standard_message_codec.cc File Reference
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_message_codec.h"`
`#include "flutter/shell/platform/linux/fl_standard_message_codec_private.h"`
`#include <gmodule.h>`
`#include <cstring>`

Go to the source code of this file.

## Classes
struct | _FlStandardMessageCodec

## 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 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 ()
void | fl_standard_message_codec_write_size (FlStandardMessageCodec *codec, GByteArray *buffer, uint32_t size)
gboolean | fl_standard_message_codec_read_size (FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, uint32_t *value, GError **error)
gboolean | fl_standard_message_codec_write_value (FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error)
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

## Function Documentation

## ◆ check_size()

static gboolean check_size | ( | GBytes * | buffer,
|  | size_t | offset,
|  | size_t | required,
|  | GError ** | error
| ) |  |
| static

Definition at line 78 of file fl_standard_message_codec.cc.

81 {
82 if (offset + required > g_bytes_get_size(buffer)) {
83 g_set_error(error, FL_MESSAGE_CODEC_ERROR,
84 FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA, "Unexpected end of data");
85 return FALSE;
86 }
87 return TRUE;
88 }

References buffer, 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().

## ◆ fl_standard_message_codec_class_init()

static void fl_standard_message_codec_class_init | ( | FlStandardMessageCodecClass * | klass | ) |
| static

Definition at line 448 of file fl_standard_message_codec.cc.

449 {
450 FL_MESSAGE_CODEC_CLASS(klass)->encode_message =
451 fl_standard_message_codec_encode_message;
452 FL_MESSAGE_CODEC_CLASS(klass)->decode_message =
453 fl_standard_message_codec_decode_message;
454 }

References fl_standard_message_codec_decode_message(), and fl_standard_message_codec_encode_message().

## ◆ fl_standard_message_codec_decode_message()

static FlValue* fl_standard_message_codec_decode_message | ( | FlMessageCodec * | codec,
|  | GBytes * | message,
|  | GError ** | error
| ) |  |
| static

Definition at line 420 of file fl_standard_message_codec.cc.

422 {
423 if (g_bytes_get_size(message) == 0) {
424 return fl_value_new_null();
425 }
426
427 FlStandardMessageCodec* self =
428 reinterpret_cast<FlStandardMessageCodec*>(codec);
429
430 size_t offset = 0;
431 g_autoptr(FlValue) value =
432 fl_standard_message_codec_read_value(self, message, &offset, error);
433 if (value == nullptr) {
434 return nullptr;
435 }
436
437 if (offset != g_bytes_get_size(message)) {
438 g_set_error(error, FL_MESSAGE_CODEC_ERROR,
439 FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA,
440 "Unused %zi bytes after standard message",
441 g_bytes_get_size(message) - offset);
442 return nullptr;
443 }
444
445 return fl_value_ref(value);
446 }

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(), and value.

Referenced by fl_standard_message_codec_class_init().

## ◆ fl_standard_message_codec_encode_message()

static GBytes* fl_standard_message_codec_encode_message | ( | FlMessageCodec * | codec,
|  | FlValue * | message,
|  | GError ** | error
| ) |  |
| static

Definition at line 405 of file fl_standard_message_codec.cc.

407 {
408 FlStandardMessageCodec* self =
409 reinterpret_cast<FlStandardMessageCodec*>(codec);
410
411 g_autoptr(GByteArray) buffer = g_byte_array_new();
412 if (!fl_standard_message_codec_write_value(self, buffer, message, error)) {
413 return nullptr;
414 }
415 return g_byte_array_free_to_bytes(
416 static_cast<GByteArray*>(g_steal_pointer(&buffer)));
417 }

References buffer, error, and fl_standard_message_codec_write_value().

Referenced by fl_standard_message_codec_class_init().

## ◆ fl_standard_message_codec_init()

static void fl_standard_message_codec_init | ( | FlStandardMessageCodec * | self | ) |
| static

Definition at line 456 of file fl_standard_message_codec.cc.

456 {}

## ◆ fl_standard_message_codec_new()

G_MODULE_EXPORT FlStandardMessageCodec* fl_standard_message_codec_new | ( |  | ) |

Definition at line 458 of file fl_standard_message_codec.cc.

458 {
459 return static_cast<FlStandardMessageCodec*>(
460 g_object_new(fl_standard_message_codec_get_type(), nullptr));
461 }

Referenced by decode_error_value(), decode_message(), decode_semantic_data(), encode_message(), fl_accessible_text_field_perform_action(), fl_standard_method_codec_init(), perform_set_selection_action(), perform_set_text_action(), and TEST().

## ◆ fl_standard_message_codec_read_size()

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.

Returns: TRUE on success.

Definition at line 477 of file fl_standard_message_codec.cc.

481 {
482 uint8_t value8;
483 if (!read_uint8(buffer, offset, &value8, error)) {
484 return FALSE;
485 }
486
487 if (value8 == 255) {
488 if (!read_uint32(buffer, offset, value, error)) {
489 return FALSE;
490 }
491 } else if (value8 == 254) {
492 uint16_t value16;
493 if (!read_uint16(buffer, offset, &value16, error)) {
494 return FALSE;
495 }
496 *value = value16;
497 } else {
498 *value = value8;
499 }
500
501 return TRUE;
502 }

References buffer, error, read_uint16(), read_uint32(), read_uint8(), TRUE, and value.

Referenced by 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().

## ◆ fl_standard_message_codec_read_value()

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.

Returns: a new FlValue or NULL on error.

Definition at line 633 of file fl_standard_message_codec.cc.

636 {
637 uint8_t type;
638 if (!read_uint8(buffer, offset, &type, error)) {
639 return nullptr;
640 }
641
642 g_autoptr(FlValue) value = nullptr;
643 if (type == kValueNull) {
644 return fl_value_new_null();
645 } else if (type == kValueTrue) {
646 return fl_value_new_bool(TRUE);
647 } else if (type == kValueFalse) {
648 return fl_value_new_bool(FALSE);
649 } else if (type == kValueInt32) {
650 value = read_int32_value(buffer, offset, error);
651 } else if (type == kValueInt64) {
652 value = read_int64_value(buffer, offset, error);
653 } else if (type == kValueFloat64) {
654 value = read_float64_value(buffer, offset, error);
655 } else if (type == kValueString) {
656 value = read_string_value(self, buffer, offset, error);
657 } else if (type == kValueUint8List) {
658 value = read_uint8_list_value(self, buffer, offset, error);
659 } else if (type == kValueInt32List) {
660 value = read_int32_list_value(self, buffer, offset, error);
661 } else if (type == kValueInt64List) {
662 value = read_int64_list_value(self, buffer, offset, error);
663 } else if (type == kValueFloat32List) {
664 value = read_float32_list_value(self, buffer, offset, error);
665 } else if (type == kValueFloat64List) {
666 value = read_float64_list_value(self, buffer, offset, error);
667 } else if (type == kValueList) {
668 value = read_list_value(self, buffer, offset, error);
669 } else if (type == kValueMap) {
670 value = read_map_value(self, buffer, offset, error);
671 } else {
672 g_set_error(error, FL_MESSAGE_CODEC_ERROR,
673 FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE,
674 "Unexpected standard codec type %02x", type);
675 return nullptr;
676 }
677
678 return value == nullptr ? nullptr : fl_value_ref(value);
679 }

References buffer, error, FL_MESSAGE_CODEC_ERROR, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE, fl_value_new_bool(), fl_value_new_null(), fl_value_ref(), 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(), read_uint8_list_value(), TRUE, and value.

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().

## ◆ fl_standard_message_codec_write_size()

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 463 of file fl_standard_message_codec.cc.

465 {
466 if (size < 254) {
467 write_uint8(buffer, size);
468 } else if (size <= 0xffff) {
469 write_uint8(buffer, 254);
470 write_uint16(buffer, size);
471 } else {
472 write_uint8(buffer, 255);
473 write_uint32(buffer, size);
474 }
475 }

References buffer, write_uint16(), and write_uint32().

Referenced by fl_standard_message_codec_write_value().

## ◆ fl_standard_message_codec_write_value()

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.

Returns: TRUE on success.

Definition at line 504 of file fl_standard_message_codec.cc.

507 {
508 if (value == nullptr) {
509 write_uint8(buffer, kValueNull);
510 return TRUE;
511 }
512
513 switch (fl_value_get_type(value)) {
514 case FL_VALUE_TYPE_NULL:
515 write_uint8(buffer, kValueNull);
516 return TRUE;
517 case FL_VALUE_TYPE_BOOL:
518 if (fl_value_get_bool(value)) {
519 write_uint8(buffer, kValueTrue);
520 } else {
521 write_uint8(buffer, kValueFalse);
522 }
523 return TRUE;
524 case FL_VALUE_TYPE_INT: {
525 int64_t v = fl_value_get_int(value);
526 if (v >= INT32_MIN && v <= INT32_MAX) {
527 write_uint8(buffer, kValueInt32);
528 write_int32(buffer, v);
529 } else {
530 write_uint8(buffer, kValueInt64);
531 write_int64(buffer, v);
532 }
533 return TRUE;
534 }
535 case FL_VALUE_TYPE_FLOAT:
536 write_uint8(buffer, kValueFloat64);
537 write_align(buffer, 8);
538 write_float64(buffer, fl_value_get_float(value));
539 return TRUE;
540 case FL_VALUE_TYPE_STRING: {
541 write_uint8(buffer, kValueString);
542 const char* text = fl_value_get_string(value);
543 size_t length = strlen(text);
544 fl_standard_message_codec_write_size(self, buffer, length);
545 g_byte_array_append(buffer, reinterpret_cast<const uint8_t*>(text),
546 length);
547 return TRUE;
548 }
549 case FL_VALUE_TYPE_UINT8_LIST: {
550 write_uint8(buffer, kValueUint8List);
551 size_t length = fl_value_get_length(value);
552 fl_standard_message_codec_write_size(self, buffer, length);
553 g_byte_array_append(buffer, fl_value_get_uint8_list(value),
554 sizeof(uint8_t) * length);
555 return TRUE;
556 }
557 case FL_VALUE_TYPE_INT32_LIST: {
558 write_uint8(buffer, kValueInt32List);
559 size_t length = fl_value_get_length(value);
560 fl_standard_message_codec_write_size(self, buffer, length);
561 write_align(buffer, 4);
562 g_byte_array_append(
563 buffer,
564 reinterpret_cast<const uint8_t*>(fl_value_get_int32_list(value)),
565 sizeof(int32_t) * length);
566 return TRUE;
567 }
568 case FL_VALUE_TYPE_INT64_LIST: {
569 write_uint8(buffer, kValueInt64List);
570 size_t length = fl_value_get_length(value);
571 fl_standard_message_codec_write_size(self, buffer, length);
572 write_align(buffer, 8);
573 g_byte_array_append(
574 buffer,
575 reinterpret_cast<const uint8_t*>(fl_value_get_int64_list(value)),
576 sizeof(int64_t) * length);
577 return TRUE;
578 }
579 case FL_VALUE_TYPE_FLOAT32_LIST: {
580 write_uint8(buffer, kValueFloat32List);
581 size_t length = fl_value_get_length(value);
582 fl_standard_message_codec_write_size(self, buffer, length);
583 write_align(buffer, 4);
584 g_byte_array_append(
585 buffer,
586 reinterpret_cast<const uint8_t*>(fl_value_get_float32_list(value)),
587 sizeof(float) * length);
588 return TRUE;
589 }
590 case FL_VALUE_TYPE_FLOAT_LIST: {
591 write_uint8(buffer, kValueFloat64List);
592 size_t length = fl_value_get_length(value);
593 fl_standard_message_codec_write_size(self, buffer, length);
594 write_align(buffer, 8);
595 g_byte_array_append(
596 buffer,
597 reinterpret_cast<const uint8_t*>(fl_value_get_float_list(value)),
598 sizeof(double) * length);
599 return TRUE;
600 }
601 case FL_VALUE_TYPE_LIST:
602 write_uint8(buffer, kValueList);
603 fl_standard_message_codec_write_size(self, buffer,
604 fl_value_get_length(value));
605 for (size_t i = 0; i < fl_value_get_length(value); i++) {
606 if (!fl_standard_message_codec_write_value(
607 self, buffer, fl_value_get_list_value(value, i), error)) {
608 return FALSE;
609 }
610 }
611 return TRUE;
612 case FL_VALUE_TYPE_MAP:
613 write_uint8(buffer, kValueMap);
614 fl_standard_message_codec_write_size(self, buffer,
615 fl_value_get_length(value));
616 for (size_t i = 0; i < fl_value_get_length(value); i++) {
617 if (!fl_standard_message_codec_write_value(
618 self, buffer, fl_value_get_map_key(value, i), error) ||
619 !fl_standard_message_codec_write_value(
620 self, buffer, fl_value_get_map_value(value, i), error)) {
621 return FALSE;
622 }
623 }
624 return TRUE;
625 }
626
627 g_set_error(error, FL_MESSAGE_CODEC_ERROR,
628 FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE,
629 "Unexpected FlValue type %d", fl_value_get_type(value));
630 return FALSE;
631 }

References buffer, 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_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, kValueFalse, kValueFloat32List, kValueFloat64, kValueFloat64List, kValueInt32, kValueInt32List, kValueInt64, kValueInt64List, kValueList, kValueMap, kValueNull, kValueString, kValueTrue, kValueUint8List, TRUE, value, write_align(), write_float64(), write_int32(), and write_int64().

Referenced by fl_standard_message_codec_encode_message(), fl_standard_message_codec_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()

G_DEFINE_TYPE | ( | FlStandardMessageCodec | ,
|  | fl_standard_message_codec | ,
|  | fl_message_codec_get_type() |
| ) |  |

## ◆ get_data()

static const uint8_t* get_data | ( | GBytes * | buffer,
|  | size_t * | offset
| ) |  |
| static

Definition at line 109 of file fl_standard_message_codec.cc.

109 {
110 return static_cast<const uint8_t*>(g_bytes_get_data(buffer, nullptr)) +
111 *offset;
112 }

References buffer.

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().

## ◆ read_align()

static gboolean read_align | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | size_t | align,
|  | GError ** | error
| ) |  |
| static

Definition at line 91 of file fl_standard_message_codec.cc.

94 {
95 if ((*offset) % align == 0) {
96 return TRUE;
97 }
98
99 size_t required = align - (*offset) % align;
100 if (!check_size(buffer, *offset, required, error)) {
101 return FALSE;
102 }
103
104 (*offset) += required;
105 return TRUE;
106 }

References buffer, 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().

## ◆ read_float32_list_value()

static FlValue* read_float32_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 302 of file fl_standard_message_codec.cc.

305 {
306 uint32_t length;
307 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
308 error)) {
309 return nullptr;
310 }
311 if (!read_align(buffer, offset, 4, error)) {
312 return nullptr;
313 }
314 if (!check_size(buffer, *offset, sizeof(float) * length, error)) {
315 return nullptr;
316 }
317 FlValue* value = fl_value_new_float32_list(
318 reinterpret_cast<const float*>(get_data(buffer, offset)), length);
319 *offset += sizeof(float) * length;
320 return value;
321 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_float32_list(), get_data(), read_align(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_float64_list_value()

static FlValue* read_float64_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 326 of file fl_standard_message_codec.cc.

329 {
330 uint32_t length;
331 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
332 error)) {
333 return nullptr;
334 }
335 if (!read_align(buffer, offset, 8, error)) {
336 return nullptr;
337 }
338 if (!check_size(buffer, *offset, sizeof(double) * length, error)) {
339 return nullptr;
340 }
341 FlValue* value = fl_value_new_float_list(
342 reinterpret_cast<const double*>(get_data(buffer, offset)), length);
343 *offset += sizeof(double) * length;
344 return value;
345 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_float_list(), get_data(), read_align(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_float64_value()

static FlValue* read_float64_value | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 194 of file fl_standard_message_codec.cc.

196 {
197 if (!read_align(buffer, offset, 8, error)) {
198 return nullptr;
199 }
200 if (!check_size(buffer, *offset, sizeof(double), error)) {
201 return nullptr;
202 }
203
204 FlValue* value = fl_value_new_float(
205 reinterpret_cast<const double*>(get_data(buffer, offset))[0]);
206 *offset += sizeof(double);
207 return value;
208 }

References buffer, check_size(), error, fl_value_new_float(), get_data(), read_align(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_int32_list_value()

static FlValue* read_int32_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 254 of file fl_standard_message_codec.cc.

257 {
258 uint32_t length;
259 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
260 error)) {
261 return nullptr;
262 }
263 if (!read_align(buffer, offset, 4, error)) {
264 return nullptr;
265 }
266 if (!check_size(buffer, *offset, sizeof(int32_t) * length, error)) {
267 return nullptr;
268 }
269 FlValue* value = fl_value_new_int32_list(
270 reinterpret_cast<const int32_t*>(get_data(buffer, offset)), length);
271 *offset += sizeof(int32_t) * length;
272 return value;
273 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_int32_list(), get_data(), read_align(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_int32_value()

static FlValue* read_int32_value | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 162 of file fl_standard_message_codec.cc.

164 {
165 if (!check_size(buffer, *offset, sizeof(int32_t), error)) {
166 return nullptr;
167 }
168
169 FlValue* value = fl_value_new_int(
170 reinterpret_cast<const int32_t*>(get_data(buffer, offset))[0]);
171 *offset += sizeof(int32_t);
172 return value;
173 }

References buffer, check_size(), error, fl_value_new_int(), get_data(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_int64_list_value()

static FlValue* read_int64_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 278 of file fl_standard_message_codec.cc.

281 {
282 uint32_t length;
283 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
284 error)) {
285 return nullptr;
286 }
287 if (!read_align(buffer, offset, 8, error)) {
288 return nullptr;
289 }
290 if (!check_size(buffer, *offset, sizeof(int64_t) * length, error)) {
291 return nullptr;
292 }
293 FlValue* value = fl_value_new_int64_list(
294 reinterpret_cast<const int64_t*>(get_data(buffer, offset)), length);
295 *offset += sizeof(int64_t) * length;
296 return value;
297 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_int64_list(), get_data(), read_align(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_int64_value()

static FlValue* read_int64_value | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 178 of file fl_standard_message_codec.cc.

180 {
181 if (!check_size(buffer, *offset, sizeof(int64_t), error)) {
182 return nullptr;
183 }
184
185 FlValue* value = fl_value_new_int(
186 reinterpret_cast<const int64_t*>(get_data(buffer, offset))[0]);
187 *offset += sizeof(int64_t);
188 return value;
189 }

References buffer, check_size(), error, fl_value_new_int(), get_data(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_list_value()

static FlValue* read_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 350 of file fl_standard_message_codec.cc.

353 {
354 uint32_t length;
355 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
356 error)) {
357 return nullptr;
358 }
359
360 g_autoptr(FlValue) list = fl_value_new_list();
361 for (size_t i = 0; i < length; i++) {
362 g_autoptr(FlValue) child =
363 fl_standard_message_codec_read_value(self, buffer, offset, error);
364 if (child == nullptr) {
365 return nullptr;
366 }
367 fl_value_append(list, child);
368 }
369
370 return fl_value_ref(list);
371 }

References buffer, error, fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value(), fl_value_append(), fl_value_new_list(), and fl_value_ref().

Referenced by fl_standard_message_codec_read_value().

## ◆ read_map_value()

static FlValue* read_map_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 376 of file fl_standard_message_codec.cc.

379 {
380 uint32_t length;
381 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
382 error)) {
383 return nullptr;
384 }
385
386 g_autoptr(FlValue) map = fl_value_new_map();
387 for (size_t i = 0; i < length; i++) {
388 g_autoptr(FlValue) key =
389 fl_standard_message_codec_read_value(self, buffer, offset, error);
390 if (key == nullptr) {
391 return nullptr;
392 }
393 g_autoptr(FlValue) value =
394 fl_standard_message_codec_read_value(self, buffer, offset, error);
395 if (value == nullptr) {
396 return nullptr;
397 }
398 fl_value_set(map, key, value);
399 }
400
401 return fl_value_ref(map);
402 }

References buffer, error, fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value(), fl_value_new_map(), fl_value_ref(), fl_value_set(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_string_value()

static FlValue* read_string_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 213 of file fl_standard_message_codec.cc.

216 {
217 uint32_t length;
218 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
219 error)) {
220 return nullptr;
221 }
222 if (!check_size(buffer, *offset, length, error)) {
223 return nullptr;
224 }
225 FlValue* value = fl_value_new_string_sized(
226 reinterpret_cast<const gchar*>(get_data(buffer, offset)), length);
227 *offset += length;
228 return value;
229 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_string_sized(), get_data(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ read_uint16()

static gboolean read_uint16 | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | uint16_t * | value,
|  | GError ** | error
| ) |  |
| static

Definition at line 131 of file fl_standard_message_codec.cc.

134 {
135 if (!check_size(buffer, *offset, sizeof(uint16_t), error)) {
136 return FALSE;
137 }
138
139 *value = reinterpret_cast<const uint16_t*>(get_data(buffer, offset))[0];
140 *offset += sizeof(uint16_t);
141 return TRUE;
142 }

References buffer, check_size(), error, get_data(), TRUE, and value.

Referenced by fl_standard_message_codec_read_size().

## ◆ read_uint32()

static gboolean read_uint32 | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | uint32_t * | value,
|  | GError ** | error
| ) |  |
| static

Definition at line 146 of file fl_standard_message_codec.cc.

149 {
150 if (!check_size(buffer, *offset, sizeof(uint32_t), error)) {
151 return FALSE;
152 }
153
154 *value = reinterpret_cast<const uint32_t*>(get_data(buffer, offset))[0];
155 *offset += sizeof(uint32_t);
156 return TRUE;
157 }

References buffer, check_size(), error, get_data(), TRUE, and value.

Referenced by fl_standard_message_codec_read_size().

## ◆ read_uint8()

static gboolean read_uint8 | ( | GBytes * | buffer,
|  | size_t * | offset,
|  | uint8_t * | value,
|  | GError ** | error
| ) |  |
| static

Definition at line 116 of file fl_standard_message_codec.cc.

119 {
120 if (!check_size(buffer, *offset, sizeof(uint8_t), error)) {
121 return FALSE;
122 }
123
124 *value = get_data(buffer, offset)[0];
125 (*offset)++;
126 return TRUE;
127 }

References buffer, check_size(), error, get_data(), TRUE, and value.

Referenced by fl_standard_message_codec_read_size(), and fl_standard_message_codec_read_value().

## ◆ read_uint8_list_value()

static FlValue* read_uint8_list_value | ( | FlStandardMessageCodec * | self,
|  | GBytes * | buffer,
|  | size_t * | offset,
|  | GError ** | error
| ) |  |
| static

Definition at line 234 of file fl_standard_message_codec.cc.

237 {
238 uint32_t length;
239 if (!fl_standard_message_codec_read_size(self, buffer, offset, &length,
240 error)) {
241 return nullptr;
242 }
243 if (!check_size(buffer, *offset, sizeof(uint8_t) * length, error)) {
244 return nullptr;
245 }
246 FlValue* value = fl_value_new_uint8_list(get_data(buffer, offset), length);
247 *offset += length;
248 return value;
249 }

References buffer, check_size(), error, fl_standard_message_codec_read_size(), fl_value_new_uint8_list(), get_data(), and value.

Referenced by fl_standard_message_codec_read_value().

## ◆ write_align()

static void write_align | ( | GByteArray * | buffer,
|  | guint | align
| ) |  |
| static

Definition at line 71 of file fl_standard_message_codec.cc.

71 {
72 while (buffer->len % align != 0) {
73 write_uint8(buffer, 0);
74 }
75 }

References buffer.

Referenced by fl_standard_message_codec_write_value().

## ◆ write_float64()

static void write_float64 | ( | GByteArray * | buffer,
|  | double | value
| ) |  |
| static

Definition at line 65 of file fl_standard_message_codec.cc.

65 {
66 g_byte_array_append(buffer, reinterpret_cast<uint8_t*>(&value),
67 sizeof(double));
68 }

References buffer, and value.

Referenced by fl_standard_message_codec_write_value().

## ◆ write_int32()

static void write_int32 | ( | GByteArray * | buffer,
|  | int32_t | value
| ) |  |
| static

Definition at line 55 of file fl_standard_message_codec.cc.

55 {
56 g_byte_array_append(buffer, reinterpret_cast<uint8_t*>(&value),
57 sizeof(int32_t));
58 }

References buffer, and value.

Referenced by fl_standard_message_codec_write_value().

## ◆ write_int64()

static void write_int64 | ( | GByteArray * | buffer,
|  | int64_t | value
| ) |  |
| static

Definition at line 60 of file fl_standard_message_codec.cc.

60 {
61 g_byte_array_append(buffer, reinterpret_cast<uint8_t*>(&value),
62 sizeof(int64_t));
63 }

References buffer, and value.

Referenced by fl_standard_message_codec_write_value().

## ◆ write_uint16()

static void write_uint16 | ( | GByteArray * | buffer,
|  | uint16_t | value
| ) |  |
| static

Definition at line 45 of file fl_standard_message_codec.cc.

45 {
46 g_byte_array_append(buffer, reinterpret_cast<uint8_t*>(&value),
47 sizeof(uint16_t));
48 }

References buffer, and value.

Referenced by fl_standard_message_codec_write_size().

## ◆ write_uint32()

static void write_uint32 | ( | GByteArray * | buffer,
|  | uint32_t | value
| ) |  |
| static

Definition at line 50 of file fl_standard_message_codec.cc.

50 {
51 g_byte_array_append(buffer, reinterpret_cast<uint8_t*>(&value),
52 sizeof(uint32_t));
53 }

References buffer, and value.

Referenced by fl_standard_message_codec_write_size().

## Variable Documentation

## ◆ kValueFalse

constexpr int kValueFalse = 2
| staticconstexpr

Definition at line 18 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueFloat32List

constexpr int kValueFloat32List = 14
| staticconstexpr

Definition at line 29 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueFloat64

constexpr int kValueFloat64 = 6
| staticconstexpr

Definition at line 21 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueFloat64List

constexpr int kValueFloat64List = 11
| staticconstexpr

Definition at line 26 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueInt32

constexpr int kValueInt32 = 3
| staticconstexpr

Definition at line 19 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueInt32List

constexpr int kValueInt32List = 9
| staticconstexpr

Definition at line 24 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueInt64

constexpr int kValueInt64 = 4
| staticconstexpr

Definition at line 20 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueInt64List

constexpr int kValueInt64List = 10
| staticconstexpr

Definition at line 25 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueList

constexpr int kValueList = 12
| staticconstexpr

Definition at line 27 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueMap

constexpr int kValueMap = 13
| staticconstexpr

Definition at line 28 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueNull

constexpr int kValueNull = 0
| staticconstexpr

Definition at line 16 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueString

constexpr int kValueString = 7
| staticconstexpr

Definition at line 22 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueTrue

constexpr int kValueTrue = 1
| staticconstexpr

Definition at line 17 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ kValueUint8List

constexpr int kValueUint8List = 8
| staticconstexpr

Definition at line 23 of file fl_standard_message_codec.cc.

Referenced by fl_standard_message_codec_read_value(), and fl_standard_message_codec_write_value().

## ◆ value

uint8_t value

Initial value:
{
g_byte_array_append(buffer, &value, sizeof(uint8_t))

Definition at line 41 of file fl_standard_message_codec.cc.

Referenced by FlValueHandler::add(), build_list(), build_map(), cancel_channel(), flutter::CheckEncodeDecode(), flutter::CheckEncodeDecodeWithEncodePrefix(), commit_updates(), decode_error_message(), decode_error_value(), decode_message(), flutter::JsonMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), flutter::StandardMethodCodec::DecodeAndProcessResponseEnvelopeInternal(), define_system_cursor(), do_unref(), echo_response_cb(), encode_bool(), encode_error_message(), encode_float(), encode_int(), encode_message(), encode_message_error(), encode_string(), find_physical_from_logical_loop_body(), fl_accessible_node_set_property(), fl_accessible_node_set_value(), fl_accessible_text_field_set_value(), fl_binary_codec_encode_message(), fl_engine_set_property(), fl_gnome_settings_get_color_scheme(), fl_gnome_settings_set_property(), fl_json_message_codec_decode(), fl_json_message_codec_decode_message(), fl_json_message_codec_encode(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_decode_response(), fl_settings_portal_get_clock_format(), fl_settings_portal_get_color_scheme(), fl_settings_portal_get_enable_animations(), fl_settings_portal_get_high_contrast(), fl_settings_portal_get_text_scaling_factor(), fl_settings_portal_start(), fl_standard_message_codec_decode_message(), fl_standard_message_codec_read_size(), fl_standard_message_codec_read_value(), fl_standard_message_codec_write_value(), fl_string_codec_encode_message(), fl_test_codec_encode_message(), fl_value_append(), fl_value_append_take(), fl_value_destroy(), fl_value_lookup_string(), fl_value_new_bool(), fl_value_new_float(), fl_value_new_int(), fl_value_new_list_from_strv(), fl_value_new_string(), fl_value_new_string_sized(), fl_value_set(), fl_value_set_string(), fl_value_set_string_take(), fl_value_set_take(), fl_value_to_string(), fl_view_accessible_set_property(), fl_view_get_property(), fl_view_set_property(), float_to_string(), G_DEFINE_TYPE(), G_DEFINE_TYPE_WITH_CODE(), get_keyboard_state(), get_value(), hash_table_find_equal_value(), if(), initialize_logical_key_to_lock_bit_loop_body(), int_to_string(), is_known_modifier_physical_key_loop_body(), listen_channel(), MATCHER_P(), MATCHER_P2(), perform_set_selection_action(), perform_set_text_action(), FlValueHandler::push(), 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(), flutter::ByteStreamReader::ReadDouble(), flutter::ByteStreamReader::ReadInt32(), flutter::ByteStreamReader::ReadInt64(), flutter::StandardCodecSerializer::ReadSize(), flutter::StandardCodecSerializer::ReadValueOfType(), reverse_lookup_hash_table(), set_app_lifecycle_state(), set_value(), settings_portal_changed_cb(), settings_portal_read(), synchronize_lock_states_loop_body(), synchronize_pressed_states_loop_body(), flutter::TEST(), TEST(), update_editing_state(), update_editing_state_with_delta(), value_to_string(), write_float64(), write_int32(), write_int64(), write_uint16(), write_uint32(), flutter::ByteStreamWriter::WriteDouble(), flutter::ByteStreamWriter::WriteInt32(), flutter::ByteStreamWriter::WriteInt64(), flutter::StandardCodecSerializer::WriteSize(), and flutter::StandardCodecSerializer::WriteValue().

read_list_value
static FlValue * read_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:350
read_uint16
static gboolean read_uint16(GBytes *buffer, size_t *offset, uint16_t *value, GError **error)
Definition: fl_standard_message_codec.cc:131
kValueList
static constexpr int kValueList
Definition: fl_standard_message_codec.cc:27
fl_value_get_int32_list
const G_MODULE_EXPORT int32_t * fl_value_get_int32_list(FlValue *self)
Definition: fl_value.cc:656
FL_VALUE_TYPE_UINT8_LIST
@ FL_VALUE_TYPE_UINT8_LIST
Definition: fl_value.h:67
fl_value_new_string_sized
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
Definition: fl_value.cc:272
FL_VALUE_TYPE_MAP
@ FL_VALUE_TYPE_MAP
Definition: fl_value.h:72
fl_standard_message_codec_read_value
FlValue * fl_standard_message_codec_read_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:633
kValueUint8List
static constexpr int kValueUint8List
Definition: fl_standard_message_codec.cc:23
fl_standard_message_codec_encode_message
static GBytes * fl_standard_message_codec_encode_message(FlMessageCodec *codec, FlValue *message, GError **error)
Definition: fl_standard_message_codec.cc:405
read_int32_value
static FlValue * read_int32_value(GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:162
kValueNull
static constexpr int kValueNull
Definition: fl_standard_message_codec.cc:16
kValueInt64List
static constexpr int kValueInt64List
Definition: fl_standard_message_codec.cc:25
fl_value_new_list
G_MODULE_EXPORT FlValue * fl_value_new_list()
Definition: fl_value.cc:338
fl_value_new_float32_list
G_MODULE_EXPORT FlValue * fl_value_new_float32_list(const float *data, size_t data_length)
Definition: fl_value.cc:318
fl_value_get_float_list
const G_MODULE_EXPORT double * fl_value_get_float_list(FlValue *self)
Definition: fl_value.cc:677
kValueInt32List
static constexpr int kValueInt32List
Definition: fl_standard_message_codec.cc:24
kValueInt64
static constexpr int kValueInt64
Definition: fl_standard_message_codec.cc:20
fl_value_new_bool
G_MODULE_EXPORT FlValue * fl_value_new_bool(bool value)
Definition: fl_value.cc:244
FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA
@ FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA
Definition: fl_message_codec.h:36
FlValue
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:40
kValueInt32
static constexpr int kValueInt32
Definition: fl_standard_message_codec.cc:19
kValueFloat64List
static constexpr int kValueFloat64List
Definition: fl_standard_message_codec.cc:26
write_float64
static void write_float64(GByteArray *buffer, double value)
Definition: fl_standard_message_codec.cc:65
kValueTrue
static constexpr int kValueTrue
Definition: fl_standard_message_codec.cc:17
fl_value_new_null
G_MODULE_EXPORT FlValue * fl_value_new_null()
Definition: fl_value.cc:240
FL_VALUE_TYPE_LIST
@ FL_VALUE_TYPE_LIST
Definition: fl_value.h:71
read_string_value
static FlValue * read_string_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:213
fl_value_get_bool
G_MODULE_EXPORT bool fl_value_get_bool(FlValue *self)
Definition: fl_value.cc:621
fl_value_get_uint8_list
const G_MODULE_EXPORT uint8_t * fl_value_get_uint8_list(FlValue *self)
Definition: fl_value.cc:649
fl_value_set
G_MODULE_EXPORT void fl_value_set(FlValue *self, FlValue *key, FlValue *value)
Definition: fl_value.cc:569
write_int64
static void write_int64(GByteArray *buffer, int64_t value)
Definition: fl_standard_message_codec.cc:60
fl_value_new_int
G_MODULE_EXPORT FlValue * fl_value_new_int(int64_t value)
Definition: fl_value.cc:251
fl_value_get_string
const G_MODULE_EXPORT gchar * fl_value_get_string(FlValue *self)
Definition: fl_value.cc:642
read_float64_value
static FlValue * read_float64_value(GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:194
_FlValue::type
FlValueType type
Definition: fl_value.cc:12
fl_value_get_float32_list
const G_MODULE_EXPORT float * fl_value_get_float32_list(FlValue *self)
Definition: fl_value.cc:670
read_map_value
static FlValue * read_map_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:376
FL_VALUE_TYPE_NULL
@ FL_VALUE_TYPE_NULL
Definition: fl_value.h:62
read_align
static gboolean read_align(GBytes *buffer, size_t *offset, size_t align, GError **error)
Definition: fl_standard_message_codec.cc:91
read_int32_list_value
static FlValue * read_int32_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:254
fl_value_get_int
G_MODULE_EXPORT int64_t fl_value_get_int(FlValue *self)
Definition: fl_value.cc:628
write_int32
static void write_int32(GByteArray *buffer, int32_t value)
Definition: fl_standard_message_codec.cc:55
read_uint8_list_value
static FlValue * read_uint8_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:234
fl_standard_message_codec_write_size
void fl_standard_message_codec_write_size(FlStandardMessageCodec *codec, GByteArray *buffer, uint32_t size)
Definition: fl_standard_message_codec.cc:463
fl_value_ref
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
Definition: fl_value.cc:363
fl_value_new_map
G_MODULE_EXPORT FlValue * fl_value_new_map()
Definition: fl_value.cc:355
fl_value_get_type
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
Definition: fl_value.cc:428
write_uint16
static void write_uint16(GByteArray *buffer, uint16_t value)
Definition: fl_standard_message_codec.cc:45
fl_value_get_list_value
G_MODULE_EXPORT FlValue * fl_value_get_list_value(FlValue *self, size_t index)
Definition: fl_value.cc:735
read_int64_value
static FlValue * read_int64_value(GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:178
FL_VALUE_TYPE_FLOAT32_LIST
@ FL_VALUE_TYPE_FLOAT32_LIST
Definition: fl_value.h:73
FL_VALUE_TYPE_STRING
@ FL_VALUE_TYPE_STRING
Definition: fl_value.h:66
fl_standard_message_codec_read_size
gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, uint32_t *value, GError **error)
Definition: fl_standard_message_codec.cc:477
read_float32_list_value
static FlValue * read_float32_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:302
fl_value_new_float_list
G_MODULE_EXPORT FlValue * fl_value_new_float_list(const double *data, size_t data_length)
Definition: fl_value.cc:328
kValueFalse
static constexpr int kValueFalse
Definition: fl_standard_message_codec.cc:18
fl_standard_message_codec_decode_message
static FlValue * fl_standard_message_codec_decode_message(FlMessageCodec *codec, GBytes *message, GError **error)
Definition: fl_standard_message_codec.cc:420
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
check_size
static gboolean check_size(GBytes *buffer, size_t offset, size_t required, GError **error)
Definition: fl_standard_message_codec.cc:78
fl_value_new_int32_list
G_MODULE_EXPORT FlValue * fl_value_new_int32_list(const int32_t *data, size_t data_length)
Definition: fl_value.cc:298
fl_value_get_float
G_MODULE_EXPORT double fl_value_get_float(FlValue *self)
Definition: fl_value.cc:635
fl_value_get_length
G_MODULE_EXPORT size_t fl_value_get_length(FlValue *self)
Definition: fl_value.cc:684
FL_VALUE_TYPE_INT64_LIST
@ FL_VALUE_TYPE_INT64_LIST
Definition: fl_value.h:69
kValueFloat64
static constexpr int kValueFloat64
Definition: fl_standard_message_codec.cc:21
FL_VALUE_TYPE_INT
@ FL_VALUE_TYPE_INT
Definition: fl_value.h:64
fl_value_new_int64_list
G_MODULE_EXPORT FlValue * fl_value_new_int64_list(const int64_t *data, size_t data_length)
Definition: fl_value.cc:308
get_data
static const uint8_t * get_data(GBytes *buffer, size_t *offset)
Definition: fl_standard_message_codec.cc:109
FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA
@ FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA
Definition: fl_message_codec.h:35
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40
kValueMap
static constexpr int kValueMap
Definition: fl_standard_message_codec.cc:28
FL_VALUE_TYPE_FLOAT_LIST
@ FL_VALUE_TYPE_FLOAT_LIST
Definition: fl_value.h:70
read_uint32
static gboolean read_uint32(GBytes *buffer, size_t *offset, uint32_t *value, GError **error)
Definition: fl_standard_message_codec.cc:146
fl_value_new_uint8_list
G_MODULE_EXPORT FlValue * fl_value_new_uint8_list(const uint8_t *data, size_t data_length)
Definition: fl_value.cc:281
fl_value_append
G_MODULE_EXPORT void fl_value_append(FlValue *self, FlValue *value)
Definition: fl_value.cc:552
buffer
static const uint8_t buffer[]
Definition: fl_pixel_buffer_texture_test.cc:44
kValueFloat32List
static constexpr int kValueFloat32List
Definition: fl_standard_message_codec.cc:29
FL_VALUE_TYPE_FLOAT
@ FL_VALUE_TYPE_FLOAT
Definition: fl_value.h:65
kValueString
static constexpr int kValueString
Definition: fl_standard_message_codec.cc:22
FL_VALUE_TYPE_INT32_LIST
@ FL_VALUE_TYPE_INT32_LIST
Definition: fl_value.h:68
write_align
static void write_align(GByteArray *buffer, guint align)
Definition: fl_standard_message_codec.cc:71
FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
@ FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
Definition: fl_message_codec.h:37
fl_value_new_float
G_MODULE_EXPORT FlValue * fl_value_new_float(double value)
Definition: fl_value.cc:258
read_float64_list_value
static FlValue * read_float64_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:326
fl_value_get_map_key
G_MODULE_EXPORT FlValue * fl_value_get_map_key(FlValue *self, size_t index)
Definition: fl_value.cc:743
read_uint8
static gboolean read_uint8(GBytes *buffer, size_t *offset, uint8_t *value, GError **error)
Definition: fl_standard_message_codec.cc:116
write_uint32
static void write_uint32(GByteArray *buffer, uint32_t value)
Definition: fl_standard_message_codec.cc:50
fl_value_get_int64_list
const G_MODULE_EXPORT int64_t * fl_value_get_int64_list(FlValue *self)
Definition: fl_value.cc:663
FL_VALUE_TYPE_BOOL
@ FL_VALUE_TYPE_BOOL
Definition: fl_value.h:63
value
uint8_t value
Definition: fl_standard_message_codec.cc:41
fl_standard_message_codec_write_value
gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec *self, GByteArray *buffer, FlValue *value, GError **error)
Definition: fl_standard_message_codec.cc:504
fl_value_get_map_value
G_MODULE_EXPORT FlValue * fl_value_get_map_value(FlValue *self, size_t index)
Definition: fl_value.cc:751
read_int64_list_value
static FlValue * read_int64_list_value(FlStandardMessageCodec *self, GBytes *buffer, size_t *offset, GError **error)
Definition: fl_standard_message_codec.cc:278
FL_MESSAGE_CODEC_ERROR
#define FL_MESSAGE_CODEC_ERROR
Definition: fl_message_codec.h:30