diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-09-14 16:31:04 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-09-29 21:02:19 -0400 |
| commit | bac2b01e488e6a58dd3d16d6148dc5bea16be162 (patch) | |
| tree | 4f52bbc52b1b5aa37c76fe540330f11a8f43e855 /filemetadata.cpp | |
| parent | 0d42e48c833106c7865ca5822986b787ba44f858 (diff) | |
Optimized api for getting the title of the last undo entry
Diffstat (limited to 'filemetadata.cpp')
| -rw-r--r-- | filemetadata.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/filemetadata.cpp b/filemetadata.cpp index 5d01c3b0..9b1dfee3 100644 --- a/filemetadata.cpp +++ b/filemetadata.cpp @@ -453,6 +453,32 @@ std::optional<UndoEntry> FileMetadata::GetLastRedoEntry() } +std::optional<std::string> FileMetadata::GetLastUndoEntryTitle() +{ + char* title = BNGetLastUndoEntryTitle(m_object); + if (!title) + { + return std::nullopt; + } + std::string titleStr = title; + BNFreeString(title); + return titleStr; +} + + +std::optional<std::string> FileMetadata::GetLastRedoEntryTitle() +{ + char* title = BNGetLastRedoEntryTitle(m_object); + if (!title) + { + return std::nullopt; + } + std::string titleStr = title; + BNFreeString(title); + return titleStr; +} + + void FileMetadata::ClearUndoEntries() { BNClearUndoEntries(m_object); |
