diff options
| author | Markus PiƩton <marpie@a12d404.net> | 2021-04-19 18:52:48 +0200 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2021-04-19 13:10:34 -0400 |
| commit | 0d52013908d977a12c35e6a03226a90107321c63 (patch) | |
| tree | a435c66f4568880a5d7508377eb3fd232e7ab328 /rust/src | |
| parent | 11a05327e39555f4cf121689e57adf84145f51ab (diff) | |
Add View Type to BNIsBackedByDatabase
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/filemetadata.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rust/src/filemetadata.rs b/rust/src/filemetadata.rs index 036b85b1..5f0be581 100644 --- a/rust/src/filemetadata.rs +++ b/rust/src/filemetadata.rs @@ -109,8 +109,15 @@ impl FileMetadata { } } - pub fn is_database_backed(&self) -> bool { - unsafe { BNIsBackedByDatabase(self.handle) } + pub fn is_database_backed<S: BnStrCompatible>(&self, view_type: S) -> bool { + let view_type = view_type.as_bytes_with_nul(); + + unsafe { + BNIsBackedByDatabase( + self.handle, + view_type.as_ref().as_ptr() as *const _ + ) + } } pub fn begin_undo_actions(&self) { |
