Flutter Engine
The Flutter Engine
FlutterStandardCodecHelper.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_FLUTTERSTANDARDCODECHELPER_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODECHELPER_H_
7
8#include <CoreFoundation/CoreFoundation.h>
9#include <stdbool.h>
10#include <stdint.h>
11
12#if defined(__cplusplus)
13extern "C" {
14#endif
15
16// NOLINTBEGIN(google-runtime-int)
17
18// Note: Update FlutterStandardFieldIsStandardType if this changes.
19typedef enum {
20 // NOLINTBEGIN(readability-identifier-naming)
36 // NOLINTEND(readability-identifier-naming)
38
39static inline bool FlutterStandardFieldIsStandardType(uint8_t field) {
40 return field <= FlutterStandardFieldFloat32Data &&
42}
43
44typedef enum {
45 // NOLINTBEGIN(readability-identifier-naming)
54 // NOLINTEND(readability-identifier-naming)
56
57// NOLINTBEGIN(google-objc-function-naming)
58
59///////////////////////////////////////////////////////////////////////////////
60///\name Reader Helpers
61///@{
62
63void FlutterStandardCodecHelperReadAlignment(unsigned long* location,
64 uint8_t alignment);
65
66void FlutterStandardCodecHelperReadBytes(unsigned long* location,
67 unsigned long length,
68 void* destination,
69 CFDataRef data);
70
71uint8_t FlutterStandardCodecHelperReadByte(unsigned long* location,
72 CFDataRef data);
73
74uint32_t FlutterStandardCodecHelperReadSize(unsigned long* location,
75 CFDataRef data);
76
77CFStringRef FlutterStandardCodecHelperReadUTF8(unsigned long* location,
78 CFDataRef data);
79
81 unsigned long* location,
82 CFDataRef data,
83 uint8_t type,
84 CFTypeRef (*ReadValue)(CFTypeRef),
85 CFTypeRef (*ReadTypedDataOfType)(FlutterStandardField, CFTypeRef),
86 CFTypeRef user_data);
87
88///@}
89
90///////////////////////////////////////////////////////////////////////////////
91///\name Writer Helpers
92///@{
93
94void FlutterStandardCodecHelperWriteByte(CFMutableDataRef data, uint8_t value);
95
96void FlutterStandardCodecHelperWriteBytes(CFMutableDataRef data,
97 const void* bytes,
98 unsigned long length);
99
100void FlutterStandardCodecHelperWriteSize(CFMutableDataRef data, uint32_t size);
101
103 uint8_t alignment);
104
105void FlutterStandardCodecHelperWriteUTF8(CFMutableDataRef data,
106 CFStringRef value);
107
108void FlutterStandardCodecHelperWriteData(CFMutableDataRef data,
109 CFDataRef value);
110
111bool FlutterStandardCodecHelperWriteNumber(CFMutableDataRef data,
112 CFNumberRef number);
113
114///@}
115
116// NOLINTEND(google-objc-function-naming)
117// NOLINTEND(google-runtime-int)
118
119#if defined(__cplusplus)
120}
121#endif
122
123#endif // FLUTTER_SHELL_PLATFORM_DARWIN_COMMON_FRAMEWORK_SOURCE_FLUTTERSTANDARDCODECHELPER_H_
@ FlutterStandardFieldUInt8Data
@ FlutterStandardFieldFloat64
@ FlutterStandardFieldFloat32Data
@ FlutterStandardFieldIntHex
@ FlutterStandardFieldMap
@ FlutterStandardFieldInt64Data
@ FlutterStandardFieldList
@ FlutterStandardFieldInt32
@ FlutterStandardFieldNil
@ FlutterStandardFieldTrue
@ FlutterStandardFieldString
@ FlutterStandardFieldFalse
@ FlutterStandardFieldInt32Data
@ FlutterStandardFieldInt64
@ FlutterStandardFieldFloat64Data
CFTypeRef FlutterStandardCodecHelperReadValueOfType(unsigned long *location, CFDataRef data, uint8_t type, CFTypeRef(*ReadValue)(CFTypeRef), CFTypeRef(*ReadTypedDataOfType)(FlutterStandardField, CFTypeRef), CFTypeRef user_data)
bool FlutterStandardCodecHelperWriteNumber(CFMutableDataRef data, CFNumberRef number)
void FlutterStandardCodecHelperWriteData(CFMutableDataRef data, CFDataRef value)
uint8_t FlutterStandardCodecHelperReadByte(unsigned long *location, CFDataRef data)
void FlutterStandardCodecHelperWriteSize(CFMutableDataRef data, uint32_t size)
CFStringRef FlutterStandardCodecHelperReadUTF8(unsigned long *location, CFDataRef data)
void FlutterStandardCodecHelperWriteBytes(CFMutableDataRef data, const void *bytes, unsigned long length)
FlutterStandardCodecObjcType
@ FlutterStandardCodecObjcTypeNSArray
@ FlutterStandardCodecObjcTypeFlutterStandardTypedData
@ FlutterStandardCodecObjcTypeNSData
@ FlutterStandardCodecObjcTypeNSString
@ FlutterStandardCodecObjcTypeNil
@ FlutterStandardCodecObjcTypeUnknown
@ FlutterStandardCodecObjcTypeNSDictionary
@ FlutterStandardCodecObjcTypeNSNumber
void FlutterStandardCodecHelperWriteUTF8(CFMutableDataRef data, CFStringRef value)
void FlutterStandardCodecHelperWriteByte(CFMutableDataRef data, uint8_t value)
uint32_t FlutterStandardCodecHelperReadSize(unsigned long *location, CFDataRef data)
static bool FlutterStandardFieldIsStandardType(uint8_t field)
void FlutterStandardCodecHelperReadAlignment(unsigned long *location, uint8_t alignment)
void FlutterStandardCodecHelperWriteAlignment(CFMutableDataRef data, uint8_t alignment)
void FlutterStandardCodecHelperReadBytes(unsigned long *location, unsigned long length, void *destination, CFDataRef data)
GLenum type
uint8_t value
size_t length
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
void * user_data