#include "flutter/shell/platform/linux/public/flutter_linux/fl_string_codec.h"
#include <gmodule.h>
#include <cstring>
Go to the source code of this file.
◆ fl_string_codec_class_init()
static void fl_string_codec_class_init |
( |
FlStringCodecClass * |
klass | ) |
|
|
static |
Definition at line 44 of file fl_string_codec.cc.
44 {
45 FL_MESSAGE_CODEC_CLASS(klass)->encode_message =
47 FL_MESSAGE_CODEC_CLASS(klass)->decode_message =
49}
static GBytes * fl_string_codec_encode_message(FlMessageCodec *codec, FlValue *value, GError **error)
static FlValue * fl_string_codec_decode_message(FlMessageCodec *codec, GBytes *message, GError **error)
◆ fl_string_codec_decode_message()
static FlValue * fl_string_codec_decode_message |
( |
FlMessageCodec * |
codec, |
|
|
GBytes * |
message, |
|
|
GError ** |
error |
|
) |
| |
|
static |
Definition at line 35 of file fl_string_codec.cc.
37 {
38 gsize data_length;
40 static_cast<const gchar*
>(g_bytes_get_data(
message, &data_length));
42}
G_MODULE_EXPORT FlValue * fl_value_new_string_sized(const gchar *value, size_t value_length)
std::shared_ptr< const fml::Mapping > data
◆ fl_string_codec_encode_message()
static GBytes * fl_string_codec_encode_message |
( |
FlMessageCodec * |
codec, |
|
|
FlValue * |
value, |
|
|
GError ** |
error |
|
) |
| |
|
static |
Definition at line 20 of file fl_string_codec.cc.
22 {
26 "Only string values supported");
27 return nullptr;
28 }
29
31 return g_bytes_new(
text, strlen(
text));
32}
@ FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE
#define FL_MESSAGE_CODEC_ERROR
const uint8_t uint32_t uint32_t GError ** error
G_MODULE_EXPORT FlValueType fl_value_get_type(FlValue *self)
G_MODULE_EXPORT const gchar * fl_value_get_string(FlValue *self)
◆ fl_string_codec_init()
static void fl_string_codec_init |
( |
FlStringCodec * |
self | ) |
|
|
static |
◆ fl_string_codec_new()
G_MODULE_EXPORT FlStringCodec * fl_string_codec_new |
( |
| ) |
|
Definition at line 53 of file fl_string_codec.cc.
53 {
54 return static_cast<FlStringCodec*>(
55 g_object_new(fl_string_codec_get_type(), nullptr));
56}