xdgAllDataDirs

Undocumented in source. Be warned that the author may not have intended to support it.
  1. string[] xdgAllDataDirs(string subfolder)
  2. string[] xdgAllDataDirs(string subfolder)
    @trusted nothrow
    static if(isFreedesktop)
    string[]
    xdgAllDataDirs
    (
    string subfolder = null
    )

Examples

auto homeGuard = EnvGuard("HOME");
auto dataHomeGuard = EnvGuard("XDG_DATA_HOME");
auto dataDirsGuard = EnvGuard("XDG_DATA_DIRS");

auto newDataHome = "/home/myuser/data";
auto newDataDirs = ["/usr/local/data", "/usr/data"];
environment["XDG_DATA_HOME"] = newDataHome;
environment["XDG_DATA_DIRS"] = "/usr/local/data:/usr/data";

assert(xdgAllDataDirs() == newDataHome ~ newDataDirs);

environment.remove("XDG_DATA_HOME");
environment.remove("HOME");

assert(xdgAllDataDirs() == newDataDirs);

Meta