size property
The size of the file system object.
Implementation
@override
int get size {
if (_impl == null) {
return -1;
}
if (_impl is MemoryFileImplementation) {
return (_impl as MemoryFileImplementation).bytes.length;
}
if (_impl is MapBasedFsDirectoryImplementation) {
int size = 0;
for (final entry in _fs.toMap().entries) {
if (entry.key.startsWith(_path) && entry.key != _path) {
if (entry.value is MemoryFileImplementation) {
size += (entry.value as MemoryFileImplementation).bytes.length;
}
}
}
return size;
}
throw UnimplementedError(
'TODO: implement size for MemoryDirectoryImplementation');
}