Esempio n. 1
0
        void lee_atributos_de_entidad(FileStream f, BinaryReader r, Entidad ent)
        {
            Atributo nAtributo = new Atributo(nombreAtributo, ' ', -1, -1, -1, -1, -1);

            //Leer nombre de atributo
            for (int i = 0; i < nombreAtributo.Length; i++)
            {
                char car = r.ReadChar();
                nombreAtributo[i] = car;
            }

            char type    = r.ReadChar();
            int  lon     = r.ReadInt32();
            long posAt   = r.ReadInt64();
            int  index   = r.ReadInt32();
            long apIndx  = r.ReadInt64();
            long apSigAt = r.ReadInt64();

            nAtributo       = new Atributo(nombreAtributo, type, lon, posAt, index, apIndx, apSigAt);
            posicionMemoria = posicionMemoria + tamAtributo;

            ent.listaAtributos.Add(nAtributo);

            if (apSigAt != -2 && apSigAt != -4)
            {
                if (nAtributo.tipoDato == 'S')
                {
                    long bytes = nAtributo.longitudDato / 2;
                    tamDato += Convert.ToInt32(bytes);
                }
                else
                {
                    tamDato += Convert.ToInt32(nAtributo.longitudDato);
                }
            }

            nombreAtributo     = new char[30];
            nombreAtributo[29] = '\n';

            if (apSigAt != -1 && apSigAt != -4)
            {
                lee_atributos_de_entidad(f, r, ent);
            }
            // 77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777

            /*
             * for (int i = 0; i == listaEntidad[posEntidad].nombre.Length; i++)
             * {
             *  char car = reader.ReadChar();
             *  listaEntidad[posEntidad].nombre[i] = car;
             *
             * }
             *
             * long apAtr = reader.ReadInt64();
             * long apDt = reader.ReadInt64();
             * long posIn = reader.ReadInt64();
             * long apSigE = reader.ReadInt64();
             *
             * Entidad nEntidad = new Entidad(listaEntidad[posEntidad].nombre, apAtr, apDt, posIn, apSigE);
             *
             * posicionMemoria = posicionMemoria + tamEntidad;
             * //Verificar si la entidad tiene atributos
             *
             * if (nEntidad.DA != -1)
             * {
             *  tamDato = 16;
             *
             *  //lee_atributos_de_entidad(streamR, reader, nEntidad);
             * }
             *
             */
        }