platformdirs 0.1.0
📂 Python's platformdirs module for C++
Loading...
Searching...
No Matches
platformdirs Namespace Reference

Namespaces

namespace  api
 
namespace  macos
 
namespace  unix
 
namespace  utils
 
namespace  version
 
namespace  windows
 

Typedefs

using platform_dirs
 
using app_dirs = platform_dirs
 
using platform_dirs_abc = platformdirs::api::platform_dirs_abc
 

Functions

std::string user_data_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string site_data_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::string user_config_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string site_config_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::string user_cache_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string site_cache_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::string user_state_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string user_log_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string user_documents_dir ()
 
std::string user_downloads_dir ()
 
std::string user_pictures_dir ()
 
std::string user_videos_dir ()
 
std::string user_music_dir ()
 
std::string user_desktop_dir ()
 
std::string user_runtime_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::string site_runtime_dir (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::filesystem::path user_data_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path site_data_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::filesystem::path user_config_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path site_config_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::filesystem::path user_cache_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path site_cache_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 
std::filesystem::path user_state_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path user_log_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path user_documents_path ()
 
std::filesystem::path user_downloads_path ()
 
std::filesystem::path user_pictures_path ()
 
std::filesystem::path user_videos_path ()
 
std::filesystem::path user_music_path ()
 
std::filesystem::path user_desktop_path ()
 
std::filesystem::path user_runtime_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool roaming=false, bool ensure_exists=false)
 
std::filesystem::path site_runtime_path (const std::optional< std::string > &appname=std::nullopt, const std::variant< std::string, std::nullopt_t, bool > &appauthor=std::nullopt, const std::optional< std::string > &version=std::nullopt, bool multipath=false, bool ensure_exists=false)
 

Variables

constexpr auto & version_ = platformdirs::version::version
 
constexpr auto & version_info = platformdirs::version::version_tuple
 

Typedef Documentation

◆ app_dirs

◆ platform_dirs

Initial value:

Alias the current concrete implementation chosen at compile-time.

◆ platform_dirs_abc

Function Documentation

◆ site_cache_dir()

std::string platformdirs::site_cache_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
cache directory shared by users

◆ site_cache_path()

std::filesystem::path platformdirs::site_cache_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
cache directory shared by users

◆ site_config_dir()

std::string platformdirs::site_config_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
config directory shared by users

◆ site_config_path()

std::filesystem::path platformdirs::site_config_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
config directory shared by users

◆ site_data_dir()

std::string platformdirs::site_data_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
data directory shared by users

◆ site_data_path()

std::filesystem::path platformdirs::site_data_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
data directory shared by users

◆ site_runtime_dir()

std::string platformdirs::site_runtime_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
runtime directory shared by users

◆ site_runtime_path()

std::filesystem::path platformdirs::site_runtime_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool multipath = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
multipathSee platform_dirs_abc::multipath
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
runtime directory shared by users

◆ user_cache_dir()

std::string platformdirs::user_cache_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
cache directory tied to the user

◆ user_cache_path()

std::filesystem::path platformdirs::user_cache_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
cache path tied to the user

◆ user_config_dir()

std::string platformdirs::user_config_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
config directory tied to the user

◆ user_config_path()

std::filesystem::path platformdirs::user_config_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
config path tied to the user

◆ user_data_dir()

std::string platformdirs::user_data_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
data directory tied to the user

◆ user_data_path()

std::filesystem::path platformdirs::user_data_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
data path tied to the user

◆ user_desktop_dir()

std::string platformdirs::user_desktop_dir ( )
Returns
desktop directory tied to the user

◆ user_desktop_path()

std::filesystem::path platformdirs::user_desktop_path ( )
Returns
desktop path tied to the user

◆ user_documents_dir()

std::string platformdirs::user_documents_dir ( )
Returns
documents directory tied to the user

◆ user_documents_path()

std::filesystem::path platformdirs::user_documents_path ( )
Returns
documents path tied to the user

◆ user_downloads_dir()

std::string platformdirs::user_downloads_dir ( )
Returns
downloads directory tied to the user

◆ user_downloads_path()

std::filesystem::path platformdirs::user_downloads_path ( )
Returns
downloads path tied to the user

◆ user_log_dir()

std::string platformdirs::user_log_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
log directory tied to the user

◆ user_log_path()

std::filesystem::path platformdirs::user_log_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
log path tied to the user

◆ user_music_dir()

std::string platformdirs::user_music_dir ( )
Returns
music directory tied to the user

◆ user_music_path()

std::filesystem::path platformdirs::user_music_path ( )
Returns
music path tied to the user

◆ user_pictures_dir()

std::string platformdirs::user_pictures_dir ( )
Returns
pictures directory tied to the user

◆ user_pictures_path()

std::filesystem::path platformdirs::user_pictures_path ( )
Returns
pictures path tied to the user

◆ user_runtime_dir()

std::string platformdirs::user_runtime_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
runtime directory tied to the user

◆ user_runtime_path()

std::filesystem::path platformdirs::user_runtime_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
runtime path tied to the user

◆ user_state_dir()

std::string platformdirs::user_state_dir ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
state directory tied to the user

◆ user_state_path()

std::filesystem::path platformdirs::user_state_path ( const std::optional< std::string > & appname = std::nullopt,
const std::variant< std::string, std::nullopt_t, bool > & appauthor = std::nullopt,
const std::optional< std::string > & version = std::nullopt,
bool roaming = false,
bool ensure_exists = false )
Parameters
appnameSee platform_dirs_abc::appname
appauthorSee platform_dirs_abc::appauthor
versionSee platform_dirs_abc::version
roamingSee platform_dirs_abc::roaming
ensure_existsSee platform_dirs_abc::ensure_exists
Returns
state path tied to the user

◆ user_videos_dir()

std::string platformdirs::user_videos_dir ( )
Returns
videos directory tied to the user

◆ user_videos_path()

std::filesystem::path platformdirs::user_videos_path ( )
Returns
videos path tied to the user

Variable Documentation

◆ version_

auto& platformdirs::version_ = platformdirs::version::version
constexpr

Renamed slightly because there's a module name (namespace) and function name with the same "version" identifier.

◆ version_info

auto& platformdirs::version_info = platformdirs::version::version_tuple
constexpr