Expand description
Advanced cross-platform path handling library
Provides perfect compatibility handling for Windows and Linux paths, supporting:
- Windows ↔ Linux bidirectional path conversion
- Automatic encoding detection and conversion
- Path security verification
- Cross-platform file operations
§Examples
use cross_path::{CrossPath, PathStyle};
// Convert Windows path to Unix path
let path = CrossPath::new(r"C:\Users\name\file.txt")?;
assert_eq!(path.to_unix()?, "/mnt/c/Users/name/file.txt");
// Convert Unix path to Windows path
let path = CrossPath::new("/home/name/file.txt")?;
assert_eq!(path.to_windows()?, r"C:\home\name\file.txt");Re-exports§
pub use converter::PathConverter;pub use error::PathError;pub use formatter::PathFormatter;pub use parser::PathParser;
Modules§
- converter
- Path converter module
- error
- Error handling module
- formatter
- Path formatter module
- parser
- Path parser module
- platform
- Platform-specific operations module Platform-specific path handling operations
- security
- Security verification module
- unicode
- Unicode handling module
Structs§
- Cross
Path - Main cross-platform path structure
- Path
Config - Path conversion configuration
Enums§
- Path
Style - Path style enumeration
Traits§
- Path
Convert - Path conversion trait
Type Aliases§
- Path
Result - Cross-platform path result type