public static V8Field Field_from_tree(Tree field_tree, ref bool has_version, V8Table parent) { V8Field fld = new V8Field(parent); if (field_tree.Get_Type() != Node_Type.nd_string) { throw new Exception("Ошибка получения имени поля таблицы. Узел не является строкой."); } fld.Name = field_tree.Get_Value(); field_tree = field_tree.Get_Next(); Field_type_declaration type_declaration; try { type_declaration = Field_type_declaration.Parse_tree(field_tree); } catch { throw new Exception($"Поле {fld.Name}"); } fld.Type = type_declaration.Type; fld.Null_exists = type_declaration.Null_exists; fld.Type_manager = FieldType.Create_type_manager(type_declaration); if (fld.Type == TypeFields.tf_version) { has_version = true; } return(fld); }
public V8Field(V8Table _parent) { if (!Null_index_initialized) { Array.Clear(Null_index, 0, 0x1000); Null_index_initialized = true; } Parent = _parent; Len = 0; Offset = 0; Name = ""; }
public V8Index(V8Table _base) { Tbase = _base; Is_primary = false; Num_records = 0; Records = null; Start = 0; Rootblock = 0; Length = 0; Recordsindex_complete = false; Pagesize = Tbase.Base_.Pagesize; Version = (DBVer)Tbase.Base_.Version; }
/* * public table_file(Table _t, String _name, UInt32 _maxpartno) * { * t = _t; * name = _name; * maxpartno = _maxpartno; * } */ public TableFile(V8Table _t, string _name, UInt32 _maxpartno) { t = _t; name = _name; maxpartno = _maxpartno; }
/// <summary> /// Конструктор /// </summary> /// <param name="t"></param> public TableFiles(V8Table t) { V8Field filename; V8Field f; V8Field partno; int start; int length; //char[] create; byte create; //char[] modify; byte modify; int i; int j; string s; table_rec ptr; table_rec tr = new table_rec(); //std::vector<table_rec> allrec; List <table_rec> allrec = null; //std::map<String, int> maxpartnos; SortedDictionary <String, int> maxpartnos = null; //std::map<String, int>::iterator pmaxpartno; TableFile tf; //std::map<String, table_file*>::iterator pfilesmap; table = t; ready = test_table(); if (!ready) { return; } //Container_file.temppath = System.IO.Path.GetTempPath(); //rec = new char[table.Get_recordlen()]; rec = new byte[table.Get_recordlen()]; filename = table.Getfield(0); f = table.Getfield(1); // create = (unsigned char*)(rec + f->getoffset()); create = rec[f.Getoffset()]; f = table.Getfield(1); modify = rec[f.Getoffset()]; f = table.Getfield(5); start = rec[f.Getoffset()]; length = start + 1; partno = (table.Get_numfields() > 6) ? table.Getfield(6) : null; for (i = 0; i < table.Get_phys_numrecords(); ++i) { table.Getrecord((uint)i, rec); if (rec != null) { continue; } if (start == 0) { continue; } if (length == 0) { continue; } tr.Name = filename.Get_presentation(rec); if (string.IsNullOrEmpty(tr.Name)) { continue; } // TODO : Надо с этим разобраться // tr.Addr.Blob_start = start; // tr.Addr.Blob_length = length; if (partno != null) { tr.Partno = Convert.ToInt32(partno.Get_presentation(rec, true)); } else { tr.Partno = 0; } // TODO : Надо с этим разобраться // time1CD_to_FileTime(&tr.ft_create, create); // time1CD_to_FileTime(&tr.ft_modify, modify); allrec.Add(tr); s = tr.Name.ToUpper(); if (!maxpartnos.TryGetValue(s, out int val)) { maxpartnos[s] = tr.Partno; } else if (val < tr.Partno) { val = tr.Partno; } } foreach (var item_maxpartnos in maxpartnos) { tf = new TableFile(table, item_maxpartnos.Key, (uint)item_maxpartnos.Value); } for (j = 0; j < allrec.Count; ++j) { ptr = allrec[j]; if (allfiles.TryGetValue(ptr.Name.ToUpper(), out TableFile val)) { tf = val; tf.addr[ptr.Partno] = ptr.Addr; if (ptr.Partno == 0) { tf.Ft_create = ptr.Ft_create; tf.Ft_modify = ptr.Ft_modify; tf.Name = ptr.Name; } } else { tf = null; } } }
public virtual String Get_XML_presentation(byte[] rec, V8Table parent, bool ignore_showGUID) { return(" "); }
private bool Recursive_test_stream_format2(V8Table t, UInt32 nrec) { return(true); } // для DBSCHEMA
private bool Recursive_test_stream_format(V8Table t, UInt32 nrec) { return(true); }
public void Restore_DATA_allocation_table(V8Table tab) { }
} // создание таблицы из файлов импорта таблиц public bool Delete_table(V8Table tab) { return(true); }