Miss-Inputs/ROMniscience

Autodetect file type (for individual file view)

Miss-Inputs opened this issue · 0 comments

Here's where it might get interesting.

For unknown file types, while we have let the user choose any handler to try and read it, maybe they don't know what it is.

Anyway, we'd have to add a thing to the Handler base class (providing a useless virtual method to make it optional for classes to override), and I guess it just takes a Stream or ROMFile and returns a bool, true if this could be handled by this handler (from looking at magic numbers, etc) or false if not.

Or perhaps it should return an enum with 4 possible values of it is a valid file, it might be a valid file, it probably isn't a valid file, and it definitely isn't? Or maybe that's too complicated.