private static Table ReadTable(BinaryReader Reader) { /* * Read: * Header * Schema * SortKey * Record Collection */ // Read header // TableHeader h = new TableHeader(BinarySerializer.ReadRecord(Reader, 10)); // Read schema // Schema s = new Schema(BinarySerializer.ReadRecords(Reader, h.ColumnCount, 4)); // Read key // Key k = new Key(BinarySerializer.ReadRecord(Reader, (int)h.KeyCount)); // Read record cache // List<Record> l = BinarySerializer.ReadRecords(Reader, h.Size, 2); // Return recordset // return new Table(h, s, l, k); }
// Statics // public static string FilePath(string Dir, string Name) { TableHeader h = new TableHeader(Dir.Trim(), Name.Trim(), 0, 0, 0, 0, 0); return h.Path; }
public static Table BufferTable(TableHeader H) { return BufferTable(H.Path); }
private static Table ReadTableSafe2(byte[] Mem, int Location) { /* * Read: * Header * Schema * SortKey * Record Collection */ // Read header // Record rh; Location = ReadRecordSafe2(Mem, Location, 11, out rh); TableHeader h = new TableHeader(rh); // Read schema // List<Record> s_cache = new List<Record>(); Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, h.ColumnCount, 4, s_cache); Schema s = new Schema(s_cache); // Read key // Record rk; Location = ReadRecordSafe2(Mem, Location, (int)h.KeyCount, out rk); Key k = new Key(rk); // Read record cache // List<Record> d_cache = new List<Record>(); Location = BinarySerializer.ReadRecordsSafe2(Mem, Location, (int)h.Size, 2, d_cache); // Return recordset // return new Table(h, s, d_cache, k); }
public static void DropTable(TableHeader H) { DropTable(H.Path); }
public static bool Exists(TableHeader Data) { return Exists(Data.Path); }
public static void RenameBigRecordSet(TableHeader H, string NewName) { Table brs = BinarySerializer.BufferTable(H); DataSetManager.RenameBigRecordSet(brs, NewName); }