summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/Common/StreamUtils.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lzma/CPP/7zip/Common/StreamUtils.h')
-rw-r--r--3rdparty/lzma/CPP/7zip/Common/StreamUtils.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/3rdparty/lzma/CPP/7zip/Common/StreamUtils.h b/3rdparty/lzma/CPP/7zip/Common/StreamUtils.h
index ae914c004b0..35a62ed3e95 100644
--- a/3rdparty/lzma/CPP/7zip/Common/StreamUtils.h
+++ b/3rdparty/lzma/CPP/7zip/Common/StreamUtils.h
@@ -1,10 +1,28 @@
// StreamUtils.h
-#ifndef __STREAM_UTILS_H
-#define __STREAM_UTILS_H
+#ifndef ZIP7_INC_STREAM_UTILS_H
+#define ZIP7_INC_STREAM_UTILS_H
#include "../IStream.h"
+inline HRESULT InStream_SeekSet(IInStream *stream, UInt64 offset) throw()
+ { return stream->Seek((Int64)offset, STREAM_SEEK_SET, NULL); }
+inline HRESULT InStream_GetPos(IInStream *stream, UInt64 &curPosRes) throw()
+ { return stream->Seek(0, STREAM_SEEK_CUR, &curPosRes); }
+inline HRESULT InStream_GetSize_SeekToEnd(IInStream *stream, UInt64 &sizeRes) throw()
+ { return stream->Seek(0, STREAM_SEEK_END, &sizeRes); }
+
+HRESULT InStream_SeekToBegin(IInStream *stream) throw();
+HRESULT InStream_AtBegin_GetSize(IInStream *stream, UInt64 &size) throw();
+HRESULT InStream_GetPos_GetSize(IInStream *stream, UInt64 &curPosRes, UInt64 &sizeRes) throw();
+
+inline HRESULT InStream_GetSize_SeekToBegin(IInStream *stream, UInt64 &sizeRes) throw()
+{
+ RINOK(InStream_SeekToBegin(stream))
+ return InStream_AtBegin_GetSize(stream, sizeRes);
+}
+
+
HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size) throw();
HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw();
HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw();