1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-14 16:16:41 +00:00
Ryujinx/Ryujinx.Debugger/Profiler/ProfilerConfiguration.cs
Thog 886e42fb19
Use the official JSON parser (#1151)
This remove Utf8son and JsonPrettyPrinter dependencies.

NOTE: the standard JSON parser doesn't support configurable
indentation, as a result, all the pretty printed JSON are indented with 2
spaces.
2020-04-30 14:07:41 +02:00

29 lines
973 B
C#

using Ryujinx.Common.Utilities;
using System.IO;
namespace Ryujinx.Debugger.Profiler
{
public class ProfilerConfiguration
{
public bool Enabled { get; private set; }
public string DumpPath { get; private set; }
public float UpdateRate { get; private set; }
public int MaxLevel { get; private set; }
public int MaxFlags { get; private set; }
public float History { get; private set; }
/// <summary>
/// Loads a configuration file from disk
/// </summary>
/// <param name="path">The path to the JSON configuration file</param>
public static ProfilerConfiguration Load(string path)
{
if (!File.Exists(path))
{
throw new FileNotFoundException($"Profiler configuration file {path} not found");
}
return JsonHelper.DeserializeFromFile<ProfilerConfiguration>(path);
}
}
}