CFBundle

Struct CFBundle 

Source
#[repr(C)]
pub struct CFBundle { /* private fields */ }
Available on crate feature CFBundle only.
Expand description

Implementations§

Source§

impl CFBundle

Source

pub fn main_bundle() -> Option<CFRetained<CFBundle>>

Source

pub fn bundle_with_identifier( bundle_id: Option<&CFString>, ) -> Option<CFRetained<CFBundle>>

Source

pub unsafe fn all_bundles() -> Option<CFRetained<CFArray>>

Available on crate feature CFArray only.
Source§

impl CFBundle

Source

pub fn new( allocator: Option<&CFAllocator>, bundle_url: Option<&CFURL>, ) -> Option<CFRetained<CFBundle>>

Available on crate feature CFURL only.
Source

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.
Source

pub fn bundle_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn value_for_info_dictionary_key( self: &CFBundle, key: Option<&CFString>, ) -> Option<CFRetained<CFType>>

Source

pub fn info_dictionary(self: &CFBundle) -> Option<CFRetained<CFDictionary>>

Available on crate feature CFDictionary only.
Source

pub fn local_info_dictionary( self: &CFBundle, ) -> Option<CFRetained<CFDictionary>>

Available on crate feature CFDictionary only.
Source

pub unsafe fn package_info( self: &CFBundle, package_type: *mut u32, package_creator: *mut u32, )

Source

pub fn identifier(self: &CFBundle) -> Option<CFRetained<CFString>>

Source

pub fn version_number(self: &CFBundle) -> u32

Source

pub fn development_region(self: &CFBundle) -> Option<CFRetained<CFString>>

Source

pub fn support_files_directory_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn resources_directory_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn private_frameworks_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn shared_frameworks_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn shared_support_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn built_in_plug_ins_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn info_dictionary_in_directory( bundle_url: Option<&CFURL>, ) -> Option<CFRetained<CFDictionary>>

Available on crate features CFDictionary and CFURL only.
Source

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.
Source

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.
Source

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.
Source

pub fn localized_string( self: &CFBundle, key: Option<&CFString>, value: Option<&CFString>, table_name: Option<&CFString>, ) -> Option<CFRetained<CFString>>

Source

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>>

Available on crate feature 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 table tableName.
Source

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.
Source

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.
Source

pub fn bundle_localizations(self: &CFBundle) -> Option<CFRetained<CFArray>>

Available on crate feature CFArray only.
Source

pub unsafe fn preferred_localizations_from_array( loc_array: Option<&CFArray>, ) -> Option<CFRetained<CFArray>>

Available on crate feature CFArray only.
Source

pub unsafe fn localizations_for_preferences( loc_array: Option<&CFArray>, pref_array: Option<&CFArray>, ) -> Option<CFRetained<CFArray>>

Available on crate feature CFArray only.
Source

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.
Source

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.
Source

pub fn info_dictionary_for_url( url: Option<&CFURL>, ) -> Option<CFRetained<CFDictionary>>

Available on crate features CFDictionary and CFURL only.
Source

pub fn localizations_for_url(url: Option<&CFURL>) -> Option<CFRetained<CFArray>>

Available on crate features CFArray and CFURL only.
Source

pub fn executable_architectures_for_url( url: Option<&CFURL>, ) -> Option<CFRetained<CFArray>>

Available on crate features CFArray and CFURL only.
Source

pub fn executable_url(self: &CFBundle) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source§

impl CFBundle

Source

pub fn executable_architectures(self: &CFBundle) -> Option<CFRetained<CFArray>>

Available on crate feature CFArray only.
Source

pub unsafe fn preflight_executable( self: &CFBundle, error: *mut *mut CFError, ) -> bool

Available on crate feature CFError only.
Source

pub unsafe fn load_executable_and_return_error( self: &CFBundle, error: *mut *mut CFError, ) -> bool

Available on crate feature CFError only.
Source

pub unsafe fn load_executable(self: &CFBundle) -> bool

Source

pub fn is_executable_loaded(self: &CFBundle) -> bool

Source

pub unsafe fn unload_executable(self: &CFBundle)

Source

pub fn function_pointer_for_name( self: &CFBundle, function_name: Option<&CFString>, ) -> *mut c_void

Source

pub unsafe fn function_pointers_for_names( self: &CFBundle, function_names: Option<&CFArray>, ftbl: *mut *mut c_void, )

Available on crate feature CFArray only.
Source

pub fn data_pointer_for_name( self: &CFBundle, symbol_name: Option<&CFString>, ) -> *mut c_void

Source

pub unsafe fn data_pointers_for_names( self: &CFBundle, symbol_names: Option<&CFArray>, stbl: *mut *mut c_void, )

Available on crate feature CFArray only.
Source

pub fn auxiliary_executable_url( self: &CFBundle, executable_name: Option<&CFString>, ) -> Option<CFRetained<CFURL>>

Available on crate feature CFURL only.
Source

pub fn is_executable_loadable(self: &CFBundle) -> bool

Source

pub fn is_executable_loadable_for_url(url: Option<&CFURL>) -> bool

Available on crate feature CFURL only.
Source

pub fn is_architecture_loadable(arch: cpu_type_t) -> bool

Available on crate feature libc only.
Source

pub fn plug_in(self: &CFBundle) -> Option<CFRetained<CFPlugIn>>

Source

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.
Source

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.
Source

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>§

Source

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.

Source

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 AsRef<AnyObject> for CFBundle

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFBundle> for CFBundle

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFType> for CFBundle

Source§

fn as_ref(&self) -> &CFType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for CFBundle

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CFType> for CFBundle

Source§

fn borrow(&self) -> &CFType

Immutably borrows from an owned value. Read more
Source§

impl ConcreteType for CFBundle

Source§

fn type_id() -> CFTypeID

Get the unique CFTypeID identifier for the type. Read more
Source§

impl Debug for CFBundle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for CFBundle

Source§

type Target = CFType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for CFBundle

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for CFBundle

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl PartialEq for CFBundle

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for CFBundle

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Type for CFBundle

Source§

fn retain(&self) -> CFRetained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

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,

👎Deprecated: use CFRetained::retain
Helper for easier transition from the core-foundation crate. Read more
Source§

fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<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,

👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the core-foundation crate. Read more
Source§

impl Eq for CFBundle

Source§

impl Send for CFBundle

Source§

impl Sync for CFBundle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,