示例#1
0
        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);

        }
示例#2
0
 // 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;
 }
示例#3
0
 public static Table BufferTable(TableHeader H)
 {
     return BufferTable(H.Path);
 }
示例#4
0
        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);

        }
示例#5
0
 public static void DropTable(TableHeader H)
 {
     DropTable(H.Path);
 }
示例#6
0
 public static bool Exists(TableHeader Data)
 {
     return Exists(Data.Path);
 }
示例#7
0
 public static void RenameBigRecordSet(TableHeader H, string NewName)
 {
     Table brs = BinarySerializer.BufferTable(H);
     DataSetManager.RenameBigRecordSet(brs, NewName);
 }