//!
//! # Absolute paths
//!
//! [`sys_absolute`] allows you to make a path absolute without needing the path to exist.
//! This uses the rules of the current platform.
//!
//! ```
//! // Makes a path absolute acording to the rules of the current OS.
//! // It does not resolve symlinks and on Windows it won't return a verbatim
//! // path unless given one.
//! omnipath::sys_absolute("path/to/.//file".as_ref());
//! ```
//!
//! # Windows verbatim paths
//!
//! Verbatim paths are paths that start with `\\?\`. For example `\\?\C:\path\to\file`.
//! These paths can be used in Windows API calls but they are not what the user expects to see.
//! You can turn these paths into more familiar user paths using the [`to_winuser_path`](crate::WinPathExt::to_winuser_path).
//!
//! ```
//! #[cfg(windows)]
//! {
//! use omnipath::windows::WinPathExt;
//! use std::path::Path;
//!
//! let verbatim = Path::new(r"\\?\C:\path\to\file.txt");
//! let user_path = verbatim.to_winuser_path();
//! // user_path is Ok(r"C:\path\to\file.txt")
//! }
//! ```
extern crate alloc;
extern crate std;
// Utility functions and macros.
pub use PosixPathExt;
pub use WinPathExt;
/// Converts a path to absolute according to the rules of the current platform.
///
/// Unlike [`std::fs::canonicalize`] this does not resolve symlinks.
///
/// # Example
///
/// ```
/// use omnipath::sys_absolute;
/// use std::path::Path;
/// use std::env::current_dir;
/// let path = Path::new(r"path/to/.//file");
/// assert_eq!(
/// sys_absolute(path).unwrap(),
/// // WARNING: This may not always be equal depending on the current
/// // directory and OS.
/// current_dir().unwrap().join("path/to/file")
/// );
/// ```