irccd  3.0.3
Public Member Functions | List of all members
irccd::xdg Class Reference

XDG directory specifications. More...

#include <xdg.hpp>

Public Member Functions

 xdg ()
 
auto get_config_home () const noexcept -> const std::string &
 
auto get_data_home () const noexcept -> const std::string &
 
auto get_cache_home () const noexcept -> const std::string &
 
auto get_runtime_dir () const noexcept -> const std::string &
 
auto get_config_dirs () const noexcept -> const std::vector< std::string > &
 
auto get_data_dirs () const noexcept -> const std::vector< std::string > &
 

Detailed Description

XDG directory specifications.

Read and get XDG directories.

This file should compiles on Windows to facilitate portability but its functions must not be used.

Constructor & Destructor Documentation

◆ xdg()

irccd::xdg::xdg ( )
inline

Open an xdg instance and load directories.

Exceptions
std::runtime_erroron failures

Member Function Documentation

◆ get_cache_home()

auto irccd::xdg::get_cache_home ( ) const -> const std::string&
inlinenoexcept

Get the cache directory. ${XDG_CACHE_HOME} or ${HOME}/.cache

Returns
the cache directory

◆ get_config_dirs()

auto irccd::xdg::get_config_dirs ( ) const -> const std::vector<std::string>&
inlinenoexcept

Get the standard config directories. ${XDG_CONFIG_DIRS} or { "/etc/xdg" }

Returns
the list of config directories

◆ get_config_home()

auto irccd::xdg::get_config_home ( ) const -> const std::string&
inlinenoexcept

Get the config directory. ${XDG_CONFIG_HOME} or ${HOME}/.config

Returns
the config directory

◆ get_data_dirs()

auto irccd::xdg::get_data_dirs ( ) const -> const std::vector<std::string>&
inlinenoexcept

Get the data directories. ${XDG_DATA_DIRS} or { "/usr/local/share", "/usr/share" }

Returns
the list of data directories

◆ get_data_home()

auto irccd::xdg::get_data_home ( ) const -> const std::string&
inlinenoexcept

Get the data directory. ${XDG_DATA_HOME} or ${HOME}/.local/share

Returns
the data directory

◆ get_runtime_dir()

auto irccd::xdg::get_runtime_dir ( ) const -> const std::string&
inlinenoexcept

Get the runtime directory.

There is no replacement for XDG_RUNTIME_DIR, if it is not set, an empty value is returned and the user is responsible of using something else.

Returns
the runtime directory

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