static public Entry CreateEntry(ReaderBin reader)
        {
            Entry entry     = null;
            byte  entryType = reader.ReadByte();

            switch (entryType)
            {
            case 69:     // 'E'
                entry = new EmptyEntry();
                break;

            case 98:     // 'b'
                entry = new ByteEntry(reader);
                break;

            case 66:     // 'B'
                entry = new BooleanEntry(reader);
                break;

            case 73:     // 'I'
                entry = new IntegerEntry(reader);
                break;

            case 83:     // 'S'
                entry = new StringEntry(reader);
                break;

            default:     //Unknown
                throw new CGTStructureException("No se sabe el tipo");
            }
            return(entry);
        }
示例#2
0
        private Record ReadRecord(ReaderBin reader)
        {
            Record record        = new Record();
            byte   entriesHeader = reader.ReadByte();

            if (entriesHeader != 77)
            {
                throw new CGTStructureException("Invalid entries header at byte " + (stream.Position - 1));
            }
            ushort entriesCount = reader.ReadUInt16();

            for (int i = 0; i < entriesCount; i++)
            {
                record.Entries.Add(ReadEntry(reader));
            }
            return(record);
        }
示例#3
0
 public ByteEntry(ReaderBin reader)
 {
     value = reader.ReadByte();
 }