Flutter Engine
 
Loading...
Searching...
No Matches
FlutterStandardWriter Class Reference

#include <FlutterCodecs.h>

Inheritance diagram for FlutterStandardWriter:
ExtendedWriter

Instance Methods

(instancetype) - initWithData:
 
(void) - writeByte:
 
(void) - writeBytes:length:
 
(void) - writeData:
 
(void) - writeSize:
 
(void) - writeAlignment:
 
(void) - writeUTF8:
 
(void) - writeValue:
 

Detailed Description

A writer of the Flutter standard binary encoding.

See FlutterStandardMessageCodec for details on the encoding.

The encoding is extensible via subclasses overriding writeValue.

Definition at line 92 of file FlutterCodecs.h.

Method Documentation

◆ initWithData:

- (instancetype) initWithData: (NSMutableData*)  data
Initial value:
{
NSMutableData* _data

Create a FlutterStandardWriter who will write to data.

Definition at line 8 of file FlutterStandardCodec.mm.

206 :(NSMutableData*)data {
207 self = [super init];
208 NSAssert(self, @"Super init cannot be nil");
209 _data = data;
210 return self;
211}
std::shared_ptr< const fml::Mapping > data

◆ writeAlignment:

- (void) writeAlignment: (UInt8)  alignment

Write zero padding until data is aligned with alignment.

Definition at line 8 of file FlutterStandardCodec.mm.

229 :(UInt8)alignment {
230 FlutterStandardCodecHelperWriteAlignment((__bridge CFMutableDataRef)_data, alignment);
231}
void FlutterStandardCodecHelperWriteAlignment(CFMutableDataRef data, uint8_t alignment)

◆ writeByte:

- (void) writeByte: (UInt8)  value

Write a 8-bit byte.

Definition at line 8 of file FlutterStandardCodec.mm.

213 :(UInt8)value {
214 FlutterStandardCodecHelperWriteByte((__bridge CFMutableDataRef)_data, value);
215}
void FlutterStandardCodecHelperWriteByte(CFMutableDataRef data, uint8_t value)

◆ writeBytes:length:

- (void) writeBytes: (const void*)  bytes
length: (NSUInteger)  length 

Write an array of bytes of size length.

Definition at line 8 of file FlutterStandardCodec.mm.

217 :(const void*)bytes length:(NSUInteger)length {
218 FlutterStandardCodecHelperWriteBytes((__bridge CFMutableDataRef)_data, bytes, length);
219}
void FlutterStandardCodecHelperWriteBytes(CFMutableDataRef data, const void *bytes, unsigned long length)
size_t length

◆ writeData:

- (void) writeData: (NSData*)  data

Write an array of bytes contained in data.

Definition at line 8 of file FlutterStandardCodec.mm.

221 :(NSData*)data {
222 FlutterStandardCodecHelperWriteData((__bridge CFMutableDataRef)_data, (__bridge CFDataRef)data);
223}
void FlutterStandardCodecHelperWriteData(CFMutableDataRef data, CFDataRef value)

◆ writeSize:

- (void) writeSize: (UInt32)  size

Write 32-bit unsigned integer that represents a size of a collection.

Definition at line 8 of file FlutterStandardCodec.mm.

225 :(UInt32)size {
226 FlutterStandardCodecHelperWriteSize((__bridge CFMutableDataRef)_data, size);
227}
void FlutterStandardCodecHelperWriteSize(CFMutableDataRef data, uint32_t size)
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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

◆ writeUTF8:

- (void) writeUTF8: (NSString*)  value

Write a string with UTF-8 encoding.

Definition at line 8 of file FlutterStandardCodec.mm.

233 :(NSString*)value {
234 FlutterStandardCodecHelperWriteUTF8((__bridge CFMutableDataRef)_data,
235 (__bridge CFStringRef)value);
236}
void FlutterStandardCodecHelperWriteUTF8(CFMutableDataRef data, CFStringRef value)

◆ writeValue:

- (void) writeValue: (id value

Introspects into an object and writes its representation.

Supported Data Types:

  • NSNull
  • NSNumber
  • NSString (as UTF-8)
  • FlutterStandardTypedData
  • NSArray of supported types
  • NSDictionary of supporte types

NSAsserts on failure.

Reimplemented in ExtendedWriter.

Definition at line 280 of file FlutterStandardCodec.mm.

347 :(id)value {
348 FlutterStandardCodecObjcType type = GetWriteType(value);
349 WriteValueOfType((__bridge CFTypeRef)self, (__bridge CFMutableDataRef)self->_data, type,
350 (__bridge CFTypeRef)value);
351}
GLenum type
const uintptr_t id

References flutter::data, FlutterStandardTypedData::data, FlutterStandardTypedData::elementCount, FlutterStandardTypedData::elementSize, FlutterStandardCodecHelperWriteAlignment(), FlutterStandardCodecHelperWriteByte(), FlutterStandardCodecHelperWriteData(), FlutterStandardCodecHelperWriteNumber(), FlutterStandardCodecHelperWriteSize(), FlutterStandardCodecHelperWriteUTF8(), FlutterStandardCodecObjcTypeFlutterStandardTypedData, FlutterStandardCodecObjcTypeNil, FlutterStandardCodecObjcTypeNSArray, FlutterStandardCodecObjcTypeNSData, FlutterStandardCodecObjcTypeNSDictionary, FlutterStandardCodecObjcTypeNSNumber, FlutterStandardCodecObjcTypeNSString, FlutterStandardCodecObjcTypeUnknown, flutter::FlutterStandardFieldForDataType(), FlutterStandardFieldList, FlutterStandardFieldMap, FlutterStandardFieldNil, FlutterStandardFieldString, i, id, type, FlutterStandardTypedData::type, value, and WriteKeyValuesInfo::writer.


The documentation for this class was generated from the following files: