MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / ProcessStruct

Method ProcessStruct

Reflector/Program.cs:67–88  ·  view source on GitHub ↗

Recursive method to process structs

(CppClass cppClass, CppCompilation compilation, List<StructInfo> structs)

Source from the content-addressed store, hash-verified

65
66 // Recursive method to process structs
67 static void ProcessStruct(CppClass cppClass, CppCompilation compilation, List<StructInfo> structs)
68 {
69 var structInfo = new StructInfo {
70 Name = cppClass.Name,
71 Members = new List<MemberInfo>(),
72 Type = cppClass.ClassKind == CppClassKind.Class ? "class" :
73 cppClass.ClassKind == CppClassKind.Union ? "union" :
74 "struct"
75 };
76
77 foreach (var field in cppClass.Fields) {
78 var fieldType = UnwrapType(field.Type);
79 var memberInfo = new MemberInfo {
80 Name = field.Name,
81 Type = field.Type.GetDisplayName(),
82 DumpExpression = GetDumpExpression(field.Type, $"s.{field.Name}")
83 };
84 structInfo.Members.Add(memberInfo);
85 }
86
87 structs.Add(structInfo);
88 }
89
90 // Method to process enums
91 static void ProcessEnum(CppEnum cppEnum, CppCompilation compilation, List<EnumInfo> enums)

Callers

nothing calls this directly

Calls 1

AddMethod · 0.80

Tested by

no test coverage detected