Esempio n. 1
0
        void ReadAll() {
            if (!CheckSignature(_input))
                throw new RapFormatException("Attempt to read a rap file with an invalid signature");
            //skip signature since CheckSignature helpfully rewinds
            _input.Seek(4, SeekOrigin.Current);
            //skip reserved bytes
            _input.Seek(6, SeekOrigin.Current);
            //skip first entryType
            _input.Seek(1, SeekOrigin.Current);
            //skip null classname
            BinaryFile.ReadString(_input);
            //skip enum offset
            var enumOffset = BinaryFile.ReadUInt32(_input);

            //now we are at the actual list of classes so start reading

            var c = ReadClassBody("", _input.Position);
            Root = new ConfigFile(c);

            //finally read the enums if present and add them to the Root
            if (enumOffset != 0) {
                var enums = ReadEnums(enumOffset);
                if (enums != null)
                    Root.Add(enums);
            }
        }