pub struct FileMetadata { /* private fields */ }
Implementations§
source§impl FileMetadata
impl FileMetadata
pub fn new() -> Ref<Self>
pub fn with_filename(name: &str) -> Ref<Self>
pub fn close(&self)
pub fn session_id(&self) -> usize
pub fn filename(&self) -> String
pub fn set_filename(&self, name: &str)
pub fn modified(&self) -> bool
pub fn mark_modified(&self)
pub fn mark_saved(&self)
pub fn is_analysis_changed(&self) -> bool
pub fn is_database_backed(&self) -> bool
pub fn is_database_backed_for_view_type(&self, view_type: &str) -> bool
sourcepub fn run_undoable_transaction<F: FnOnce() -> Result<T, E>, T, E>(
&self,
func: F,
) -> Result<T, E>
pub fn run_undoable_transaction<F: FnOnce() -> Result<T, E>, T, E>( &self, func: F, ) -> Result<T, E>
Runs a failable function where the failure state will revert any undo actions that occurred during the time of the function’s execution.
NOTE: This will commit or undo any actions that occurred on any thread as this state is not thread local.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
sourcepub fn begin_undo_actions(&self, anonymous_allowed: bool) -> String
pub fn begin_undo_actions(&self, anonymous_allowed: bool) -> String
Creates a new undo entry, any undo actions after this will be added to this entry.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
sourcepub fn commit_undo_actions(&self, id: &str)
pub fn commit_undo_actions(&self, id: &str)
Commits the undo entry with the id to the undo buffer.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
sourcepub fn revert_undo_actions(&self, id: &str)
pub fn revert_undo_actions(&self, id: &str)
Reverts the undo actions committed in the undo entry.
NOTE: This is NOT thread safe, if you are holding any locks that might be held by both the main thread and the thread executing this function, you can deadlock. You should also never call this function on multiple threads at a time. See the following issues:
pub fn undo(&self)
pub fn redo(&self)
pub fn current_view(&self) -> String
pub fn current_offset(&self) -> u64
Navigate to an offset for a specific view.
§Example
use binaryninja::file_metadata::FileMetadata;
file.navigate_to("Linear:Raw", 0x0).expect("Linear:Raw should always be present");
sourcepub fn view_of_type(&self, view: &str) -> Option<Ref<BinaryView>>
pub fn view_of_type(&self, view: &str) -> Option<Ref<BinaryView>>
Get the BinaryView
for the view type.
§Example
use binaryninja::file_metadata::FileMetadata;
file.view_of_type("Raw").expect("Raw type should always be present");
pub fn view_types(&self) -> Array<BnString>
sourcepub fn project_file(&self) -> Option<Ref<ProjectFile>>
pub fn project_file(&self) -> Option<Ref<ProjectFile>>
Get the ProjectFile
for the FileMetadata
.