• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SamboyCoding / Cpp2IL / 15043826298

15 May 2025 11:30AM UTC coverage: 34.593% (-0.2%) from 34.797%
15043826298

push

github

SamboyCoding
Only set class layout for structs

1790 of 6496 branches covered (27.56%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 1 file covered. (100.0%)

18 existing lines in 3 files now uncovered.

4143 of 10655 relevant lines covered (38.88%)

161070.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.76
/LibCpp2IL/Reflection/Il2CppTypeReflectionData.cs
1
using System.Text;
2
using LibCpp2IL.Metadata;
3

4
#pragma warning disable 8618
5
namespace LibCpp2IL.Reflection;
6

7
/// <summary>
8
/// A wrapper around Il2CppTypeDefinition to allow expression of complex types such as Generics. Can represent one of three things:
9
/// <ul>
10
/// <li>If both <see cref="isType"/> and <see cref="isGenericType"/> are false, this represents a generic parameter (such as the T in List&lt;T>)</li>
11
/// <li>If <see cref="isType"/> is true and <see cref="isGenericType"/> is false, this represents a standard Il2CppTypeDefinition - check <see cref="baseType"/> to see what</li>
12
/// <li>If both <see cref="isType"/> and <see cref="isGenericType"/> are true, this is a complex generic type, of basic type <see cref="baseType"/> - this is where the List part would be - and with params stored in <see cref="genericParams"/> - these may be any of these three cases again.</li>
13
/// </ul>
14
/// <br/>
15
/// Calling <see cref="ToString"/> on this object will return the canonical representation of this object, with generic params such as System.Collections.Generic.List`1&lt;T> or with concrete types, like in the case of a String's interfaces, <code>System.Collections.Generic.IEnumerable`1&lt;System.Char&gt;</code>
16
/// </summary>
17
public class Il2CppTypeReflectionData
18
{
19
    public Il2CppTypeDefinition? baseType;
20
    public Il2CppTypeReflectionData[] genericParams;
21
    public bool isType;
22
    public bool isGenericType;
23
    public bool isArray;
24
    public Il2CppTypeReflectionData? arrayType;
25
    public byte arrayRank;
26
    public string variableGenericParamName;
27
    public long variableGenericParamIndex;
28
    public bool isPointer;
29
#pragma warning restore 8618
30

31
    public Il2CppGenericParameter? GenericParameter => isArray || isType ? null : LibCpp2IlMain.TheMetadata?.genericParameters[(int)variableGenericParamIndex];
1,567!
32

33
    private string GetPtrSuffix()
34
    {
UNCOV
35
        return isPointer ? "*" : "";
×
36
    }
37

38
    public override string ToString()
39
    {
UNCOV
40
        if (isArray)
×
UNCOV
41
            return arrayType + "[]".Repeat(arrayRank) + GetPtrSuffix();
×
42

UNCOV
43
        if (!isType)
×
UNCOV
44
            return variableGenericParamName + GetPtrSuffix();
×
45

UNCOV
46
        if (!isGenericType)
×
UNCOV
47
            return baseType!.FullName! + GetPtrSuffix();
×
48

UNCOV
49
        var builder = new StringBuilder(baseType!.FullName + "<");
×
UNCOV
50
        foreach (var genericParam in genericParams)
×
51
        {
UNCOV
52
            builder.Append(genericParam).Append(", ");
×
53
        }
54

UNCOV
55
        builder.Remove(builder.Length - 2, 2);
×
UNCOV
56
        builder.Append(">");
×
UNCOV
57
        return builder + GetPtrSuffix();
×
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc