use lief_ffi as ffi;
use crate::common::FromFFI;
use std::marker::PhantomData;
pub struct Method<'a> {
ptr: cxx::UniquePtr<ffi::ObjC_Method>,
_owner: PhantomData<&'a ()>,
}
impl FromFFI<ffi::ObjC_Method> for Method<'_> {
fn from_ffi(info: cxx::UniquePtr<ffi::ObjC_Method>) -> Self {
Self {
ptr: info,
_owner: PhantomData,
}
}
}
impl Method<'_> {
pub fn name(&self) -> String {
self.ptr.name().to_string()
}
pub fn mangled_type(&self) -> String {
self.ptr.mangled_type().to_string()
}
pub fn address(&self) -> u64 {
self.ptr.address()
}
pub fn is_instance(&self) -> bool {
self.ptr.is_instance()
}
}