From cb407be11b08c1c427fcf33a49974155e522e14a Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Wed, 8 May 2024 16:19:26 -0400 Subject: Ref count undo objects --- binaryninjaapi.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index a9aba0af..791acf07 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2330,7 +2330,7 @@ namespace BinaryNinja { const BNInstructionTextToken* tokens, size_t count); }; - struct UndoEntry; + class UndoEntry; /*! @@ -2399,8 +2399,8 @@ namespace BinaryNinja { DataBuffer GetFileContents(); DataBuffer GetFileContentsHash(); DataBuffer GetUndoData(); - std::vector GetUndoEntries(); - std::vector GetUndoEntries(const std::function& progress); + std::vector> GetUndoEntries(); + std::vector> GetUndoEntries(const std::function& progress); Ref ReadData(); Ref ReadData(const std::function& progress); bool StoreData(const Ref& data, const std::function& progress); @@ -2744,31 +2744,31 @@ namespace BinaryNinja { void EndBulkOperation(); }; - /*! \ingroup undo */ - struct UndoAction + class UndoAction : public CoreRefCountObject { - BNActionType actionType; - std::string summaryText; - std::vector summaryTokens; + public: + UndoAction(BNUndoAction* action); - UndoAction() {}; - UndoAction(const BNUndoAction& action); + std::string GetSummaryText(); + std::vector GetSummary(); }; /*! \ingroup undo */ - struct UndoEntry + class UndoEntry : public CoreRefCountObject { - Ref user; - std::string id; - std::vector actions; - uint64_t timestamp; + public: + UndoEntry(BNUndoEntry* entry); + + std::string GetId(); + std::vector> GetActions(); + uint64_t GetTimestamp(); }; /*! @@ -2995,10 +2995,10 @@ namespace BinaryNinja { bool Redo(); std::vector> GetUsers(); - std::vector GetUndoEntries(); - std::vector GetRedoEntries(); - std::optional GetLastUndoEntry(); - std::optional GetLastRedoEntry(); + std::vector> GetUndoEntries(); + std::vector> GetRedoEntries(); + Ref GetLastUndoEntry(); + Ref GetLastRedoEntry(); std::optional GetLastUndoEntryTitle(); std::optional GetLastRedoEntryTitle(); void ClearUndoEntries(); -- cgit v1.3.1