Exemplo n.º 1
0
        private void ReadEntries()
        {
            uint entryDataStart = HeaderSize + _entryTableLength * EntrySize + _freeSpaceTableLength * FreeSpaceEntrySize;

            _entries = new List<XDBFEntry>();
            _stream.Position = EntryTableOffset;
            for (uint i = 0; i < _entryCount; i++)
            {
                XDBFEntry entry = new XDBFEntry(_stream, entryDataStart);
                _entries.Add(entry);
            }
        }
Exemplo n.º 2
0
        private void ReadSetting(XDBFEntry entry, BigEndianStream stream)
        {
            const long TypeOffset = 0x8;
            const long SettingHeaderSize = 0x10;

            stream.Position = entry.FileOffset;
            uint id = stream.ReadUInt32();
            stream.Position = entry.FileOffset + TypeOffset;
            GPDSettingType type = (GPDSettingType)stream.ReadByte();
            stream.Position = entry.FileOffset + SettingHeaderSize;

            GPDSetting setting;
            switch (type)
            {
                case GPDSettingType.Binary:
                    setting = new GPDBinarySetting(stream, id, type);
                    break;

                default:
                    setting = new GPDSetting(stream, id, type);
                    break;
            }
            _settings[id] = setting;
        }
Exemplo n.º 3
0
 private void ReadString(XDBFEntry entry, BigEndianStream stream)
 {
     stream.Position = entry.FileOffset;
     _strings[entry.ID] = stream.ReadUTF16();
 }
Exemplo n.º 4
0
        private void ProcessEntry(XDBF container, XDBFEntry entry, BigEndianStream stream)
        {
            // Skip over sync lists
            if (entry.ID > 0xFFFFFFFF)
                return;

            switch ((GPDNamespace)entry.Namespace)
            {
                case GPDNamespace.Setting:
                    ReadSetting(entry, stream);
                    break;

                case GPDNamespace.String:
                    ReadString(entry, stream);
                    break;
            }
        }