From dc1094fb4a1f416a5e56bef4941a35bca3506865 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 4 Sep 2025 18:21:25 -0400 Subject: Add type attribute APIs --- binaryninjaapi.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index f7896a45..a71d8fc0 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -10066,7 +10066,16 @@ namespace BinaryNinja { }; /*! - \ingroup types + \ingroup types + */ + struct TypeAttribute + { + std::string name; + std::string value; + }; + + /*! + \ingroup types */ class Type : public CoreRefCountObject { @@ -10208,6 +10217,9 @@ namespace BinaryNinja { std::string GetPointerSuffixString() const; std::vector GetPointerSuffixTokens(uint8_t baseConfidence = BN_FULL_CONFIDENCE) const; + std::vector GetAttributes() const; + std::optional GetAttribute(const std::string& name) const; + std::string GetString(Platform* platform = nullptr, BNTokenEscapingType escaping = NoTokenEscapingType) const; std::string GetTypeAndName(const QualifiedName& name, BNTokenEscapingType escaping = NoTokenEscapingType) const; std::string GetStringBeforeName(Platform* platform = nullptr, BNTokenEscapingType escaping = NoTokenEscapingType) const; @@ -10623,6 +10635,12 @@ namespace BinaryNinja { TypeBuilder& AddPointerSuffix(BNPointerSuffix ps); TypeBuilder& SetPointerSuffix(const std::set& suffix); + void SetAttribute(const std::string& name, const std::string& value); + void SetAttributes(const std::map& attrs); + void RemoveAttribute(const std::string& name); + std::vector GetAttributes() const; + std::optional GetAttribute(const std::string& name) const; + std::string GetString(Platform* platform = nullptr) const; std::string GetTypeAndName(const QualifiedName& name) const; std::string GetStringBeforeName(Platform* platform = nullptr) const; -- cgit v1.3.1