Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: third_party/lzma/v4_65/files/CPP/7zip/Common/OffsetStream.cpp

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // OffsetStream.cpp
2
3 #include "StdAfx.h"
4
5 #include "Common/Defs.h"
6 #include "OffsetStream.h"
7
8 HRESULT COffsetOutStream::Init(IOutStream *stream, UInt64 offset)
9 {
10 _offset = offset;
11 _stream = stream;
12 return _stream->Seek(offset, STREAM_SEEK_SET, NULL);
13 }
14
15 STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *proc essedSize)
16 {
17 return _stream->Write(data, size, processedSize);
18 }
19
20 STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin,
21 UInt64 *newPosition)
22 {
23 UInt64 absoluteNewPosition;
24 if (seekOrigin == STREAM_SEEK_SET)
25 offset += _offset;
26 HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
27 if (newPosition != NULL)
28 *newPosition = absoluteNewPosition - _offset;
29 return result;
30 }
31
32 STDMETHODIMP COffsetOutStream::SetSize(Int64 newSize)
33 {
34 return _stream->SetSize(_offset + newSize);
35 }
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/7zip/Common/OffsetStream.h ('k') | third_party/lzma/v4_65/files/CPP/7zip/Common/OutBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698