Exemplo n.º 1
0
        public FdbColumnData(BinaryReader reader, FdbColumnHeader header)
        {
            Type       = new DataType[header.ColumnCount];
            ColumnName = new FdbString[header.ColumnCount];

            for (var i = 0; i < header.ColumnCount; i++)
            {
                Type[i]       = (DataType)reader.ReadUInt32();
                ColumnName[i] = new FdbString(reader);
            }
        }
Exemplo n.º 2
0
        public FdbColumnHeader(BinaryReader reader)
        {
            ColumnCount = reader.ReadUInt32();

            TableName = new FdbString(reader);

            using (new FdbScope(reader))
            {
                Data = new FdbColumnData(reader, this);
            }
        }
Exemplo n.º 3
0
        public FdbRowData(BinaryReader reader, FdbRowDataHeader header)
        {
            Types = new DataType[header.ColumnCount];
            Data  = new object[header.ColumnCount];

            for (var i = 0; i < header.ColumnCount; i++)
            {
                Types[i] = (DataType)reader.ReadUInt32();

                switch (Types[i])
                {
                case DataType.Nothing:
                    Data[i] = reader.ReadInt32();
                    break;

                case DataType.Integer:
                    Data[i] = reader.ReadInt32();
                    break;

                case DataType.Unknown1:
                    Data[i] = reader.ReadInt32();
                    break;

                case DataType.Float:
                    Data[i] = reader.ReadSingle();
                    break;

                case DataType.Text:
                    Data[i] = new FdbString(reader);
                    break;

                case DataType.Boolean:
                    Data[i] = reader.ReadInt32() != 0;
                    break;

                case DataType.Bigint:
                    Data[i] = new FdbBitInt(reader);
                    break;

                case DataType.Unknown2:
                    Data[i] = reader.ReadInt32();
                    break;

                case DataType.Varchar:
                    Data[i] = new FdbString(reader);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }