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)
-
rootmust 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 -
urimade absolute against root. -
create(
Uri uri, {bool directory = false}) → Future< void> -
Creates an empty file, or with
directorya folder with its parents. A file that already exists is refused.inherited -
delete(
Uri uri) → Future< void> -
Deletes
urifor 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
uriexists.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
uriand the revision they were read at.inherited -
readSlice(
Uri uri, {required int maxBytes, required bool fromEnd}) → Future< String?> -
At most
maxBytesofurias text, from its end whenfromEndand 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
fromtoto; an existingtois refused.inherited -
save(
Uri uri) → Future< void> -
Announces that
uriis 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
uriby 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
bytestouriatomically. Withexpected, 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
textas UTF-8.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited