Meat-Cleaver/StringTable.cs

31 lines
773 B
C#
Raw Normal View History

2024-05-24 15:19:02 +00:00
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);
}
}
}