mirror of
https://github.com/MichaelHinrichs/Meat-Cleaver.git
synced 2024-11-09 15:57:50 +00:00
30 lines
773 B
C#
30 lines
773 B
C#
using static Program;
|
|
|
|
namespace Meat_Cleaver
|
|
{
|
|
static public class StringTable
|
|
{
|
|
public static List<string> Table(int count)
|
|
{
|
|
List<string> table = [];
|
|
|
|
for (int i = 0; i < count; i++)
|
|
table.Add(NullTerminatedString());
|
|
return table;
|
|
}
|
|
|
|
static string NullTerminatedString()
|
|
{
|
|
char[] fileName = [];
|
|
char readchar = (char)1;
|
|
while (readchar > 0)
|
|
{
|
|
readchar = br.ReadChar();
|
|
Array.Resize(ref fileName, fileName.Length + 1);
|
|
fileName[^1] = readchar;
|
|
}
|
|
Array.Resize(ref fileName, fileName.Length - 1);
|
|
return new(fileName);
|
|
}
|
|
}
|
|
}
|