diff options
Diffstat (limited to 'CPP/7zip/Common/StreamUtils.h')
-rw-r--r-- | CPP/7zip/Common/StreamUtils.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/CPP/7zip/Common/StreamUtils.h b/CPP/7zip/Common/StreamUtils.h index ae914c0..35a62ed 100644 --- a/CPP/7zip/Common/StreamUtils.h +++ b/CPP/7zip/Common/StreamUtils.h | |||
@@ -1,10 +1,28 @@ | |||
1 | // StreamUtils.h | 1 | // StreamUtils.h |
2 | 2 | ||
3 | #ifndef __STREAM_UTILS_H | 3 | #ifndef ZIP7_INC_STREAM_UTILS_H |
4 | #define __STREAM_UTILS_H | 4 | #define ZIP7_INC_STREAM_UTILS_H |
5 | 5 | ||
6 | #include "../IStream.h" | 6 | #include "../IStream.h" |
7 | 7 | ||
8 | inline HRESULT InStream_SeekSet(IInStream *stream, UInt64 offset) throw() | ||
9 | { return stream->Seek((Int64)offset, STREAM_SEEK_SET, NULL); } | ||
10 | inline HRESULT InStream_GetPos(IInStream *stream, UInt64 &curPosRes) throw() | ||
11 | { return stream->Seek(0, STREAM_SEEK_CUR, &curPosRes); } | ||
12 | inline HRESULT InStream_GetSize_SeekToEnd(IInStream *stream, UInt64 &sizeRes) throw() | ||
13 | { return stream->Seek(0, STREAM_SEEK_END, &sizeRes); } | ||
14 | |||
15 | HRESULT InStream_SeekToBegin(IInStream *stream) throw(); | ||
16 | HRESULT InStream_AtBegin_GetSize(IInStream *stream, UInt64 &size) throw(); | ||
17 | HRESULT InStream_GetPos_GetSize(IInStream *stream, UInt64 &curPosRes, UInt64 &sizeRes) throw(); | ||
18 | |||
19 | inline HRESULT InStream_GetSize_SeekToBegin(IInStream *stream, UInt64 &sizeRes) throw() | ||
20 | { | ||
21 | RINOK(InStream_SeekToBegin(stream)) | ||
22 | return InStream_AtBegin_GetSize(stream, sizeRes); | ||
23 | } | ||
24 | |||
25 | |||
8 | HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size) throw(); | 26 | HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size) throw(); |
9 | HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw(); | 27 | HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw(); |
10 | HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw(); | 28 | HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw(); |