diff options
| author | Glenn Smith <glenn@vector35.com> | 2023-05-23 20:11:07 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2023-06-08 17:18:21 -0400 |
| commit | 0882343191078862361937493035030128230878 (patch) | |
| tree | f5ef5168066c53b85fd9574225df7411817bb577 /binaryninjaapi.h | |
| parent | 30784c736f7ed7cc796573d81021bd3ef10fded3 (diff) | |
Undo entry states and reverting
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 3034ac52..d81c6320 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2149,12 +2149,22 @@ namespace BinaryNinja { const std::function<bool(size_t progress, size_t total)>& progressCallback); /*! Start recording actions taken so they can be undone at some point + + \return Id of UndoEntry created, for passing to either CommitUndoActions or RevertUndoActions */ - void BeginUndoActions(); + [[nodiscard]] std::string BeginUndoActions(); + + /*! Commit the actions taken since a call to BeginUndoActions. + + \param id Id of UndoEntry created by BeginUndoActions + */ + void CommitUndoActions(const std::string& id); + + /*! Revert the actions taken since a call to BeginUndoActions. - /*! Commit the actions taken since the last commit to the undo database. + \param id Id of UndoEntry created by BeginUndoActions */ - void CommitUndoActions(); + void RevertUndoActions(const std::string& id); /*! \return Whether it is possible to perform an Undo */ @@ -3549,13 +3559,22 @@ namespace BinaryNinja { Ref<SaveSettings> settings = new SaveSettings()); /*! Start recording actions taken so they can be undone at some point + + \return Id of UndoEntry created, for passing to either CommitUndoActions or RevertUndoActions */ - void BeginUndoActions(); - void AddUndoAction(UndoAction* action); + [[nodiscard]] std::string BeginUndoActions(); + + /*! Commit the actions taken since a call to BeginUndoActions. + + \param id Id of UndoEntry created by BeginUndoActions + */ + void CommitUndoActions(const std::string& id); + + /*! Revert the actions taken since a call to BeginUndoActions. - /*! Commit the actions taken since the last commit to the undo database. + \param id Id of UndoEntry created by BeginUndoActions */ - void CommitUndoActions(); + void RevertUndoActions(const std::string& id); /*! \return Whether it is possible to perform an Undo |
