Skip to content

Commit

Permalink
Replace tabs with spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nihlus committed Mar 8, 2024
1 parent 4ee7d4b commit 30f4f33
Show file tree
Hide file tree
Showing 40 changed files with 4,542 additions and 4,542 deletions.
36 changes: 18 additions & 18 deletions Launchpad.Common/Enums/EManifestType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@

namespace Launchpad.Common.Enums
{
/// <summary>
/// Enum defining the type of manifest.
/// </summary>
public enum EManifestType
{
/// <summary>
/// An unknown manifest.
/// </summary>
Unknown = 0,
/// <summary>
/// Enum defining the type of manifest.
/// </summary>
public enum EManifestType
{
/// <summary>
/// An unknown manifest.
/// </summary>
Unknown = 0,

/// <summary>
/// A launcher manifest.
/// </summary>
Launchpad = 1,
/// <summary>
/// A launcher manifest.
/// </summary>
Launchpad = 1,

/// <summary>
/// A game manifest.
/// </summary>
Game = 2
}
/// <summary>
/// A game manifest.
/// </summary>
Game = 2
}
}
16 changes: 8 additions & 8 deletions Launchpad.Common/Enums/ESystemTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

namespace Launchpad.Common.Enums
{
public enum ESystemTarget
{
Linux,
Mac,
Win64,
Win32,
Unknown
}
public enum ESystemTarget
{
Linux,
Mac,
Win64,
Win32,
Unknown
}
}
78 changes: 39 additions & 39 deletions Launchpad.Common/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,45 @@

namespace Launchpad.Common
{
/// <summary>
/// Various extension methods.
/// </summary>
public static class ExtensionMethods
{
/// <summary>
/// Sanitizes the input string, removing any \n, \r, or \0 characters.
/// </summary>
/// <param name="input">Input string.</param>
/// <returns>The string, without the illegal characters.</returns>
public static string RemoveLineSeparatorsAndNulls(this string input)
{
return input?.Replace("\n", string.Empty).Replace("\0", string.Empty).Replace("\r", string.Empty);
}
/// <summary>
/// Various extension methods.
/// </summary>
public static class ExtensionMethods
{
/// <summary>
/// Sanitizes the input string, removing any \n, \r, or \0 characters.
/// </summary>
/// <param name="input">Input string.</param>
/// <returns>The string, without the illegal characters.</returns>
public static string RemoveLineSeparatorsAndNulls(this string input)
{
return input?.Replace("\n", string.Empty).Replace("\0", string.Empty).Replace("\r", string.Empty);
}

/// <summary>
/// Adds a new value to an existing IDictionary, or if the dictionary already contains a value for the given key,
/// updates the existing key with the new value.
/// </summary>
/// <param name="dictionary">The dictionary to update.</param>
/// <param name="key">The key of the provided value.</param>
/// <param name="value">The value to add or update.</param>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <typeparam name="TValue">The type of the value.</typeparam>
public static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value)
{
if (dictionary == null)
{
throw new ArgumentNullException(nameof(dictionary));
}
/// <summary>
/// Adds a new value to an existing IDictionary, or if the dictionary already contains a value for the given key,
/// updates the existing key with the new value.
/// </summary>
/// <param name="dictionary">The dictionary to update.</param>
/// <param name="key">The key of the provided value.</param>
/// <param name="value">The value to add or update.</param>
/// <typeparam name="TKey">The type of the key.</typeparam>
/// <typeparam name="TValue">The type of the value.</typeparam>
public static void AddOrUpdate<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value)
{
if (dictionary == null)
{
throw new ArgumentNullException(nameof(dictionary));
}

if (dictionary.ContainsKey(key))
{
dictionary[key] = value;
}
else
{
dictionary.Add(key, value);
}
}
}
if (dictionary.ContainsKey(key))
{
dictionary[key] = value;
}
else
{
dictionary.Add(key, value);
}
}
}
}
40 changes: 20 additions & 20 deletions Launchpad.Common/Handlers/MD5Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@

namespace Launchpad.Common.Handlers
{
/// <summary>
/// MD5 hashing handler. Used to ensure file integrity.
/// </summary>
public static class MD5Handler
{
/// <summary>
/// Gets the file hash from a data stream.
/// </summary>
/// <returns>The hash.</returns>
/// <param name="dataStream">File stream.</param>
public static string GetStreamHash(Stream dataStream)
{
using (var md5 = MD5.Create())
{
// Calculate the hash of the stream.
var resultString = BitConverter.ToString(md5.ComputeHash(dataStream)).Replace("-", string.Empty);
/// <summary>
/// MD5 hashing handler. Used to ensure file integrity.
/// </summary>
public static class MD5Handler
{
/// <summary>
/// Gets the file hash from a data stream.
/// </summary>
/// <returns>The hash.</returns>
/// <param name="dataStream">File stream.</param>
public static string GetStreamHash(Stream dataStream)
{
using (var md5 = MD5.Create())
{
// Calculate the hash of the stream.
var resultString = BitConverter.ToString(md5.ComputeHash(dataStream)).Replace("-", string.Empty);

return resultString;
}
}
}
return resultString;
}
}
}
}
Loading

0 comments on commit 30f4f33

Please sign in to comment.