Skip to main content

bevy_platform/dirs/
mod.rs

1//! APIs that return the location of standard user directories.
2
3// Modeled after https://github.com/dirs-dev/dirs-sys-rs/
4
5#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
6use std::path::PathBuf;
7
8#[cfg(target_os = "windows")]
9mod windows;
10#[cfg(target_os = "windows")]
11pub use windows::preferences_dir;
12
13#[cfg(target_os = "macos")]
14mod macos;
15#[cfg(target_os = "macos")]
16pub use macos::preferences_dir;
17
18#[cfg(target_os = "linux")]
19mod linux;
20#[cfg(target_os = "linux")]
21pub use linux::preferences_dir;
22
23/// Returns the path to the directory used for application settings. This version
24/// always returns `None`.
25#[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "linux")))]
26pub fn preferences_dir() -> Option<PathBuf> {
27    None
28}