lib: Add hierarchical FileType framework #143

Merged
Jan Lindemann merged 1 commit from jan/feature/20261017-lib-add-hierarchical-filetype-framework into master 2026-10-17 10:05:04 +02:00 AGit
Owner

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() and mkdir() to allow creating typed FileContext objects.

Builtin types are:

  • FT_REG: A regular file, the default thing put() creates
  • FT_DIR: A directory, the default thing mkdir() creates
  • FT_TOP: The parent of the two
  • FT_COMPOUND: An FT_REG returning child entries from readdir()
#### 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()` and `mkdir()` to allow creating typed FileContext objects. Builtin types are: - `FT_REG`: A regular file, the default thing `put()` creates - `FT_DIR`: A directory, the default thing `mkdir()` creates - `FT_TOP`: The parent of the two - `FT_COMPOUND`: An `FT_REG` returning child entries from `readdir()`
lib: Add hierarchical FileType framework
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m51s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m53s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m45s
CI / Packaging test (push) Successful in 0s
0d0f1966ef
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() and mkdir() to allow creating
typed FileContext objects.

Builtin types are:

  - FT_REG: A regular file, the default thing put() creates
  - FT_DIR: A directory, the default thing mkdir() creates
  - FT_TOP: The parent of the two
  - FT_COMPOUND: An FT_REG returning child entries from readdir()

Signed-off-by: Jan Lindemann <jan@janware.com>
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.0.1
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-10-17 09:55:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!143
No description provided.