Move non-output to new CppUtils namespace

We prefer to have the Outputs directory contain just one file or
namespace per output module, so we'll move all C++-related stuff to a
new CppUtils namespace instead.
This commit is contained in:
Robert Xiao
2020-06-26 18:03:04 -07:00
committed by Katy
parent de6d9e2230
commit 393d26b2a3
33 changed files with 17 additions and 16 deletions

View File

@@ -9,7 +9,7 @@ using System.Linq;
using CommandLine; using CommandLine;
using Il2CppInspector.Reflection; using Il2CppInspector.Reflection;
using Il2CppInspector.Outputs; using Il2CppInspector.Outputs;
using Il2CppInspector.Outputs.UnityHeaders; using Il2CppInspector.CppUtils.UnityHeaders;
namespace Il2CppInspector.CLI namespace Il2CppInspector.CLI
{ {

View File

@@ -5,7 +5,7 @@
All rights reserved. All rights reserved.
*/ */
using Il2CppInspector.Outputs.UnityHeaders; using Il2CppInspector.CppUtils.UnityHeaders;
using Il2CppInspector.Reflection; using Il2CppInspector.Reflection;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -13,7 +13,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Il2CppInspector.Outputs namespace Il2CppInspector.CppUtils
{ {
// Class for generating C header declarations from Reflection objects (TypeInfo, etc.) // Class for generating C header declarations from Reflection objects (TypeInfo, etc.)
public class CppDeclarations public class CppDeclarations
@@ -231,7 +231,7 @@ namespace Il2CppInspector.Outputs
* We have to be a little careful: the rootmost class needs to have its alignment * We have to be a little careful: the rootmost class needs to have its alignment
* set to that of Il2CppObject, but we can't explicitly include Il2CppObject * set to that of Il2CppObject, but we can't explicitly include Il2CppObject
* in the hierarchy because we want to customize the type of the klass parameter. */ * in the hierarchy because we want to customize the type of the klass parameter. */
var align = (model.Package.BinaryImage.Bits == 32) ? 4 : 8; var align = model.Package.BinaryImage.Bits == 32 ? 4 : 8;
csrc.Append($"struct __declspec(align({align})) {name}__Fields {{\n"); csrc.Append($"struct __declspec(align({align})) {name}__Fields {{\n");
GenerateFieldList(csrc, ns, ti); GenerateFieldList(csrc, ns, ti);
csrc.Append($"}};\n"); csrc.Append($"}};\n");

View File

@@ -9,7 +9,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace Il2CppInspector.Outputs namespace Il2CppInspector.CppUtils
{ {
/// <summary> /// <summary>
/// A utility class for managing names in a common namespace. /// A utility class for managing names in a common namespace.

View File

@@ -10,7 +10,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
namespace Il2CppInspector.Outputs.UnityHeaders namespace Il2CppInspector.CppUtils.UnityHeaders
{ {
// Each instance of UnityHeader represents one header file which potentially covers multiple versions of Unity. // Each instance of UnityHeader represents one header file which potentially covers multiple versions of Unity.
public class UnityHeader public class UnityHeader
@@ -84,8 +84,8 @@ namespace Il2CppInspector.Outputs.UnityHeaders
continue; continue;
if (v.MetadataVersion == 21) { if (v.MetadataVersion == 21) {
/* Special version logic for metadata version 21 based on the Il2CppMetadataRegistration.fieldOffsets field */ /* Special version logic for metadata version 21 based on the Il2CppMetadataRegistration.fieldOffsets field */
var headerFieldOffsetsArePointers = (v.MinVersion.CompareTo("5.3.7") >= 0 && v.MinVersion.CompareTo("5.4.0") != 0); var headerFieldOffsetsArePointers = v.MinVersion.CompareTo("5.3.7") >= 0 && v.MinVersion.CompareTo("5.4.0") != 0;
var binaryFieldOffsetsArePointers = (model.Package.Binary.FieldOffsets == null); var binaryFieldOffsetsArePointers = model.Package.Binary.FieldOffsets == null;
if (headerFieldOffsetsArePointers != binaryFieldOffsetsArePointers) if (headerFieldOffsetsArePointers != binaryFieldOffsetsArePointers)
continue; continue;
} }

View File

@@ -8,7 +8,7 @@
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Il2CppInspector.Outputs.UnityHeaders namespace Il2CppInspector.CppUtils.UnityHeaders
{ {
// Parsed representation of a Unity version number, such as 5.3.0f1 or 2019.3.7. // Parsed representation of a Unity version number, such as 5.3.0f1 or 2019.3.7.
public class UnityVersion : IComparable<UnityVersion>, IEquatable<UnityVersion> public class UnityVersion : IComparable<UnityVersion>, IEquatable<UnityVersion>

View File

@@ -10,11 +10,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<None Remove="Outputs\UnityHeaders\**" /> <None Remove="CppUtils\UnityHeaders\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Outputs\UnityHeaders\**" /> <EmbeddedResource Include="CppUtils\UnityHeaders\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -9,7 +9,8 @@ using System.Linq;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Il2CppInspector.Reflection; using Il2CppInspector.Reflection;
using Il2CppInspector.Outputs.UnityHeaders; using Il2CppInspector.CppUtils;
using Il2CppInspector.CppUtils.UnityHeaders;
namespace Il2CppInspector.Outputs namespace Il2CppInspector.Outputs
{ {

View File

@@ -28,7 +28,7 @@ using Il2CppInspector.Outputs;
using Il2CppInspector.Reflection; using Il2CppInspector.Reflection;
using Ookii.Dialogs.Wpf; using Ookii.Dialogs.Wpf;
using Path = System.IO.Path; using Path = System.IO.Path;
using Il2CppInspector.Outputs.UnityHeaders; using Il2CppInspector.CppUtils.UnityHeaders;
namespace Il2CppInspectorGUI namespace Il2CppInspectorGUI
{ {

View File

@@ -6,7 +6,7 @@
*/ */
using System.IO; using System.IO;
using Il2CppInspector.Outputs.UnityHeaders; using Il2CppInspector.CppUtils.UnityHeaders;
using Il2CppInspector.Reflection; using Il2CppInspector.Reflection;
using NUnit.Framework; using NUnit.Framework;