| 115 | } |
| 116 | |
| 117 | void TCascFile::InitFileSpans(PCASC_FILE_SPAN pSpans, DWORD dwSpanCount) |
| 118 | { |
| 119 | ULONGLONG FileOffsetBits = 30; |
| 120 | ULONGLONG FileOffsetMask = 0; |
| 121 | ULONGLONG FileOffset = 0; |
| 122 | |
| 123 | // Initialize the file sizes. Note that if any of the spans has invalid size, |
| 124 | // the entire file size will be set to CASC_INVALID_SIZE64. |
| 125 | GetFileSpanInfo(pCKeyEntry, &ContentSize, &EncodedSize); |
| 126 | |
| 127 | // Resolve the file offset bits and file offset mask |
| 128 | if(hs != NULL) |
| 129 | FileOffsetBits = hs->FileOffsetBits; |
| 130 | FileOffsetMask = ((ULONGLONG)1 << FileOffsetBits) - 1; |
| 131 | |
| 132 | // Add all span sizes |
| 133 | for(DWORD i = 0; i < dwSpanCount; i++, pSpans++) |
| 134 | { |
| 135 | // Put the archive index and archive offset |
| 136 | pSpans->ArchiveIndex = (DWORD)(pCKeyEntry[i].StorageOffset >> FileOffsetBits); |
| 137 | pSpans->ArchiveOffs = (DWORD)(pCKeyEntry[i].StorageOffset & FileOffsetMask); |
| 138 | |
| 139 | // Add to the total encoded size |
| 140 | if(ContentSize != CASC_INVALID_SIZE64) |
| 141 | { |
| 142 | pSpans->StartOffset = FileOffset; |
| 143 | FileOffset = FileOffset + pCKeyEntry[i].ContentSize; |
| 144 | pSpans->EndOffset = FileOffset; |
| 145 | } |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | void TCascFile::InitCacheStrategy() |
| 150 | { |
nothing calls this directly
no test coverage detected