TomFileSystemBase class abstract

A TomFileSystem whose implementation supplies the primitives — list, stat, read, write, create, rename, trash, delete, watch — and announces its own changes with emitChange.

Implemented types
Implementers

Constructors

TomFileSystemBase(Uri root)
root must be an absolute directory URI.

Properties

hashCode → int
The hash code for this object.
no setterinherited
onDidChange → Stream<TomFileChangeEvent>
Every create, write, rename and delete made through this file system.
no setteroverride
onDidSave → Stream<Uri>
no setteroverride
onWillSave → Stream<TomWillSaveEvent>
no setteroverride
root → Uri
The root directory, as an absolute directory URI (trailing /).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

absolute(Uri uri) → Uri
uri made absolute against root.
create(Uri uri, {bool directory = false}) → Future<void>
Creates an empty file, or with directory a folder with its parents. A file that already exists is refused.
inherited
delete(Uri uri) → Future<void>
Deletes uri for good — a folder with everything in it.
inherited
dispose() → Future<void>
Ends the event streams.
override
emitChange(Uri uri, TomFileChangeType type) → void
Announces a change made through this file system.
exists(Uri uri) → Future<bool>
Whether uri exists.
inherited
list(Uri directory) → Future<List<TomFileEntry>>
The entries of the directory directory — one level, unsorted.
inherited
nameOf(Uri uri) → String
The last segment of uri's path — a file's or folder's own name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pathOf(Uri uri) → String?
uri's path relative to root, or null when it lies outside it.
override
read(Uri uri) → Future<TomFileContent>
The bytes of uri and the revision they were read at.
inherited
readSlice(Uri uri, {required int maxBytes, required bool fromEnd}) → Future<String?>
At most maxBytes of uri as text, from its end when fromEnd and from its start otherwise — or null when it does not exist.
inherited
readText(Uri uri) → Future<String>
The text of uri, decoded as UTF-8.
override
rename(Uri from, Uri to) → Future<void>
Renames or moves from to to; an existing to is refused.
inherited
save(Uri uri) → Future<void>
Announces that uri is saved: onWillSave with its text, then onDidSave.
override
stat(Uri uri) → Future<TomFileEntry?>
uri's entry without reading it, or null when it does not exist.
inherited
toString() → String
A string representation of this object.
inherited
trash(Uri uri) → Future<bool>
Deletes uri by moving it to the platform's trash. Answers false when there is no trash to move it to — the caller then asks before delete: nothing is unlinked without a way back unless somebody said so.
inherited
uriOf(String path) → Uri
The absolute URI of path, relative to root with / separators.
override
watch({bool descend(String path)?}) → Stream<TomFileChange>?
Changes under root, or null when the platform refuses to watch.
inherited
write(Uri uri, Uint8List bytes, {TomFileRevision? expected}) → Future<TomFileRevision>
Writes bytes to uri atomically. With expected, refuses with a TomFileConflict when the file is no longer that revision. Answers the revision written.
inherited
writeText(Uri uri, String text, {TomFileRevision? expected}) → Future<TomFileRevision>
write of text as UTF-8.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited