mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Remove another redundant GetFullFile
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
- Separate out copy protection run
|
||||
- Remove duplicate GetFullFile method
|
||||
- Move GetBase64 to InfoTool
|
||||
- Remove another redundant GetFullFile
|
||||
|
||||
### 3.1.9a (2024-05-21)
|
||||
|
||||
|
||||
@@ -280,28 +280,6 @@ namespace MPF.Core.ExecutionContexts
|
||||
protected static bool DoesExist(List<string> parameters, int index)
|
||||
=> index < parameters.Count;
|
||||
|
||||
/// <summary>
|
||||
/// Get the full lines from the input file, if possible
|
||||
/// </summary>
|
||||
/// <param name="filename">file location</param>
|
||||
/// <param name="binary">True if should read as binary, false otherwise (default)</param>
|
||||
/// <returns>Full text of the file, null on error</returns>
|
||||
protected static string? GetFullFile(string filename, bool binary = false)
|
||||
{
|
||||
// If the file doesn't exist, we can't get info from it
|
||||
if (!File.Exists(filename))
|
||||
return null;
|
||||
|
||||
// If we're reading as binary
|
||||
if (binary)
|
||||
{
|
||||
byte[] bytes = File.ReadAllBytes(filename);
|
||||
return BitConverter.ToString(bytes).Replace("-", string.Empty);
|
||||
}
|
||||
|
||||
return File.ReadAllText(filename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if the flag is supported by the current command
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user