Closed Warpten closed 5 years ago
Slightly improved by e32095757196d364895fce40e7bf44eed8c2ab5a.
Problems
Desirable improvement: parse the header up front (before even considering parsing the file) and select the parser based on that
Further improved, the issue of not knowing the header is read upfront still persists
Closed by f2456da316deed83dce3cf17431367b6203a4412
Headers are poorly handled and need a rewrite. stat.
Current implementation:
Header
type is provided to the user - it only exposes record count, signature, and uh, that's it I think ? Takes an implementation ofIFileHeader
or another instance of itself as ctor argument.IFileHeader
is an interface that acts as a base for all header types, which are defined per-signature. This means that header implementations turn into property hell.Desirable properties of new headers:
struct
), bonus points for immutability (readonly struct
).Unsafe.SizeOf<T>()
must match the binary size of the header in the file (give or take the 4 bytes for magic identifier).ref readonly
getter returns).=> throw new NotImplementedException();
is the default "i shouldn't be called" implementation. If you don't have it, don't expose it.