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) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL only.pub fn value_for_info_dictionary_key( &self, key: Option<&CFString>, ) -> Option<CFRetained<CFType>>
pub fn info_dictionary(&self) -> Option<CFRetained<CFDictionary>>
Available on crate feature
CFDictionary only.pub fn local_info_dictionary(&self) -> Option<CFRetained<CFDictionary>>
Available on crate feature
CFDictionary only.Sourcepub unsafe fn package_info(
&self,
package_type: *mut u32,
package_creator: *mut u32,
)
pub unsafe fn package_info( &self, package_type: *mut u32, package_creator: *mut u32, )
§Safety
package_typemust be a valid pointer.package_creatormust be a valid pointer.
pub fn identifier(&self) -> Option<CFRetained<CFString>>
pub fn version_number(&self) -> u32
pub fn development_region(&self) -> Option<CFRetained<CFString>>
pub fn support_files_directory_url(&self) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL only.pub fn resources_directory_url(&self) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL only.pub fn private_frameworks_url(&self) -> 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) -> 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.Sourcepub 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 unsafe fn package_info_in_directory( url: Option<&CFURL>, package_type: *mut u32, package_creator: *mut u32, ) -> bool
CFURL only.§Safety
urlmight not allowNone.package_typemust be a valid pointer.package_creatormust be a valid pointer.
pub fn resource_url( &self, 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, resource_type: Option<&CFString>, sub_dir_name: Option<&CFString>, ) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray only.pub fn localized_string( &self, key: Option<&CFString>, value: Option<&CFString>, table_name: Option<&CFString>, ) -> Option<CFRetained<CFString>>
Sourcepub unsafe fn localized_string_for_localizations(
&self,
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, 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
keyin tabletableName.
§Safety
keymight not allowNone.valuemight not allowNone.table_namemight not allowNone.localizationsgeneric must be of the correct type.localizationsmight not allowNone.
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) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray only.Sourcepub unsafe fn preferred_localizations_from_array(
loc_array: Option<&CFArray>,
) -> Option<CFRetained<CFArray>>
Available on crate feature CFArray only.
pub unsafe fn preferred_localizations_from_array( loc_array: Option<&CFArray>, ) -> Option<CFRetained<CFArray>>
CFArray only.§Safety
loc_arraygeneric must be of the correct type.loc_arraymight not allowNone.
Sourcepub unsafe fn localizations_for_preferences(
loc_array: Option<&CFArray>,
pref_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>>
CFArray only.§Safety
loc_arraygeneric must be of the correct type.loc_arraymight not allowNone.pref_arraygeneric must be of the correct type.pref_arraymight not allowNone.
pub fn resource_url_for_localization( &self, 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, 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) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL only.Source§impl CFBundle
impl CFBundle
pub fn executable_architectures(&self) -> Option<CFRetained<CFArray>>
Available on crate feature
CFArray only.Sourcepub unsafe fn preflight_executable(&self, error: *mut *mut CFError) -> bool
Available on crate feature CFError only.
pub unsafe fn preflight_executable(&self, error: *mut *mut CFError) -> bool
CFError only.§Safety
error must be a valid pointer.
Sourcepub unsafe fn load_executable_and_return_error(
&self,
error: *mut *mut CFError,
) -> bool
Available on crate feature CFError only.
pub unsafe fn load_executable_and_return_error( &self, error: *mut *mut CFError, ) -> bool
CFError only.§Safety
error must be a valid pointer.
pub unsafe fn load_executable(&self) -> bool
pub fn is_executable_loaded(&self) -> bool
pub unsafe fn unload_executable(&self)
pub fn function_pointer_for_name( &self, function_name: Option<&CFString>, ) -> *mut c_void
Sourcepub unsafe fn function_pointers_for_names(
&self,
function_names: Option<&CFArray>,
ftbl: *mut *mut c_void,
)
Available on crate feature CFArray only.
pub unsafe fn function_pointers_for_names( &self, function_names: Option<&CFArray>, ftbl: *mut *mut c_void, )
CFArray only.§Safety
function_namesgeneric must be of the correct type.function_namesmight not allowNone.ftblmust be a valid pointer.
pub fn data_pointer_for_name( &self, symbol_name: Option<&CFString>, ) -> *mut c_void
Sourcepub unsafe fn data_pointers_for_names(
&self,
symbol_names: Option<&CFArray>,
stbl: *mut *mut c_void,
)
Available on crate feature CFArray only.
pub unsafe fn data_pointers_for_names( &self, symbol_names: Option<&CFArray>, stbl: *mut *mut c_void, )
CFArray only.§Safety
symbol_namesgeneric must be of the correct type.symbol_namesmight not allowNone.stblmust be a valid pointer.
pub fn auxiliary_executable_url( &self, executable_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>
Available on crate feature
CFURL only.pub fn is_executable_loadable(&self) -> 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) -> Option<CFRetained<CFPlugIn>>
pub fn open_bundle_resource_map(&self) -> CFBundleRefNum
👎Deprecated: The Carbon Resource Manager is deprecated. This should only be used to access Resource Manager-style resources in old bundles.
Sourcepub unsafe fn open_bundle_resource_files(
&self,
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 open_bundle_resource_files( &self, ref_num: *mut CFBundleRefNum, localized_ref_num: *mut CFBundleRefNum, ) -> i32
§Safety
ref_nummust be a valid pointer.localized_ref_nummust be a valid pointer.
pub fn close_bundle_resource_map(&self, 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 CFNumbers, small CFStrings 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