public tabFile(EFile a_File) { m_File = a_File; changed = false; Stream MS = a_File.Open(FileAccess.Read); fileheader = new BinaryStreamReader(MS).Read<tabheader>(); uint Columns = readUint(MS); header = new List<string>((int)Columns); data = new List<List<string>>(); for (int i = 0; i < Columns; i++) { byte b = (byte)MS.ReadByte(); if (b != 0) { ushort tmp = readShort(MS); string q = readString(MS); header.Add(q); int rows = (int)readUint(MS); List<string> d = new List<string>(rows); for (int j = 0; j < rows; j++) d.Add(readString(MS)); data.Add(d); } } a_File.Close(); }
public tabFile(EFile a, params string[] columns) { fileheader = new tabheader(1); header = new List<string>(columns); changed = true; data = new List<List<string>>(); for (int i = 0; i < columns.Length; i++) data.Add(new List<string>()); m_File = a; }