cross_xdg/
lib.rs

1//! Cross plattform XDG base directory specification.
2//!
3//! This library provides a way to access the XDG base directory specification on all platforms.
4//! The XDG base directory specification is a standard for storing user-specific configuration,
5//! data, cache, and runtime files. It is used by many Linux desktop environments and applications.
6//! The specification is defined in the [XDG Base Directory
7//! Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
8//!
9//! In contrast to other XDG base directory crates or standard directory crates, `cross-xdg`
10//! provides XDG directories on Windows and macOS just like on Linux.
11//!
12//! Example for Linux:
13//! ```rust
14//! use cross_xdg::BaseDirs;
15//! let base_dirs = BaseDirs::new().unwrap();
16//!
17//! // On Linux: resolves to /home/<user>/.config
18//! // On Windows: resolves to C:\Users\<user>\.config
19//! // On macOS: resolves to /Users/<user>/.config
20//! let config_home = base_dirs.config_home();
21//! ```
22
23mod base_dirs;
24mod base_dirs_ex;
25mod test_helper;
26
27pub use base_dirs::BaseDirs;
28pub use base_dirs_ex::BaseDirsEx;