Lines Matching refs:de
526 @safe void addMember(ArchiveMember de) in addMember() argument
528 _directory[de.name] = de; in addMember()
529 if (!de._compressedData.length) in addMember()
531 switch (de.compressionMethod) in addMember()
534 de._compressedData = de._expandedData; in addMember()
541 de._compressedData = cast(ubyte[]) compress(cast(void[]) de._expandedData); in addMember()
543 de._compressedData = de._compressedData[2 .. de._compressedData.length - 4]; in addMember()
550 de._compressedSize = to!uint(de._compressedData.length); in addMember()
552 () @trusted { de._crc32 = crc32(0, cast(void[]) de._expandedData); }(); in addMember()
554 … assert(de._compressedData.length == de._compressedSize, "Archive member compressed failed."); in addMember()
576 @safe void deleteMember(ArchiveMember de) in deleteMember() argument
578 _directory.remove(de.name); in deleteMember()
625 foreach (ArchiveMember de; directory) in build()
627 enforce!ZipException(to!ulong(archiveSize) + localFileHeaderLength + de.name.length in build()
628 + de.extra.length + de.compressedSize + directorySize in build()
629 + centralFileHeaderLength + de.name.length + de.extra.length in build()
630 + de.comment.length + endOfCentralDirLength + comment.length in build()
634 archiveSize += localFileHeaderLength + de.name.length + in build()
635 de.extra.length + in build()
636 de.compressedSize; in build()
637 directorySize += centralFileHeaderLength + de.name.length + in build()
638 de.extra.length + in build()
639 de.comment.length; in build()
654 foreach (ArchiveMember de; directory) in build()
656 de.offset = i; in build()
658 putUshort(i + 4, de.extractVersion); in build()
659 putUshort(i + 6, de.flags); in build()
660 putUshort(i + 8, de._compressionMethod); in build()
661 putUint (i + 10, cast(uint) de.time); in build()
662 putUint (i + 14, de.crc32); in build()
663 putUint (i + 18, de.compressedSize); in build()
664 putUint (i + 22, to!uint(de.expandedSize)); in build()
665 putUshort(i + 26, cast(ushort) de.name.length); in build()
666 putUshort(i + 28, cast(ushort) de.extra.length); in build()
669 _data[i .. i + de.name.length] = (de.name.representation)[]; in build()
670 i += de.name.length; in build()
671 _data[i .. i + de.extra.length] = (cast(ubyte[]) de.extra)[]; in build()
672 i += de.extra.length; in build()
673 _data[i .. i + de.compressedSize] = de.compressedData[]; in build()
674 i += de.compressedSize; in build()
679 foreach (ArchiveMember de; directory) in build()
682 putUshort(i + 4, de._madeVersion); in build()
683 putUshort(i + 6, de.extractVersion); in build()
684 putUshort(i + 8, de.flags); in build()
685 putUshort(i + 10, de._compressionMethod); in build()
686 putUint (i + 12, cast(uint) de.time); in build()
687 putUint (i + 16, de.crc32); in build()
688 putUint (i + 20, de.compressedSize); in build()
689 putUint (i + 24, de.expandedSize); in build()
690 putUshort(i + 28, cast(ushort) de.name.length); in build()
691 putUshort(i + 30, cast(ushort) de.extra.length); in build()
692 putUshort(i + 32, cast(ushort) de.comment.length); in build()
694 putUshort(i + 36, de.internalAttributes); in build()
695 putUint (i + 38, de._externalAttributes); in build()
696 putUint (i + 42, de.offset); in build()
699 _data[i .. i + de.name.length] = (de.name.representation)[]; in build()
700 i += de.name.length; in build()
701 _data[i .. i + de.extra.length] = (cast(ubyte[]) de.extra)[]; in build()
702 i += de.extra.length; in build()
703 _data[i .. i + de.comment.length] = (de.comment.representation)[]; in build()
704 i += de.comment.length; in build()
877 ArchiveMember de = new ArchiveMember(); in this() local
878 de._index = n; in this()
879 de._madeVersion = getUshort(i + 4); in this()
880 de._extractVersion = getUshort(i + 6); in this()
881 de.flags = getUshort(i + 8); in this()
882 de._compressionMethod = cast(CompressionMethod) getUshort(i + 10); in this()
883 de.time = cast(DosFileTime) getUint(i + 12); in this()
884 de._crc32 = getUint(i + 16); in this()
885 de._compressedSize = getUint(i + 20); in this()
886 de._expandedSize = getUint(i + 24); in this()
890 de.internalAttributes = getUshort(i + 36); in this()
891 de._externalAttributes = getUint(i + 38); in this()
892 de.offset = getUint(i + 42); in this()
902 de.name = cast(string)(_data[i .. i + namelen]); in this()
904 de.extra = _data[i .. i + extralen]; in this()
906 de.comment = cast(string)(_data[i .. i + commentlen]); in this()
909 auto localFileHeaderNamelen = getUshort(de.offset + 26); in this()
910 auto localFileHeaderExtralen = getUshort(de.offset + 28); in this()
913 removeSegment(de.offset, de.offset + localFileHeaderLength + localFileHeaderNamelen in this()
914 + localFileHeaderExtralen + de._compressedSize); in this()
916 immutable uint dataOffset = de.offset + localFileHeaderLength in this()
918 de._compressedData = _data[dataOffset .. dataOffset + de.compressedSize]; in this()
920 _directory[de.name] = de; in this()
1182 ubyte[] expand(ArchiveMember de) in expand() argument
1189 enforce!ZipException(_data[de.offset .. de.offset + 4] == localFileHeaderSignature, in expand()
1193 de._extractVersion = getUshort(de.offset + 4); in expand()
1194 de.flags = getUshort(de.offset + 6); in expand()
1195 de._compressionMethod = cast(CompressionMethod) getUshort(de.offset + 8); in expand()
1196 de.time = cast(DosFileTime) getUint(de.offset + 10); in expand()
1197 de._crc32 = getUint(de.offset + 14); in expand()
1198 de._compressedSize = max(getUint(de.offset + 18), de.compressedSize); in expand()
1199 de._expandedSize = max(getUint(de.offset + 22), de.expandedSize); in expand()
1200 namelen = getUshort(de.offset + 26); in expand()
1201 extralen = getUshort(de.offset + 28); in expand()
1205 printf("\t\texpandedSize = %d\n", de.expandedSize); in expand()
1206 printf("\t\tcompressedSize = %d\n", de.compressedSize); in expand()
1211 enforce!ZipException((de.flags & 1) == 0, "encryption not supported"); in expand()
1213 switch (de.compressionMethod) in expand()
1216 de._expandedData = de.compressedData; in expand()
1217 return de.expandedData; in expand()
1224 … de._expandedData = cast(ubyte[]) uncompress(cast(void[]) de.compressedData, de.expandedSize, -15); in expand()
1225 return de.expandedData; in expand()