MCPcopy Create free account
hub / github.com/bodgit/sevenzip / FileFolderAndSize

Method FileFolderAndSize

struct.go:213–244  ·  view source on GitHub ↗
(file int)

Source from the content-addressed store, hash-verified

211}
212
213func (si *streamsInfo) FileFolderAndSize(file int) (int, uint64, uint32) {
214 var (
215 folder int
216 streams uint64 = 1
217 crc uint32
218 )
219
220 if si.subStreamsInfo != nil {
221 total := uint64(0)
222
223 for folder, streams = range si.subStreamsInfo.streams {
224 total += streams
225 if uint64(file) < total { //nolint:gosec
226 break
227 }
228 }
229
230 if len(si.subStreamsInfo.digest) > 0 {
231 crc = si.subStreamsInfo.digest[file]
232 }
233 }
234
235 if streams == 1 {
236 if len(si.unpackInfo.digest) > 0 {
237 crc = si.unpackInfo.digest[folder]
238 }
239
240 return folder, si.unpackInfo.folder[folder].size[len(si.unpackInfo.folder[folder].coder)-1], crc
241 }
242
243 return folder, si.subStreamsInfo.size[file], crc
244}
245
246func (si *streamsInfo) folderOffset(folder int) int64 {
247 offset := uint64(0)

Callers 2

readHeaderFunction · 0.80
initMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected