コード例 #1
0
        public PeRecordReader GetReader(string key)
        {
            if (mIndexFile == null)
            {
                return(null);
            }

            ArchiveIndex index = mIndexFile.GetArchiveIndex(key);

            if (null == index)
            {
                return(null);
            }

            string fileDir;

            if (index.yird)
            {
                if (string.IsNullOrEmpty(mIndexFile.yirdName))
                {
                    Debug.LogError("yird name is empty or null");
                    return(null);
                }

                fileDir = mIndexFile.GetYirdDir(dir);
            }
            else
            {
                fileDir = dir;
            }

            return(new PeRecordReader(index, fileDir, mIndexFile.header));
        }
コード例 #2
0
        static void CopyIndex(ArchiveIndexFile indexFile, ArchiveIndexFile oldIndexFile, ArchiveObj serializeObj)
        {
            if (oldIndexFile == null)
            {
                return;
            }

            serializeObj.Foreach((obj) =>
            {
                Profiler.BeginSample("only copy index:" + obj.key);

                ArchiveIndex index = oldIndexFile.GetArchiveIndex(obj.key);
                if (index != null)
                {
                    indexFile.Add(obj.key, index);
                }

                Profiler.EndSample();
            });
        }