|
68 | 68 | }) |
69 | 69 | } |
70 | 70 |
|
| 71 | + extern "C" fn cb_force_loadable<T>(ctxt: *mut c_void) -> bool |
| 72 | + where |
| 73 | + T: CustomBinaryViewType, |
| 74 | + { |
| 75 | + ffi_wrap!("BinaryViewTypeBase::is_force_loadable", unsafe { |
| 76 | + let view_type = &*(ctxt as *mut T); |
| 77 | + view_type.is_force_loadable() |
| 78 | + }) |
| 79 | + } |
| 80 | + |
71 | 81 | extern "C" fn cb_create<T>(ctxt: *mut c_void, data: *mut BNBinaryView) -> *mut BNBinaryView |
72 | 82 | where |
73 | 83 | T: CustomBinaryViewType, |
@@ -131,6 +141,7 @@ where |
131 | 141 | parse: Some(cb_parse::<T>), |
132 | 142 | isValidForData: Some(cb_valid::<T>), |
133 | 143 | isDeprecated: Some(cb_deprecated::<T>), |
| 144 | + isForceLoadable: Some(cb_force_loadable::<T>), |
134 | 145 | getLoadSettingsForData: Some(cb_load_settings::<T>), |
135 | 146 | }; |
136 | 147 |
|
@@ -158,6 +169,8 @@ pub trait BinaryViewTypeBase: AsRef<BinaryViewType> { |
158 | 169 |
|
159 | 170 | fn is_deprecated(&self) -> bool; |
160 | 171 |
|
| 172 | + fn is_force_loadable(&self) -> bool; |
| 173 | + |
161 | 174 | fn default_load_settings_for_data(&self, data: &BinaryView) -> Result<Ref<Settings>> { |
162 | 175 | let settings_handle = |
163 | 176 | unsafe { BNGetBinaryViewDefaultLoadSettingsForData(self.as_ref().0, data.handle) }; |
@@ -265,6 +278,10 @@ impl BinaryViewTypeBase for BinaryViewType { |
265 | 278 | unsafe { BNIsBinaryViewTypeDeprecated(self.0) } |
266 | 279 | } |
267 | 280 |
|
| 281 | + fn is_force_loadable(&self) -> bool { |
| 282 | + unsafe { BNIsBinaryViewTypeForceLoadable(self.0) } |
| 283 | + } |
| 284 | + |
268 | 285 | fn default_load_settings_for_data(&self, data: &BinaryView) -> Result<Ref<Settings>> { |
269 | 286 | let settings_handle = |
270 | 287 | unsafe { BNGetBinaryViewDefaultLoadSettingsForData(self.0, data.handle) }; |
|
0 commit comments