Flutter macOS Embedder
ExtendedReader Class Reference
Inheritance diagram for ExtendedReader:
FlutterStandardReader

Instance Methods

(id) - readValueOfType:
 
- Instance Methods inherited from FlutterStandardReader
(instancetype) - initWithData:
 
(BOOL) - hasMore
 
(UInt8) - readByte
 
(void) - readBytes:length:
 
(NSData *) - readData:
 
(UInt32) - readSize
 
(void) - readAlignment:
 
(NSString *) - readUTF8
 
(nullable id) - readValue
 

Detailed Description

Definition at line 54 of file flutter_standard_codec_unittest.mm.

Method Documentation

◆ readValueOfType:

- (id) readValueOfType: (UInt8)  type

Decodes a value matching the type specified.

See also:

Reimplemented from FlutterStandardReader.

Definition at line 59 of file flutter_standard_codec_unittest.mm.

59  :(UInt8)type {
60  switch (type) {
61  case kDATE: {
62  SInt64 value;
63  [self readBytes:&value length:8];
64  NSTimeInterval time = [NSNumber numberWithLong:value].doubleValue / 1000.0;
65  return [NSDate dateWithTimeIntervalSince1970:time];
66  }
67  case kPAIR: {
68  return [[Pair alloc] initWithLeft:[self readValue] right:[self readValue]];
69  }
70  default:
71  return [super readValueOfType:type];
72  }
73 }

References kDATE, kPAIR, FlutterStandardReader::readBytes:length:, FlutterStandardReader::readValue, and FlutterStandardReader::readValueOfType:.


The documentation for this class was generated from the following file:
Pair
Definition: flutter_standard_codec_unittest.mm:11
kDATE
static const UInt8 kDATE
Definition: flutter_standard_codec_unittest.mm:28
kPAIR
static const UInt8 kPAIR
Definition: flutter_standard_codec_unittest.mm:29