From 0882343191078862361937493035030128230878 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 23 May 2023 20:11:07 -0400 Subject: Undo entry states and reverting --- binaryninjaapi.h | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'binaryninjaapi.h') 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& 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 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 -- cgit v1.3.1