Draft
Conversation
Today, lots of information about how a file or JSON becomes a disk image is embedded in the metadata for the image and/or disk. This makes it hard to write back to the source when the in-memory disk image changes. This refactoring is an attempt to break out all of the bits of logic into composable pieces. While this is mestly concerned with reading right now, the idea is that it will eventually allow configuring writing as well. The main goal is to allow round-tripping to the same file on disk, but, in theory, it could also save to a different file or the local database, too. Note that this is a work in progress.
Contributor
Author
|
@whscullin This is very much a work in progress, but I wanted to give you an idea of what I was thinking about. Please let me know if you think this is the wrong direction. |
whscullin
reviewed
Jun 7, 2022
Owner
whscullin
left a comment
There was a problem hiding this comment.
I like the ideas here. The names are a bit verbose but they are descriptive and naming is hard, so 🤷 .
| import type { byte } from '../types'; | ||
| import { NibbleDisk, DiskOptions, ENCODING_NIBBLE } from './types'; | ||
| import { NibbleDisk, DiskOptions, ENCODING_NIBBLE, TrackSectorSource } from './types'; | ||
| import { ByteArrayArrayTrackSectorSource, ByteArrayByteSource, ByteTrackSectorSource, ProdosOrderedTrackSectorSource, TrackSector6x2NibbleTrackSource } from './sources'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today, lots of information about how a file or JSON becomes a disk
image is embedded in the metadata for the image and/or disk. This
makes it hard to write back to the source when the in-memory disk
image changes.
This refactoring is an attempt to break out all of the bits of logic
into composable pieces. While this is mestly concerned with reading
right now, the idea is that it will eventually allow configuring
writing as well. The main goal is to allow round-tripping to the same
file on disk, but, in theory, it could also save to a different file
or the local database, too.
Note that this is a work in progress.