SeekOffset Slice::seek(SeekOffset off, SeekType type)
{
- if(type==S_BEG)
- off += start_offset;
- else if(type==S_CUR)
+ off += start_offset;
+ if(type==S_CUR)
off += position;
else if(type==S_END)
- off += start_offset+length;
+ off += length;
+ else if(type!=S_BEG)
+ throw invalid_argument("Slice::seek");
if(off<start_offset || off>start_offset+length)
throw bad_seek(off, type);