当前位置: 首页>>代码示例>>C#>>正文


C# FileSegmentGroup.OffsetToPointer方法代码示例

本文整理汇总了C#中Blamite.IO.FileSegmentGroup.OffsetToPointer方法的典型用法代码示例。如果您正苦于以下问题:C# FileSegmentGroup.OffsetToPointer方法的具体用法?C# FileSegmentGroup.OffsetToPointer怎么用?C# FileSegmentGroup.OffsetToPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Blamite.IO.FileSegmentGroup的用法示例。


在下文中一共展示了FileSegmentGroup.OffsetToPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Serialize

        /// <summary>
        /// Serializes the header's values, storing them into a StructureValueCollection.
        /// </summary>
        /// <param name="localeArea">The locale area of the cache file. Can be null.</param>
        /// <param name="localePointerMask">The value to add to locale pointers to translate them to file offsets.</param>
        /// <returns>The resulting StructureValueCollection.</returns>
        public StructureValueCollection Serialize(FileSegmentGroup localeArea)
        {
            StructureValueCollection values = new StructureValueCollection();

            values.SetInteger("file size", (uint)FileSize);
            values.SetInteger("type", (uint)Type);
            values.SetString("internal name", InternalName);
            values.SetString("scenario name", ScenarioName);
            values.SetInteger("xdk version", (uint)XDKVersion);

            AdjustPartitions();
            values.SetArray("partitions", SerializePartitions());

            if (_originalRawTableOffset != 0)
            {
                if (RawTable != null)
                    values.SetInteger("raw table offset", (uint)RawTable.Offset);

                if (localeArea != null)
                {
                    // I really don't know what these next two values are supposed to mean...anyone got anything?
                    values.SetInteger("eof index offset", localeArea.OffsetToPointer((int)FileSize)); // Reach, H4
                    values.SetInteger("eof index offset plus string data size", localeArea.OffsetToPointer((int)(FileSize + StringArea.Size))); // H3
                }
            }
            else
            {
                values.SetInteger("meta offset", (uint)MetaArea.Offset);
            }

            if (RawTable != null)
                values.SetInteger("raw table size", (uint)RawTable.Size);

            if (MetaArea != null)
            {
                values.SetInteger("virtual base address", MetaArea.BasePointer);
                values.SetInteger("index header address", IndexHeaderLocation.AsPointer());
                values.SetInteger("virtual size", (uint)MetaArea.Size);
            }

            if (StringBlockLocation != null)
                values.SetInteger("string block offset", (uint)StringBlockLocation.AsPointer());

            values.SetInteger("string table count", (uint)StringIDCount);
            if (StringIDData != null)
            {
                values.SetInteger("string table size", (uint)StringIDData.Size);
                values.SetInteger("string table offset", StringIDDataLocation.AsPointer());
            }

            if (StringIDIndexTableLocation != null)
                values.SetInteger("string index table offset", StringIDIndexTableLocation.AsPointer());

            if (StringArea != null)
            {
                values.SetInteger("string data size", (uint)StringArea.Size);
                values.SetInteger("string offset magic", StringArea.BasePointer);
            }

            values.SetInteger("file table count", (uint)FileNameCount);
            if (FileNameData != null)
            {
                values.SetInteger("file table offset", FileNameDataLocation.AsPointer());
                values.SetInteger("file table size", (uint)FileNameData.Size);
            }

            if (FileNameIndexTableLocation != null)
                values.SetInteger("file index table offset", FileNameIndexTableLocation.AsPointer());

            if (localeArea != null)
            {
                values.SetInteger("locale data index offset", localeArea.BasePointer);
                values.SetInteger("locale data size", (uint)localeArea.Size);
                values.SetInteger("locale offset magic", (uint)-localeArea.PointerMask);
            }

            if (UnknownTableLocation != null)
            {
                values.SetInteger("unknown table count", (uint)UnknownCount);
                values.SetInteger("unknown table offset", UnknownTableLocation.AsPointer());
            }
            return values;
        }
开发者ID:iBotPeaches,项目名称:Assembly,代码行数:89,代码来源:ThirdGenHeader.cs


注:本文中的Blamite.IO.FileSegmentGroup.OffsetToPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。