xdgDataDirs

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

Examples

auto dataDirsGuard = EnvGuard("XDG_DATA_DIRS");

auto newDataDirs = ["/usr/local/data", "/usr/data"];

environment["XDG_DATA_DIRS"] = "/usr/local/data:/usr/data:/usr/local/data/:/usr/data/";
assert(xdgDataDirs() == newDataDirs);
assert(equal(xdgDataDirs("applications"), newDataDirs.map!(p => buildPath(p, "applications"))));

environment.remove("XDG_DATA_DIRS");
assert(xdgDataDirs() == ["/usr/local/share", "/usr/share"]);
assert(equal(xdgDataDirs("icons"), ["/usr/local/share", "/usr/share"].map!(p => buildPath(p, "icons"))));

Meta