summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2023-05-23 20:11:07 -0400
committerGlenn Smith <glenn@vector35.com>2023-06-08 17:18:21 -0400
commit0882343191078862361937493035030128230878 (patch)
treef5ef5168066c53b85fd9574225df7411817bb577 /binaryninjaapi.h
parent30784c736f7ed7cc796573d81021bd3ef10fded3 (diff)
Undo entry states and reverting
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h33
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