blob: 58839630207771294925d5682838cdcf9c9a7dd6 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:file/file.dart';
import 'codecs.dart';
/// [FileStat] implementation that derives its properties from a recorded
/// invocation event.
class ReplayFileStat implements FileStat {
final Map<String, dynamic> _data;
/// Creates a new `ReplayFileStat` that will derive its properties from the
/// specified [data].
ReplayFileStat(Map<String, dynamic> data) : _data = data;
DateTime get changed => DateTimeCodec.deserialize.convert(_data['changed']);
DateTime get modified => DateTimeCodec.deserialize.convert(_data['modified']);
DateTime get accessed => DateTimeCodec.deserialize.convert(_data['accessed']);
FileSystemEntityType get type =>
int get mode => _data['mode'];
int get size => _data['size'];
String modeString() => _data['modeString'];