コード例 #1
0
ファイル: PathTable.cs プロジェクト: marinehero/ThinkAway.net
        internal override void PrepareForRead()
        {
            _readCache = new byte[Length];
            int pos = 0;

            List<BuildDirectoryInfo> sortedList = new List<BuildDirectoryInfo>(_dirs);
            sortedList.Sort(BuildDirectoryInfo.PathTableSortComparison);

            Dictionary<BuildDirectoryInfo, ushort> dirNumbers = new Dictionary<BuildDirectoryInfo, ushort>(_dirs.Count);
            ushort i = 1;
            foreach (BuildDirectoryInfo di in sortedList)
            {
                dirNumbers[di] = i++;
                PathTableRecord ptr = new PathTableRecord();
                ptr.DirectoryIdentifier = di.PickName(null, _enc);
                ptr.LocationOfExtent = _locations[di];
                ptr.ParentDirectoryNumber = dirNumbers[di.Parent];

                pos += ptr.Write(_byteSwap, _enc, _readCache, pos);
            }
        }
コード例 #2
0
ファイル: PathTable.cs プロジェクト: ibeae/ThinkAway.net
        internal override void PrepareForRead()
        {
            _readCache = new byte[Length];
            int pos = 0;

            List <BuildDirectoryInfo> sortedList = new List <BuildDirectoryInfo>(_dirs);

            sortedList.Sort(BuildDirectoryInfo.PathTableSortComparison);

            Dictionary <BuildDirectoryInfo, ushort> dirNumbers = new Dictionary <BuildDirectoryInfo, ushort>(_dirs.Count);
            ushort i = 1;

            foreach (BuildDirectoryInfo di in sortedList)
            {
                dirNumbers[di] = i++;
                PathTableRecord ptr = new PathTableRecord();
                ptr.DirectoryIdentifier   = di.PickName(null, _enc);
                ptr.LocationOfExtent      = _locations[di];
                ptr.ParentDirectoryNumber = dirNumbers[di.Parent];

                pos += ptr.Write(_byteSwap, _enc, _readCache, pos);
            }
        }