Go to the source code of this file.
Macros | |
#define | FL_MESSAGE_CODEC_ERROR fl_message_codec_error_quark() |
Enumerations | |
enum | FlMessageCodecError { FL_MESSAGE_CODEC_ERROR_FAILED, FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA, FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA, FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE } |
Functions | |
G_MODULE_EXPORT GQuark | fl_message_codec_error_quark (void) G_GNUC_CONST |
G_MODULE_EXPORT | G_DECLARE_DERIVABLE_TYPE (FlMessageCodec, fl_message_codec, FL, MESSAGE_CODEC, GObject) struct _FlMessageCodecClass |
GBytes * | fl_message_codec_encode_message (FlMessageCodec *codec, FlValue *message, GError **error) |
FlValue * | fl_message_codec_decode_message (FlMessageCodec *codec, GBytes *message, GError **error) |
#define FL_MESSAGE_CODEC_ERROR fl_message_codec_error_quark() |
FlMessageCodecError: @FL_MESSAGE_CODEC_ERROR_FAILED: Codec failed due to an unspecified error. @FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA: Codec ran out of data reading a value. @FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA: Additional data encountered in message. @FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE: Codec encountered an unsupported FlValue.
Errors for #FlMessageCodec objects to set on failures.
Definition at line 30 of file fl_message_codec.h.
enum FlMessageCodecError |
Enumerator | |
---|---|
FL_MESSAGE_CODEC_ERROR_FAILED | |
FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA | |
FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA | |
FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE |
Definition at line 32 of file fl_message_codec.h.
FlValue* fl_message_codec_decode_message | ( | FlMessageCodec * | codec, |
GBytes * | message, | ||
GError ** | error | ||
) |
fl_message_codec_decode_message: @codec: an #FlMessageCodec. @message: binary message to decode. @error: (allow-none): #GError location to store the error occurring, or NULL.
Decodes a message from a binary encoding.
Returns: an FlValue or NULL on error.
Definition at line 33 of file fl_message_codec.cc.
References error.
Referenced by decode_error_value(), decode_message(), decode_message_with_codec(), decode_semantic_data(), fl_basic_message_channel_send_finish(), fl_json_method_codec_decode_method_call(), fl_json_method_codec_decode_response(), FlValueStringMatcher::MatchAndExplain(), MATCHER_P2(), message_cb(), and TEST().
GBytes* fl_message_codec_encode_message | ( | FlMessageCodec * | codec, |
FlValue * | message, | ||
GError ** | error | ||
) |
fl_message_codec_encode_message: @codec: an #FlMessageCodec. @buffer: buffer to write to. @message: message to encode or NULL to encode the null value. @error: (allow-none): #GError location to store the error occurring, or NULL.
Encodes a message into a binary representation.
Returns: a binary encoded message or NULL on error.
Definition at line 17 of file fl_message_codec.cc.
References error, and fl_value_new_null().
Referenced by encode_message(), encode_message_error(), encode_message_with_codec(), fl_accessible_text_field_perform_action(), fl_basic_message_channel_respond(), fl_basic_message_channel_send(), fl_json_method_codec_encode_error_envelope(), fl_json_method_codec_encode_method_call(), fl_json_method_codec_encode_success_envelope(), perform_set_selection_action(), perform_set_text_action(), send_lifecycle_state(), and TEST().
G_MODULE_EXPORT GQuark fl_message_codec_error_quark | ( | void | ) |
G_MODULE_EXPORT G_DECLARE_DERIVABLE_TYPE | ( | FlMessageCodec | , |
fl_message_codec | , | ||
FL | , | ||
MESSAGE_CODEC | , | ||
GObject | |||
) |
FlMessageCodec:
#FlMessageCodec is a message encoding/decoding mechanism that operates on FlValue objects. Both operations returns errors if the conversion fails. Such situations should be treated as programming errors.
#FlMessageCodec matches the MethodCodec class in the Flutter services library.
FlMessageCodec::encode_message: @codec: an #FlMessageCodec. @message: message to encode or NULL to encode the null value. @error: (allow-none): #GError location to store the error occurring, or NULL.
Virtual method to encode a message. A subclass must implement this method. If the subclass cannot handle the type of @message then it must generate a FL_MESSAGE_CODEC_ERROR_UNSUPPORTED_TYPE error.
Returns: a binary message or NULL on error.
FlMessageCodec::decode_message: @codec: an #FlMessageCodec. @message: binary message to decode. @error: (allow-none): #GError location to store the error occurring, or NULL.
Virtual method to decode a message. A subclass must implement this method. If @message is too small then a FL_MESSAGE_CODEC_ERROR_OUT_OF_DATA error must be generated. If @message is too large then a FL_MESSAGE_CODEC_ERROR_ADDITIONAL_DATA error must be generated.
Returns: an FlValue or NULL on error.
Definition at line 45 of file fl_message_codec.h.
References error.