Figure out how to convert Textfile

This commit is contained in:
Matt Nadareski
2023-03-13 16:17:21 -04:00
parent c43353d126
commit c64e138ba7
4 changed files with 82 additions and 36 deletions

View File

@@ -28,7 +28,27 @@ namespace BinaryObjectScanner.Utilities
}
/// <summary>
/// Append one result to a results dictionary
/// Append one set of results to a results dictionary
/// </summary>
/// <param name="original">Dictionary to append to</param>
/// <param name="key">Key to add information to</param>
/// <param name="value">String value to add</param>
public static void AppendToDictionary(ConcurrentDictionary<string, ConcurrentQueue<string>> original, string key, string[] values)
{
// If the dictionary is null, just return
if (original == null)
return;
// Use a placeholder value if the key is null
key = key ?? "NO FILENAME";
// Add the key if needed and then append the lists
original.TryAdd(key, new ConcurrentQueue<string>());
original[key].AddRange(values);
}
/// <summary>
/// Append one set of results to a results dictionary
/// </summary>
/// <param name="original">Dictionary to append to</param>
/// <param name="key">Key to add information to</param>

View File

@@ -12,6 +12,22 @@ namespace BinaryObjectScanner.Utilities
{
#region ConcurrentQueue
/// <summary>
/// Add a range of values from one queue to another
/// </summary>
/// <param name="original">Queue to add data to</param>
/// <param name="values">Array to get data from</param>
public static void AddRange(this ConcurrentQueue<string> original, string[] values)
{
if (values == null || values.Length == 0)
return;
for (int i = 0; i < values.Length; i++)
{
original.Enqueue(values[i]);
}
}
/// <summary>
/// Add a range of values from one queue to another
/// </summary>