Struct tugger_apple_bundle::DirectoryBundle [−][src]
pub struct DirectoryBundle { /* fields omitted */ }
An Apple bundle backed by a filesystem/directory.
Instances represent a type-agnostic bundle (macOS application bundle, iOS application bundle, framework bundles, etc).
Implementations
impl DirectoryBundle
[src]
impl DirectoryBundle
[src]pub fn new_from_path(directory: &Path) -> Result<Self>
[src]
pub fn new_from_path(directory: &Path) -> Result<Self>
[src]Open an existing bundle from a filesystem path.
The specified path should be the root directory of the bundle.
This will validate that the directory is a bundle and error if not.
Validation is limited to locating an Info.plist
file, which is
required for all bundle types.
pub fn resolve_path(&self, path: impl AsRef<Path>) -> PathBuf
[src]
pub fn resolve_path(&self, path: impl AsRef<Path>) -> PathBuf
[src]Resolve the absolute path to a file in the bundle.
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
[src]The on-disk name of this bundle.
This is effectively the directory name of the bundle. Contains the .app
,
.framework
, etc suffix.
pub fn shallow(&self) -> bool
[src]
pub fn shallow(&self) -> bool
[src]Whether this is a shallow bundle.
If false, content is likely in a Contents
directory.
pub fn info_plist_path(&self) -> PathBuf
[src]
pub fn info_plist_path(&self) -> PathBuf
[src]Obtain the path to the Info.plist
file.
pub fn info_plist(&self) -> &Dictionary
[src]
pub fn info_plist(&self) -> &Dictionary
[src]Obtain the parsed Info.plist
file.
pub fn info_plist_key_string(&self, key: &str) -> Result<Option<String>>
[src]
pub fn info_plist_key_string(&self, key: &str) -> Result<Option<String>>
[src]Obtain an Info.plist
key as a String
.
Will return None
if the specified key doesn’t exist. Errors if the key value
is not a string.
pub fn package_type(&self) -> BundlePackageType
[src]
pub fn package_type(&self) -> BundlePackageType
[src]Obtain the type of bundle.
pub fn display_name(&self) -> Result<Option<String>>
[src]
pub fn display_name(&self) -> Result<Option<String>>
[src]Obtain the bundle display name.
This retrieves the value of CFBundleDisplayName
from the Info.plist
.
pub fn identifier(&self) -> Result<Option<String>>
[src]
pub fn identifier(&self) -> Result<Option<String>>
[src]Obtain the bundle identifier.
This retrieves CFBundleIdentifier
from the Info.plist
.
pub fn version(&self) -> Result<Option<String>>
[src]
pub fn version(&self) -> Result<Option<String>>
[src]Obtain the bundle version string.
This retrieves CFBundleVersion
from the Info.plist
.
pub fn main_executable(&self) -> Result<Option<String>>
[src]
pub fn main_executable(&self) -> Result<Option<String>>
[src]Obtain the name of the bundle’s main executable file.
This retrieves CFBundleExecutable
from the Info.plist
.
pub fn icon_files(&self) -> Result<Option<Vec<String>>>
[src]
pub fn icon_files(&self) -> Result<Option<Vec<String>>>
[src]Obtain filenames of bundle icon files.
This retrieves CFBundleIconFiles
from the Info.plist
.
pub fn files(
&self,
traverse_nested: bool
) -> Result<Vec<DirectoryBundleFile<'_>>>
[src]
pub fn files(
&self,
traverse_nested: bool
) -> Result<Vec<DirectoryBundleFile<'_>>>
[src]Obtain all files within this bundle.
The iteration order is deterministic.
traverse_nested
defines whether to traverse into nested bundles.
pub fn nested_bundles(&self) -> Result<Vec<(String, Self)>>
[src]
pub fn nested_bundles(&self) -> Result<Vec<(String, Self)>>
[src]Obtain all nested bundles within this one.
This walks the directory tree for directories that can be parsed as bundles.
This will descend infinitely into nested bundles. i.e. we don’t stop traversing directories when we encounter a bundle.