lib: Add hierarchical FileType framework #143
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261017-lib-add-hierarchical-filetype-framework"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
lib: Add hierarchical FileType framework
Introduce FileType, a class consisting of a name and a parent property, designed to make the information
FileContext.stat()provides about a path-addressable object richer.A FileType property goes as ftype into the StatResult structure. Along with it, this commit adds a central registry (FileTypes) where the type hierarchy is kept, and additional parameters to
put()andmkdir()to allow creating typed FileContext objects.Builtin types are:
FT_REG: A regular file, the default thingput()createsFT_DIR: A directory, the default thingmkdir()createsFT_TOP: The parent of the twoFT_COMPOUND: AnFT_REGreturning child entries fromreaddir()