|
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,
|
@@ -153,6 +163,7 @@ where
|
153 | 163 | parse: Some(cb_parse::<T>),
|
154 | 164 | isValidForData: Some(cb_valid::<T>),
|
155 | 165 | isDeprecated: Some(cb_deprecated::<T>),
|
| 166 | + isForceLoadable: Some(cb_force_loadable::<T>), |
156 | 167 | getLoadSettingsForData: Some(cb_load_settings::<T>),
|
157 | 168 | };
|
158 | 169 |
|
@@ -182,6 +193,10 @@ pub trait BinaryViewTypeBase: AsRef<BinaryViewType> {
|
182 | 193 | false
|
183 | 194 | }
|
184 | 195 |
|
| 196 | + fn is_force_loadable(&self) -> bool { |
| 197 | + false |
| 198 | + } |
| 199 | + |
185 | 200 | fn default_load_settings_for_data(&self, data: &BinaryView) -> Option<Ref<Settings>> {
|
186 | 201 | let settings_handle =
|
187 | 202 | unsafe { BNGetBinaryViewDefaultLoadSettingsForData(self.as_ref().0, data.handle) };
|
@@ -296,6 +311,10 @@ impl BinaryViewTypeBase for BinaryViewType {
|
296 | 311 | unsafe { BNIsBinaryViewTypeDeprecated(self.0) }
|
297 | 312 | }
|
298 | 313 |
|
| 314 | + fn is_force_loadable(&self) -> bool { |
| 315 | + unsafe { BNIsBinaryViewTypeForceLoadable(self.0) } |
| 316 | + } |
| 317 | + |
299 | 318 | fn load_settings_for_data(&self, data: &BinaryView) -> Option<Ref<Settings>> {
|
300 | 319 | let settings_handle = unsafe { BNGetBinaryViewLoadSettingsForData(self.0, data.handle) };
|
301 | 320 |
|
|
0 commit comments