Flutter Engine
fl_standard_message_codec_private.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_STANDARD_MESSAGE_CODEC_PRIVATE_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_STANDARD_MESSAGE_CODEC_PRIVATE_H_
7 
8 #include "flutter/shell/platform/linux/public/flutter_linux/fl_standard_message_codec.h"
9 
10 G_BEGIN_DECLS
11 
12 /**
13  * fl_standard_message_codec_write_size:
14  * @codec: an #FlStandardMessageCodec.
15  * @buffer: buffer to write into.
16  * @size: size value to write.
17  *
18  * Writes a size field in Flutter Standard encoding.
19  */
20 void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
21  GByteArray* buffer,
22  uint32_t size);
23 
24 /**
25  * fl_standard_message_codec_read_size:
26  * @codec: an #FlStandardMessageCodec.
27  * @buffer: buffer to read from.
28  * @offset: (inout): read position in @buffer.
29  * @value: location to read size.
30  * @error: (allow-none): #GError location to store the error occurring, or
31  * %NULL.
32  *
33  * Reads a size field in Flutter Standard encoding.
34  *
35  * Returns: %TRUE on success.
36  */
37 gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
38  GBytes* buffer,
39  size_t* offset,
40  uint32_t* value,
41  GError** error);
42 
43 /**
44  * fl_standard_message_codec_write_value:
45  * @codec: an #FlStandardMessageCodec.
46  * @buffer: buffer to write into.
47  * @value: (allow-none): value to write.
48  * @error: (allow-none): #GError location to store the error occurring, or
49  * %NULL.
50  *
51  * Writes an #FlValue in Flutter Standard encoding.
52  *
53  * Returns: %TRUE on success.
54  */
55 gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec* codec,
56  GByteArray* buffer,
57  FlValue* value,
58  GError** error);
59 
60 /**
61  * fl_standard_message_codec_read_value:
62  * @codec: an #FlStandardMessageCodec.
63  * @buffer: buffer to read from.
64  * @offset: (inout): read position in @buffer.
65  * @value: location to read size.
66  * @error: (allow-none): #GError location to store the error occurring, or
67  * %NULL.
68  *
69  * Reads an #FlValue in Flutter Standard encoding.
70  *
71  * Returns: a new #FlValue or %NULL on error.
72  */
73 FlValue* fl_standard_message_codec_read_value(FlStandardMessageCodec* codec,
74  GBytes* buffer,
75  size_t* offset,
76  GError** error);
77 
78 G_END_DECLS
79 
80 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_STANDARD_MESSAGE_CODEC_PRIVATE_H_
G_BEGIN_DECLS void fl_standard_message_codec_write_size(FlStandardMessageCodec *codec, GByteArray *buffer, uint32_t size)
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:39
FlMethodResponse GError ** error
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec *codec, GByteArray *buffer, FlValue *value, GError **error)
uint8_t value
FlValue * fl_standard_message_codec_read_value(FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, GError **error)
gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec *codec, GBytes *buffer, size_t *offset, uint32_t *value, GError **error)