| Flutter macOS Embedder |

FlutterStandardCodec_Internal.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_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
7
8 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterCodecs.h"
9 #import "flutter/shell/platform/darwin/common/framework/Source/FlutterStandardCodecHelper.h"
10
11 namespace flutter {
12 FlutterStandardField FlutterStandardFieldForDataType(
13 FlutterStandardDataType type) {
14 switch (type) {
15 case FlutterStandardDataTypeUInt8:
16 return FlutterStandardFieldUInt8Data;
17 case FlutterStandardDataTypeInt32:
18 return FlutterStandardFieldInt32Data;
19 case FlutterStandardDataTypeInt64:
20 return FlutterStandardFieldInt64Data;
21 case FlutterStandardDataTypeFloat32:
22 return FlutterStandardFieldFloat32Data;
23 case FlutterStandardDataTypeFloat64:
24 return FlutterStandardFieldFloat64Data;
25 }
26 }
27 FlutterStandardDataType FlutterStandardDataTypeForField(
28 FlutterStandardField field) {
29 switch (field) {
30 case FlutterStandardFieldUInt8Data:
31 return FlutterStandardDataTypeUInt8;
32 case FlutterStandardFieldInt32Data:
33 return FlutterStandardDataTypeInt32;
34 case FlutterStandardFieldInt64Data:
35 return FlutterStandardDataTypeInt64;
36 case FlutterStandardFieldFloat32Data:
37 return FlutterStandardDataTypeFloat32;
38 case FlutterStandardFieldFloat64Data:
39 return FlutterStandardDataTypeFloat64;
40 default:
41 return FlutterStandardDataTypeUInt8;
42 }
43 }
44
45 UInt8 elementSizeForFlutterStandardDataType(FlutterStandardDataType type) {
46 switch (type) {
47 case FlutterStandardDataTypeUInt8:
48 return 1;
49 case FlutterStandardDataTypeInt32:
50 return 4;
51 case FlutterStandardDataTypeInt64:
52 return 8;
53 case FlutterStandardDataTypeFloat32:
54 return 4;
55 case FlutterStandardDataTypeFloat64:
56 return 8;
57 }
58 }
59 } // namespace flutter
60
61 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODEC_INTERNAL_H_
flutter::FlutterStandardFieldForDataType
FlutterStandardField FlutterStandardFieldForDataType(FlutterStandardDataType type)
Definition: FlutterStandardCodec_Internal.h:12
FlutterStandardFieldFloat32Data
@ FlutterStandardFieldFloat32Data
Definition: FlutterStandardCodecHelper.h:35
flutter::FlutterStandardDataTypeForField
FlutterStandardDataType FlutterStandardDataTypeForField(FlutterStandardField field)
Definition: FlutterStandardCodec_Internal.h:27
FlutterStandardFieldInt32Data
@ FlutterStandardFieldInt32Data
Definition: FlutterStandardCodecHelper.h:30
FlutterStandardFieldUInt8Data
@ FlutterStandardFieldUInt8Data
Definition: FlutterStandardCodecHelper.h:29
FlutterStandardCodecHelper.h
flutter::elementSizeForFlutterStandardDataType
UInt8 elementSizeForFlutterStandardDataType(FlutterStandardDataType type)
Definition: FlutterStandardCodec_Internal.h:45
flutter
Definition: AccessibilityBridgeMac.h:16
FlutterCodecs.h
FlutterStandardField
FlutterStandardField
Definition: FlutterStandardCodecHelper.h:19
FlutterStandardFieldFloat64Data
@ FlutterStandardFieldFloat64Data
Definition: FlutterStandardCodecHelper.h:32
FlutterStandardFieldInt64Data
@ FlutterStandardFieldInt64Data
Definition: FlutterStandardCodecHelper.h:31