| 167 | |
| 168 | |
| 169 | bool QuickOpen::Seek(int64 Offset,int Method) |
| 170 | { |
| 171 | if (!Loaded) |
| 172 | return false; |
| 173 | |
| 174 | // Normally we process an archive sequentially from beginning to end, |
| 175 | // so we read quick open data sequentially. But some operations like |
| 176 | // archive updating involve several passes. So if we detect that file |
| 177 | // pointer is moved back, we reload quick open data from beginning. |
| 178 | if (Method==SEEK_SET && (uint64)Offset<SeekPos && (uint64)Offset<LastReadHeaderPos) |
| 179 | Load(QOHeaderPos); |
| 180 | |
| 181 | if (Method==SEEK_SET) |
| 182 | SeekPos=Offset; |
| 183 | if (Method==SEEK_CUR) |
| 184 | SeekPos+=Offset; |
| 185 | UnsyncSeekPos=true; |
| 186 | |
| 187 | if (Method==SEEK_END) |
| 188 | { |
| 189 | Arc->File::Seek(Offset,SEEK_END); |
| 190 | SeekPos=Arc->File::Tell(); |
| 191 | UnsyncSeekPos=false; |
| 192 | } |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | |
| 197 | bool QuickOpen::Tell(int64 *Pos) |
no outgoing calls
no test coverage detected