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

Unified Diff: third_party/lzma/v4_65/files/CPP/7zip/Common/StreamObjects.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 side-by-side diff with in-line comments
Download patch
Index: third_party/lzma/v4_65/files/CPP/7zip/Common/StreamObjects.cpp
diff --git a/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamObjects.cpp b/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamObjects.cpp
deleted file mode 100644
index e043e5652eb35214c1d4cd27e4d0ce10f1cb4182..0000000000000000000000000000000000000000
--- a/third_party/lzma/v4_65/files/CPP/7zip/Common/StreamObjects.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// StreamObjects.cpp
-
-#include "StdAfx.h"
-
-#include "StreamObjects.h"
-#include "../../Common/Defs.h"
-
-
-STDMETHODIMP CSequentialInStreamImp::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- size_t rem = _size - _pos;
- if (size < rem)
- rem = (size_t)size;
- memcpy(data, _dataPointer + _pos, rem);
- _pos += rem;
- if (processedSize != NULL)
- *processedSize = (UInt32)rem;
- return S_OK;
-}
-
-
-void CWriteBuffer::Write(const void *data, size_t size)
-{
- size_t newCapacity = _size + size;
- _buffer.EnsureCapacity(newCapacity);
- memcpy(_buffer + _size, data, size);
- _size += size;
-}
-
-STDMETHODIMP CSequentialOutStreamImp::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- _writeBuffer.Write(data, (size_t)size);
- if(processedSize != NULL)
- *processedSize = size;
- return S_OK;
-}
-
-STDMETHODIMP CSequentialOutStreamImp2::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- size_t rem = _size - _pos;
- if (size < rem)
- rem = (size_t)size;
- memcpy(_buffer + _pos, data, rem);
- _pos += rem;
- if (processedSize != NULL)
- *processedSize = (UInt32)rem;
- return (rem == size ? S_OK : E_FAIL);
-}
-
-STDMETHODIMP CSequentialInStreamSizeCount::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result = _stream->Read(data, size, &realProcessedSize);
- _size += realProcessedSize;
- if (processedSize != 0)
- *processedSize = realProcessedSize;
- return result;
-}
-
-STDMETHODIMP CSequentialOutStreamSizeCount::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result = _stream->Write(data, size, &realProcessedSize);
- _size += realProcessedSize;
- if (processedSize != 0)
- *processedSize = realProcessedSize;
- return result;
-}

Powered by Google App Engine
This is Rietveld 408576698