static private Load ( |
||
reader | ||
fieldHandlerFactory | IFieldHandlerFactory | |
tableName | string | |
handlerOptions | FieldHandlerOptions | |
Результат |
internal static TableVersionInfo Load(ref SpanReader reader, IFieldHandlerFactory fieldHandlerFactory, string tableName) { var fieldCount = reader.ReadVUInt32(); var fieldInfos = new TableFieldInfo[fieldCount]; for (var i = 0; i < fieldCount; i++) { fieldInfos[i] = TableFieldInfo.Load(ref reader, fieldHandlerFactory, tableName, FieldHandlerOptions.None); } return(new TableVersionInfo(fieldInfos)); }
internal static TableVersionInfo Load(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory, string tableName) { var fieldCount = reader.ReadVUInt32(); var fieldInfos = new TableFieldInfo[fieldCount]; for (int i = 0; i < fieldCount; i++) { fieldInfos[i] = TableFieldInfo.Load(reader, fieldHandlerFactory, tableName); } return(new TableVersionInfo(fieldInfos)); }
public static RelationVersionInfo Load(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory, string relationName) { var pkCount = reader.ReadVUInt32(); var primaryKeys = new List <TableFieldInfo>((int)pkCount); for (var i = 0u; i < pkCount; i++) { primaryKeys.Add(TableFieldInfo.Load(reader, fieldHandlerFactory, relationName, FieldHandlerOptions.Orderable)); } var skFieldCount = reader.ReadVUInt32(); var secondaryKeyFields = new TableFieldInfo[skFieldCount]; for (var i = 0; i < skFieldCount; i++) { secondaryKeyFields[i] = TableFieldInfo.Load(reader, fieldHandlerFactory, relationName, FieldHandlerOptions.Orderable); } var skCount = reader.ReadVUInt32(); var secondaryKeys = new Dictionary <uint, SecondaryKeyInfo>((int)skCount); var secondaryKeysNames = new Dictionary <string, uint>((int)skCount); for (var i = 0; i < skCount; i++) { var skIndex = reader.ReadVUInt32(); var info = new SecondaryKeyInfo(); info.Index = reader.ReadVUInt32(); info.Name = reader.ReadString(); var cnt = reader.ReadVUInt32(); info.Fields = new List <FieldId>((int)cnt); for (var j = 0; j < cnt; j++) { var fromPrimary = reader.ReadBool(); var index = reader.ReadVUInt32(); info.Fields.Add(new FieldId(fromPrimary, index)); } secondaryKeys.Add(skIndex, info); secondaryKeysNames.Add(info.Name, skIndex); } var fieldCount = reader.ReadVUInt32(); var fieldInfos = new TableFieldInfo[fieldCount]; for (int i = 0; i < fieldCount; i++) { fieldInfos[i] = TableFieldInfo.Load(reader, fieldHandlerFactory, relationName, FieldHandlerOptions.None); } return(new RelationVersionInfo(primaryKeys, secondaryKeys, secondaryKeysNames, fieldInfos)); }