[−][src]Trait symbolic_common::DSymPathExt
Extensions to Path for handling dSYM directories.
Required methods
fn is_dsym_dir(&self) -> bool
Returns true if this path points to an existing directory with a .dSYM extension.
Examples
use std::path::Path; use symbolic_common::DSymPathExt; assert!(Path::new("Foo.dSYM").is_dsym_dir()); assert!(!Path::new("Foo").is_dsym_dir());
fn resolve_dsym(&self) -> Option<PathBuf>
Resolves the path of the debug file in a dSYM directory structure.
Returns Some(path) if this path is a dSYM directory according to is_dsym_dir, and a
file of the same name is located at Contents/Resources/DWARF/.
Examples
use std::path::Path; use symbolic_common::DSymPathExt; let path = Path::new("Foo.dSYM"); let dsym_path = path.resolve_dsym().unwrap(); assert_eq!(dsym_path, Path::new("Foo.dSYM/Contents/Resources/DWARF/Foo"));
fn dsym_parent(&self) -> Option<&Path>
Resolves the dSYM parent directory if this file is a dSYM.
If this path points to the MachO file in a dSYM directory structure, this function returns
the path to the dSYM directory. Returns None if the parent does not exist or the file name
does not match.
Examples
use std::path::Path; use symbolic_common::DSymPathExt; let path = Path::new("Foo.dSYM/Contents/Resources/DWARF/Foo"); let parent = path.dsym_parent().unwrap(); assert_eq!(parent, Path::new("Foo.dSYM")); let path = Path::new("Foo.dSYM/Contents/Resources/DWARF/Bar"); assert_eq!(path.dsym_parent(), None);