@@ -409,6 +409,8 @@ namespace BinaryNinja
409409 BNMessageBoxButtonResult ShowMessageBox (const std::string& title, const std::string& text,
410410 BNMessageBoxButtonSet buttons = OKButtonSet, BNMessageBoxIcon icon = InformationIcon);
411411
412+ std::string GetUniqueIdentifierString ();
413+
412414 class QualifiedName
413415 {
414416 std::vector<std::string> m_name;
@@ -1027,11 +1029,15 @@ namespace BinaryNinja
10271029
10281030 std::map<QualifiedName, Ref<Type>> GetTypes ();
10291031 Ref<Type> GetTypeByName (const QualifiedName& name);
1032+ Ref<Type> GetTypeById (const std::string& id);
1033+ std::string GetTypeId (const QualifiedName& name);
1034+ QualifiedName GetTypeNameById (const std::string& id);
10301035 bool IsTypeAutoDefined (const QualifiedName& name);
1031- void DefineType (const QualifiedName& name , Ref<Type> type);
1036+ QualifiedName DefineType (const std::string& id, const QualifiedName& defaultName , Ref<Type> type);
10321037 void DefineUserType (const QualifiedName& name, Ref<Type> type);
1033- void UndefineType (const QualifiedName& name );
1038+ void UndefineType (const std::string& id );
10341039 void UndefineUserType (const QualifiedName& name);
1040+ void RenameType (const QualifiedName& oldName, const QualifiedName& newName);
10351041
10361042 bool FindNextData (uint64_t start, const DataBuffer& data, uint64_t & result, BNFindFlag flags = NoFindFlags);
10371043
@@ -1611,25 +1617,40 @@ namespace BinaryNinja
16111617 static Ref<Type> StructureType (Structure* strct);
16121618 static Ref<Type> NamedType (NamedTypeReference* ref, size_t width = 0 , size_t align = 1 );
16131619 static Ref<Type> NamedType (const QualifiedName& name, Type* type);
1620+ static Ref<Type> NamedType (const std::string& id, const QualifiedName& name, Type* type);
1621+ static Ref<Type> NamedType (BinaryView* view, const QualifiedName& name);
16141622 static Ref<Type> EnumerationType (Architecture* arch, Enumeration* enm, size_t width = 0 , bool issigned = false );
16151623 static Ref<Type> PointerType (Architecture* arch, Type* type, bool cnst = false , bool vltl = false ,
16161624 BNReferenceType refType = PointerReferenceType);
16171625 static Ref<Type> ArrayType (Type* type, uint64_t elem);
16181626 static Ref<Type> FunctionType (Type* returnValue, CallingConvention* callingConvention,
16191627 const std::vector<NameAndType>& params, bool varArg = false );
1628+
1629+ static std::string GenerateAutoTypeId (const std::string& source, const QualifiedName& name);
1630+ static std::string GenerateAutoPlatformTypeId (const QualifiedName& name);
1631+ static std::string GenerateAutoDemangledTypeId (const QualifiedName& name);
16201632 };
16211633
16221634 class NamedTypeReference : public CoreRefCountObject <BNNamedTypeReference, BNNewNamedTypeReference,
16231635 BNFreeNamedTypeReference>
16241636 {
16251637 public:
16261638 NamedTypeReference (BNNamedTypeReference* nt);
1627- NamedTypeReference (BNNamedTypeReferenceClass cls = UnknownNamedTypeClass,
1639+ NamedTypeReference (BNNamedTypeReferenceClass cls = UnknownNamedTypeClass, const std::string& id = " " ,
16281640 const QualifiedName& name = QualifiedName());
16291641 BNNamedTypeReferenceClass GetTypeClass () const ;
16301642 void SetTypeClass (BNNamedTypeReferenceClass cls);
1643+ std::string GetTypeId () const ;
1644+ void SetTypeId (const std::string& id);
16311645 QualifiedName GetName () const ;
16321646 void SetName (const QualifiedName& name);
1647+
1648+ static Ref<NamedTypeReference> GenerateAutoTypeReference (BNNamedTypeReferenceClass cls,
1649+ const std::string& source, const QualifiedName& name);
1650+ static Ref<NamedTypeReference> GenerateAutoPlatformTypeReference (BNNamedTypeReferenceClass cls,
1651+ const QualifiedName& name);
1652+ static Ref<NamedTypeReference> GenerateAutoDemangledTypeReference (BNNamedTypeReferenceClass cls,
1653+ const QualifiedName& name);
16331654 };
16341655
16351656 struct StructureMember
0 commit comments