#[repr(C)]pub struct CFBundle { /* private fields */ }
Available on crate feature
CFBundle
only.Expand description
Implementations§
Source§impl CFBundle
impl CFBundle
pub fn main_bundle() -> Option<CFRetained<CFBundle>>
pub fn bundle_with_identifier( bundle_id: Option<&CFString>, ) -> Option<CFRetained<CFBundle>>
pub unsafe fn all_bundles() -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.Source§impl CFBundle
impl CFBundle
pub fn new( allocator: Option<&CFAllocator>, bundle_url: Option<&CFURL>, ) -> Option<CFRetained<CFBundle>>
Available on crate feature
CFURL
only.pub fn new_bundles_from_directory( allocator: Option<&CFAllocator>, directory_url: Option<&CFURL>, bundle_type: Option<&CFString>, ) -> Option<CFRetained<CFArray>>
Available on crate features
CFArray
and CFURL
only.pub fn bundle_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn value_for_info_dictionary_key( self: &CFBundle, key: Option<&CFString>, ) -> Option<CFRetained<CFType>>
pub fn info_dictionary(self: &CFBundle) -> Option<CFRetained<CFDictionary>>
Available on crate feature
CFDictionary
only.pub fn local_info_dictionary( self: &CFBundle, ) -> Option<CFRetained<CFDictionary>>
Available on crate feature
CFDictionary
only.pub unsafe fn package_info( self: &CFBundle, package_type: *mut u32, package_creator: *mut u32, )
pub fn identifier(self: &CFBundle) -> Option<CFRetained<CFString>>
pub fn version_number(self: &CFBundle) -> u32
pub fn development_region(self: &CFBundle) -> Option<CFRetained<CFString>>
pub fn support_files_directory_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn resources_directory_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn private_frameworks_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.Available on crate feature
CFURL
only.Available on crate feature
CFURL
only.pub fn built_in_plug_ins_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn info_dictionary_in_directory( bundle_url: Option<&CFURL>, ) -> Option<CFRetained<CFDictionary>>
Available on crate features
CFDictionary
and CFURL
only.pub unsafe fn package_info_in_directory( url: Option<&CFURL>, package_type: *mut u32, package_creator: *mut u32, ) -> bool
Available on crate feature
CFURL
only.pub fn resource_url( self: &CFBundle, resource_name: Option<&CFString>, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn resource_urls_of_type( self: &CFBundle, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, ) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub fn localized_string( self: &CFBundle, key: Option<&CFString>, value: Option<&CFString>, table_name: Option<&CFString>, ) -> Option<CFRetained<CFString>>
Sourcepub unsafe fn localized_string_for_localizations(
self: &CFBundle,
key: Option<&CFString>,
value: Option<&CFString>,
table_name: Option<&CFString>,
localizations: Option<&CFArray>,
) -> Option<CFRetained<CFString>>
Available on crate feature CFArray
only.
pub unsafe fn localized_string_for_localizations( self: &CFBundle, key: Option<&CFString>, value: Option<&CFString>, table_name: Option<&CFString>, localizations: Option<&CFArray>, ) -> Option<CFRetained<CFString>>
CFArray
only.Returns a localized string given a list of possible localizations. The one most suitable to use with the given bundle
is returned.
- Parameters:
- bundle: The bundle to examine.
- key: The key for the localized string to retrieve.
- value: A default value to return if no value exists for
key
. - tableName: The name of the strings file to search.
- localizations: An array of BCP 47 language codes corresponding to available localizations. Bundle compares the array against its available localizations, and uses the best result to retrieve the localized string. If empty, we treat it as no localization is available, and may return a fallback.
- Returns: A localized version of the string designated by
key
in tabletableName
.
pub fn resource_url_in_directory( bundle_url: Option<&CFURL>, resource_name: Option<&CFString>, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn resource_urls_of_type_in_directory( bundle_url: Option<&CFURL>, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, ) -> Option<CFRetained<CFArray>>
Available on crate features
CFArray
and CFURL
only.pub fn bundle_localizations(self: &CFBundle) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub unsafe fn preferred_localizations_from_array( loc_array: Option<&CFArray>, ) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub unsafe fn localizations_for_preferences( loc_array: Option<&CFArray>, pref_array: Option<&CFArray>, ) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub fn resource_url_for_localization( self: &CFBundle, resource_name: Option<&CFString>, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, localization_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn resource_urls_of_type_for_localization( self: &CFBundle, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, localization_name: Option<&CFString>, ) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub fn info_dictionary_for_url( url: Option<&CFURL>, ) -> Option<CFRetained<CFDictionary>>
Available on crate features
CFDictionary
and CFURL
only.pub fn localizations_for_url(url: Option<&CFURL>) -> Option<CFRetained<CFArray>>
Available on crate features
CFArray
and CFURL
only.pub fn executable_architectures_for_url( url: Option<&CFURL>, ) -> Option<CFRetained<CFArray>>
Available on crate features
CFArray
and CFURL
only.pub fn executable_url(self: &CFBundle) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.Source§impl CFBundle
impl CFBundle
pub fn executable_architectures(self: &CFBundle) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray
only.pub unsafe fn preflight_executable( self: &CFBundle, error: *mut *mut CFError, ) -> bool
Available on crate feature
CFError
only.pub unsafe fn load_executable_and_return_error( self: &CFBundle, error: *mut *mut CFError, ) -> bool
Available on crate feature
CFError
only.pub unsafe fn load_executable(self: &CFBundle) -> bool
pub fn is_executable_loaded(self: &CFBundle) -> bool
pub unsafe fn unload_executable(self: &CFBundle)
pub fn function_pointer_for_name( self: &CFBundle, function_name: Option<&CFString>, ) -> *mut c_void
pub unsafe fn function_pointers_for_names( self: &CFBundle, function_names: Option<&CFArray>, ftbl: *mut *mut c_void, )
Available on crate feature
CFArray
only.pub fn data_pointer_for_name( self: &CFBundle, symbol_name: Option<&CFString>, ) -> *mut c_void
pub unsafe fn data_pointers_for_names( self: &CFBundle, symbol_names: Option<&CFArray>, stbl: *mut *mut c_void, )
Available on crate feature
CFArray
only.pub fn auxiliary_executable_url( self: &CFBundle, executable_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL
only.pub fn is_executable_loadable(self: &CFBundle) -> bool
pub fn is_executable_loadable_for_url(url: Option<&CFURL>) -> bool
Available on crate feature
CFURL
only.pub fn is_architecture_loadable(arch: cpu_type_t) -> bool
Available on crate feature
libc
only.pub fn plug_in(self: &CFBundle) -> Option<CFRetained<CFPlugIn>>
pub unsafe fn open_bundle_resource_map(self: &CFBundle) -> CFBundleRefNum
👎Deprecated: The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.
pub unsafe fn open_bundle_resource_files( self: &CFBundle, ref_num: *mut CFBundleRefNum, localized_ref_num: *mut CFBundleRefNum, ) -> i32
👎Deprecated: The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.
pub unsafe fn close_bundle_resource_map( self: &CFBundle, ref_num: CFBundleRefNum, )
👎Deprecated: The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.
Methods from Deref<Target = CFType>§
Sourcepub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
pub fn downcast_ref<T: ConcreteType>(&self) -> Option<&T>
Attempt to downcast the type to that of type T
.
This is the reference-variant. Use CFRetained::downcast
if you
want to convert a retained type. See also ConcreteType
for more
details on which types support being converted to.
Sourcepub fn retain_count(&self) -> usize
pub fn retain_count(&self) -> usize
Get the reference count of the object.
This function may be useful for debugging. You normally do not use this function otherwise.
Beware that some things (like CFNumber
s, small CFString
s etc.) may
not have a normal retain count for optimization purposes, and can
return usize::MAX
in that case.
Trait Implementations§
Source§impl ConcreteType for CFBundle
impl ConcreteType for CFBundle
Source§impl RefEncode for CFBundle
impl RefEncode for CFBundle
Source§const ENCODING_REF: Encoding
const ENCODING_REF: Encoding
The Objective-C type-encoding for a reference of this type. Read more
Source§impl Type for CFBundle
impl Type for CFBundle
Source§fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
fn retain(&self) -> CFRetained<Self> ⓘwhere
Self: Sized,
Increment the reference count of the receiver. Read more
Source§fn as_concrete_TypeRef(&self) -> &Self
fn as_concrete_TypeRef(&self) -> &Self
👎Deprecated: this is redundant
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::retain
Helper for easier transition from the
core-foundation
crate. Read moreSource§fn as_CFTypeRef(&self) -> &CFType
fn as_CFTypeRef(&self) -> &CFType
👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the
core-foundation
crate.Source§unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self> ⓘwhere
Self: Sized,
👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the
core-foundation
crate. Read moreimpl Eq for CFBundle
impl Send for CFBundle
impl Sync for CFBundle
Auto Trait Implementations§
impl !Freeze for CFBundle
impl !RefUnwindSafe for CFBundle
impl !Unpin for CFBundle
impl !UnwindSafe for CFBundle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more