mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-24 15:54:57 +00:00
Figure out how to convert Textfile
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user