SlHelpers
SlHelpers::HomeDir Class Reference

Helpers for $HOME directory. More...

#include <HomeDir.h>

Static Public Member Functions

static std::filesystem::path get () noexcept
 Obtains home directory. More...
 
static std::filesystem::path getCacheDir () noexcept
 Obtains directory for caching. More...
 
static std::filesystem::path createCacheDir (const std::filesystem::path &subdir) noexcept
 Creates (if not existing) and returns getCacheDir() / subdir. More...
 

Detailed Description

Helpers for $HOME directory.

Member Function Documentation

◆ createCacheDir()

static std::filesystem::path SlHelpers::HomeDir::createCacheDir ( const std::filesystem::path &  subdir)
inlinestaticnoexcept

Creates (if not existing) and returns getCacheDir() / subdir.

Parameters
subdirSubdirectory to append to cache dir
Returns
Created getCacheDir() / subdir.

◆ get()

static std::filesystem::path SlHelpers::HomeDir::get ( )
inlinestaticnoexcept

Obtains home directory.

Returns
$HOME or /etc/passwd home entry.

◆ getCacheDir()

static std::filesystem::path SlHelpers::HomeDir::getCacheDir ( )
inlinestaticnoexcept

Obtains directory for caching.

Returns
$XDG_CACHE_HOME or $HOME/.cache.

The documentation for this class was generated from the following file: