From 573b03c844090b53fb49b2156deae7540c8c3059 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Sun, 12 Oct 2025 12:08:13 -0400 Subject: Improve error handling in project apis --- binaryninjaapi.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index a1429ec1..72e803b5 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -3640,10 +3640,10 @@ namespace BinaryNinja { std::string GetId() const; std::string GetName() const; std::string GetDescription() const; - void SetName(const std::string& name); - void SetDescription(const std::string& description); + bool SetName(const std::string& name); + bool SetDescription(const std::string& description); Ref GetParent() const; - void SetParent(Ref parent); + bool SetParent(Ref parent); bool Export(const std::string& destination, const ProgressFunction& progressCallback = {}) const; }; @@ -3662,11 +3662,11 @@ namespace BinaryNinja { bool ExistsOnDisk() const; std::string GetName() const; std::string GetDescription() const; - void SetName(const std::string& name); - void SetDescription(const std::string& description); + bool SetName(const std::string& name); + bool SetDescription(const std::string& description); std::string GetId() const; Ref GetFolder() const; - void SetFolder(Ref folder); + bool SetFolder(Ref folder); bool Export(const std::string& destination) const; int64_t GetCreationTimestamp() const; }; @@ -3696,13 +3696,13 @@ namespace BinaryNinja { std::string GetPath() const; std::string GetFilePathInProject(const Ref& file) const; std::string GetName() const; - void SetName(const std::string& name); + bool SetName(const std::string& name); std::string GetDescription() const; - void SetDescription(const std::string& description); + bool SetDescription(const std::string& description); Ref QueryMetadata(const std::string& key); bool StoreMetadata(const std::string& key, Ref value); - void RemoveMetadata(const std::string& key); + bool RemoveMetadata(const std::string& key); Ref CreateFolderFromPath(const std::string& path, Ref parent, const std::string& description, const ProgressFunction& progressCallback = {}); @@ -3710,7 +3710,7 @@ namespace BinaryNinja { Ref CreateFolderUnsafe(Ref parent, const std::string& name, const std::string& description, const std::string& id); std::vector> GetFolders() const; Ref GetFolderById(const std::string& id) const; - void PushFolder(Ref folder); + bool PushFolder(Ref folder); bool DeleteFolder(Ref folder, const ProgressFunction& progressCallback = {}); Ref CreateFileFromPath(const std::string& path, Ref folder, const std::string& name, const std::string& description, const ProgressFunction& progressCallback = {}); @@ -3721,14 +3721,14 @@ namespace BinaryNinja { Ref GetFileById(const std::string& id) const; Ref GetFileByPathOnDisk(const std::string& path) const; std::vector> GetFilesByPathInProject(const std::string& path) const; - void PushFile(Ref file); + bool PushFile(Ref file); bool DeleteFile_(Ref file); void RegisterNotification(ProjectNotification* notify); void UnregisterNotification(ProjectNotification* notify); - void BeginBulkOperation(); - void EndBulkOperation(); + bool BeginBulkOperation(); + bool EndBulkOperation(); Ref GetRemoteProject(); }; -- cgit v1.3.1