Skip to content
/ Dire Public

Complete cross-platform solution for data and user directories discovery.

License

Notifications You must be signed in to change notification settings

Dich0tomy/Dire

Repository files navigation

Dire

Warning

Still WIP. Wait a few days before this gets properly released with proper docs and build options.

Note

This started as a simple port of dirs-dev/directories-rs, but deviated in the process, the exact details can be found here.

A complete cross-platform solution for user and data directories discovery with OOTB project support.

TODO:

  • Add tests for everything (the tests are probably not perfect but good enough for now)
  • Add bundle functions (a function returning a struct with all the paths)
  • Refactor so far #1
  • Package with Nix [ "lib" "dev" "bin " ]
  • Add proper meson building (with subprojects)
  • Add proper CMake building (with FetchContent)
  • Add proper license :)))
  • Remove CTRE fir xdg parsing
  • CI
    • Linux - Nix with { CMake, Meson } x { Gcc, Clang }
    • Mac - Nix with { CMake, Meson } x { Gcc, Clang }
    • Windows - { CMake, Meson } x MSVC
  • Merge PR and go public
  • Change codeowners
  • Documentation generation
  • Write docs with diataxis fr
  • Releases on GitHub
  • Refactor so far #3
  • Better readme (diataxis docs)
  • Refactor so far #4

Plans:

  • Add conan and vcpkg packaging methods *

  • Package returned dirs in special objects with the following methods *:

    • writable() -> bool - cross platform checking if the dir is writable into (we mean every notion of writable - delete, update, create new file, etc.)
    • readable() -> bool - cross platform checking if the dir is readble (same here)
    • writable_and_readable() -> bool - return writable() and readable();
    • Since the lib will offer readable(), maybe also try to find font paths on windows? Possibly??
    • is_empty() -> bool - checks if the directory is empty
    • purge() -> bool (only for project) - removes the directory with the files inside
    • clear() -> bool (only for project) - clears files inside

    All of these would possibly return something else than bool for better error handling, especialy purge() and clear().

  • Something akin to appendExtra(Data|Config)Directories from sago007/PlatformFolders *:

  • Split libdire into totally independent modules, eg. 3 separate targets - base, user and project *,

    • The user would not pay for the modules they don't want (possible faster builds, smaller binary size, etc., shouldn't be much of an issue tho, the library is extremely small)
    • Would introduce duplication in certain modules but I guess we're fine with that, the lib is tiny
  • Rewrite the library to be C++17 or even C++11 compatible *:

    • That would require throwing out CTRE and rolling our own simple XDG record parser
  • Allow for WebAsm targets *:

  • Split the underlying xdg dirs and known folders api into a separate lib *:

* Only if there will be need to, e.g. someone asks for that or it will be a feasible fix for an issue