AppModel: Add AppType.Name

This commit is contained in:
Katy Coe
2020-07-18 03:47:11 +02:00
parent 307cf29dcd
commit f5e5037a9b
3 changed files with 9 additions and 8 deletions

View File

@@ -66,7 +66,7 @@ namespace Il2CppInspector.Model
IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) CppTypeCollection).GetEnumerator();
// The C++ declaration generator for this binary
internal CppDeclarationGenerator declarationGenerator; // TODO: Make private when name integration completed
private CppDeclarationGenerator declarationGenerator;
// Convenience properties

View File

@@ -29,7 +29,7 @@ namespace Il2CppInspector.Model
// The VA of the Il2CppClass object which defines this type (ClassName__TypeInfo)
public ulong TypeClassAddress { get; internal set; }
// The VA of the Il2CppType* (VA of the pointer to the Il2CppType) object which references this type
// The VA of the Il2CppType* (VA of the pointer to the Il2CppType) object which references this type (ClassName__TypeRef)
public ulong TypeRefPtrAddress { get; internal set; }
public AppType(TypeInfo ilType, CppComplexType cppType, CppComplexType valueType = null,
@@ -41,6 +41,11 @@ namespace Il2CppInspector.Model
TypeRefPtrAddress = cppTypeRefPtr;
}
// The C++ name of the type
// TODO: Known issue here where we should be using CppDeclarationGenerator.TypeNamer to ensure uniqueness
// Prefer Foo over Foo__Boxed; if there is no C++ type defined, just convert the IL type to a C identifier
public string Name => CppValueType?.Name ?? CppType?.Name ?? ILType.Name.ToCIdentifier();
public override string ToString() => ILType.FullName + " -> " + CppType.Name;
}
}