This document shows a few common operations one would like to perform with this library.
Basic usage using the function API
fmt::println(
"{}",
dire::cache_dir().value_or(
"Couldn't determine cache dir."));
auto download_dir() -> Optional< Path >
auto home_dir() -> Optional< Path >
auto audio_dir() -> Optional< Path >
auto cache_dir() -> Optional< Path >
auto font_dir() -> Optional< Path >
Basic usage using the bundle API
fmt::println("{}", bundle->home_dir);
fmt::println("{}", bundle->cache_dir);
}
fmt::println("{}", bundle->audio_dir);
fmt::println("{}", bundle->download_dir);
fmt::println("{}", *bundle->font_dir);
}
static auto make() -> Optional< BaseDirsBundle >
static auto make() -> Optional< UserDirsBundle >
Using the project API
static constexpr auto project_domain = "Me";
static constexpr auto project_org = "Dich0tomy";
static constexpr auto project_app_name = "Dire";
auto const project_name =
dire::name(project_domain, project_org, project_app_name);
fmt::println("{}", bundle->cache_dir);
fmt::println("{}", bundle->config_dir);
}
auto config_dir() -> Optional< Path >
auto name(std::string domain, std::string org, std::string app_name) -> PlatformProjectName
static auto make(PlatformProjectName project_name) -> Optional< ProjectDirsBundle >
Using your own name instead of the cross-platform generated one
fmt::println("{}", bundle->cache_dir);
fmt::println("{}", bundle->config_dir);
}