Add CFURLGetTypeID() binding.
This commit is contained in:
@@ -79,13 +79,11 @@ impl<T:Copy AbstractCFTypeRef,S:AbstractCFType<T>> S : CFTypeOps<T> {
|
||||
self.get_ref().as_type_ref()
|
||||
}
|
||||
|
||||
// FIXME: Should move, but there's a linearity bug.
|
||||
static fn as_CFType(obj: S) -> CFType {
|
||||
let tyref : CFTypeRef = base::unwrap(move obj).as_type_ref();
|
||||
CFType { obj: tyref }
|
||||
}
|
||||
|
||||
// FIXME: Should move, but there's a linearity bug.
|
||||
fn clone_as_CFType(&self) -> CFType {
|
||||
let tyref = self.get_ref().as_type_ref();
|
||||
CFRetain(tyref);
|
||||
|
||||
@@ -4,12 +4,14 @@ use base::{
|
||||
CFAllocatorRef,
|
||||
CFRelease,
|
||||
CFType,
|
||||
CFTypeID,
|
||||
CFTypeRef,
|
||||
};
|
||||
use data::{
|
||||
CFDataRef,
|
||||
};
|
||||
use string::{
|
||||
CFString,
|
||||
CFStringRef,
|
||||
CFStringEncoding,
|
||||
};
|
||||
@@ -43,6 +45,13 @@ impl CFURL : AbstractCFType<CFURLRef> {
|
||||
}
|
||||
}
|
||||
|
||||
impl CFURL : ToStr {
|
||||
pure fn to_str() -> ~str unsafe {
|
||||
let cfstr : CFString = base::wrap(CFURLGetString(self.obj));
|
||||
cfstr.to_str()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[link_args="-framework CoreFoundation"]
|
||||
#[nolink]
|
||||
@@ -57,5 +66,6 @@ extern {
|
||||
encoding: CFStringEncoding, escapeWhitespace: bool) -> CFDataRef;
|
||||
fn CFURLGetString(anURL: CFURLRef) -> CFStringRef;
|
||||
fn CFURLGetBaseURL(anURL: CFURLRef) -> CFURLRef;
|
||||
fn CFURLGetTypeID() -> CFTypeID;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user