Skip to content

Commit

Permalink
ref - brk|doc - Moved classes
Browse files Browse the repository at this point in the history
---

Type: ref
Breaking: True
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jul 27, 2024
1 parent 1ff560a commit 6421fbc
Show file tree
Hide file tree
Showing 25 changed files with 767 additions and 890 deletions.
4 changes: 1 addition & 3 deletions SpecProbe.ConsoleTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Hardware;
using SpecProbe.Hardware.Parts.Types;
using SpecProbe.Platform;
using SpecProbe.Parts.Types;
using SpecProbe.Software.Platform;
using System.Diagnostics;
using Terminaux.Writer.ConsoleWriters;
Expand Down
8 changes: 0 additions & 8 deletions SpecProbe.Native/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,12 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Software.Kernel;
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using SpecProbe.Software.Platform;




#if !NETCOREAPP
using NativeLand;
#endif

namespace SpecProbe.Native
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Platform
namespace SpecProbe.Software.Platform
{
/// <summary>
/// Platform (operating system).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Properties;
using SpecProbe.Software.Platform;
using System;
using System.Runtime.InteropServices;
using System.IO;
using System.Text.Json;
using System.Text.Json.Nodes;

namespace SpecProbe.Platform
namespace SpecProbe.Software.Platform
{
/// <summary>
/// Tools for reading the RID graph
Expand All @@ -36,19 +33,15 @@ public static class RidGraphReader
/// </summary>
/// <returns>List of RIDs from the current RID to the base RID</returns>
public static string[] GetGraphFromRid() =>
#if NET
GetGraphFromRid(RuntimeInformation.RuntimeIdentifier);
#else
GetGraphFromRid(PlatformHelper.GetCurrentGenericRid());
#endif

/// <summary>
/// Gets the graph from the specified RID
/// </summary>
/// <returns>List of RIDs from the specified RID to the base RID</returns>
public static string[] GetGraphFromRid(string rid)
{
string graphJson = Resources.RidGraph;
string graphJson = GetRidGraphJson();
var graphInstance = JsonNode.Parse(graphJson);
foreach (var ridGraph in graphInstance.AsObject())
{
Expand All @@ -59,7 +52,14 @@ public static string[] GetGraphFromRid(string rid)
return graphArray;
}
}
return Array.Empty<string>();
return [];
}

private static string GetRidGraphJson()
{
var ridGraphStream = typeof(RidGraphReader).Assembly.GetManifestResourceStream("SpecProbe.Software.Resources.ridgraph.json");
var reader = new StreamReader(ridGraphStream);
return reader.ReadToEnd();
}
}
}
File renamed without changes.
9 changes: 8 additions & 1 deletion SpecProbe.Software/SpecProbe.Software.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<RepositoryType>git</RepositoryType>
<PackageTags>hardware, information</PackageTags>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableNETAnalyzers>false</EnableNETAnalyzers>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand All @@ -34,4 +33,12 @@
<None Include="../SpecProbe/OfficialAppIcon-SpecProbe-512.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources/ridgraph.json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Hardware.Parts.Types;
using SpecProbe.Hardware.Probers;
using SpecProbe.Parts.Types;
using SpecProbe.Probers;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SpecProbe.Hardware
namespace SpecProbe
{
/// <summary>
/// Hardware probing class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts
namespace SpecProbe.Parts
{
/// <summary>
/// Base hardware part information class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts
namespace SpecProbe.Parts
{
/// <summary>
/// Hardware part type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts
namespace SpecProbe.Parts
{
/// <summary>
/// Hardware part info interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts.Types

//
// SpecProbe Copyright (C) 2023-2024 Aptivi
//
// This file is part of SpecProbe
//
// SpecProbe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// SpecProbe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Parts;

namespace SpecProbe.Parts.Types
{
/// <summary>
/// Hard disk part
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts.Types

//
// SpecProbe Copyright (C) 2023-2024 Aptivi
//
// This file is part of SpecProbe
//
// SpecProbe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// SpecProbe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Parts;

namespace SpecProbe.Parts.Types
{
/// <summary>
/// Memory part
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts.Types

//
// SpecProbe Copyright (C) 2023-2024 Aptivi
//
// This file is part of SpecProbe
//
// SpecProbe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// SpecProbe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Parts;

namespace SpecProbe.Parts.Types
{
/// <summary>
/// Processor part
Expand Down Expand Up @@ -109,7 +131,7 @@ public string Vendor
{
"AuthenticAMD" => "AMD",
"GenuineIntel" => "Intel",
_ => Name.Contains(" ") ? Name.Split(' ')[0] : "Unknown",
_ => Name.Contains(" ") ? Name.Split(' ')[0] : "Unknown",
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,29 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

namespace SpecProbe.Hardware.Parts.Types

//
// SpecProbe Copyright (C) 2023-2024 Aptivi
//
// This file is part of SpecProbe
//
// SpecProbe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// SpecProbe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using SpecProbe.Parts;

namespace SpecProbe.Parts.Types
{
/// <summary>
/// Video card part
Expand Down
Loading

0 comments on commit 6421fbc

Please sign in to comment.