示例#1
0
        /// <summary>
        /// Advances the enumerator to the next element of the collection
        /// </summary>
        /// <summary>Sets <see cref="_currentZipEntry"/> to the next zip entry</summary>
        /// <returns>true if the next entry is not null, otherwise false</returns>
        private bool MoveNext()
        {
            int result;

            if (_currentZipEntry == null)
            {
                result = ZlibWrapper.ZlibUnzGoToFirstFile(_zipFileHandle);
            }
            else
            {
                CloseCurrentEntry();
                result = ZlibWrapper.ZlibUnzGoToNextFile(_zipFileHandle);
            }

            if (result == ZipReturnCode.EndOfListOfFile)
            {
                // No more entries
                _currentZipEntry = null;
            }
            else if (result < 0)
            {
                throw new ZipException("MoveNext failed.", result);
            }
            else
            {
                // Entry found,m open it
                OpenCurrentEntry();
            }

            return(_currentZipEntry != null);
        }