This commit is contained in:
Igor Pavlov
2005-05-30 00:00:00 +00:00
committed by Kornel Lesiński
parent 8c1b5c7b7e
commit 3c510ba80b
926 changed files with 40559 additions and 23519 deletions

View File

@@ -113,6 +113,18 @@ SOURCE=.\StdAfx.cpp
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Common"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\..\Common\Alloc.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\Alloc.h
# End Source File
# End Group
# Begin Source File
SOURCE=.\CopyCoder.cpp

View File

@@ -3,32 +3,38 @@
#include "StdAfx.h"
#include "CopyCoder.h"
#include "../../../Common/Alloc.h"
namespace NCompress {
static const UINT32 kBufferSize = 1 << 17;
CCopyCoder::CCopyCoder():
TotalSize(0)
{
_buffer = new BYTE[kBufferSize];
}
static const UInt32 kBufferSize = 1 << 17;
CCopyCoder::~CCopyCoder()
{
delete []_buffer;
BigFree(_buffer);
}
STDMETHODIMP CCopyCoder::Code(ISequentialInStream *inStream,
ISequentialOutStream *outStream,
const UINT64 *inSize, const UINT64 *outSize,
const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress)
{
if (_buffer == 0)
{
_buffer = (Byte *)BigAlloc(kBufferSize);
if (_buffer == 0)
return E_OUTOFMEMORY;
}
TotalSize = 0;
while(true)
{
UINT32 realProcessedSize;
RINOK(inStream->ReadPart(_buffer, kBufferSize, &realProcessedSize));
UInt32 realProcessedSize;
UInt32 size = kBufferSize;
if (outSize != 0)
if (size > *outSize - TotalSize)
size = (UInt32)(*outSize - TotalSize);
RINOK(inStream->ReadPart(_buffer, size, &realProcessedSize));
if(realProcessedSize == 0)
break;
RINOK(outStream->Write(_buffer, realProcessedSize, NULL));

View File

@@ -1,31 +1,28 @@
// Compress/CopyCoder.h
// #pragma once
#ifndef __COMPRESS_COPYCODER_H
#define __COMPRESS_COPYCODER_H
#include "../../ICoder.h"
#include "../../../Common/MyCom.h"
namespace NCompress {
class CCopyCoder:
public ICompressCoder,
public CMyUnknownImp
{
BYTE *_buffer;
Byte *_buffer;
public:
UINT64 TotalSize;
CCopyCoder();
UInt64 TotalSize;
CCopyCoder(): TotalSize(0) , _buffer(0) {};
~CCopyCoder();
MY_UNKNOWN_IMP
STDMETHOD(Code)(ISequentialInStream *inStream,
ISequentialOutStream *outStream,
const UINT64 *inSize, const UINT64 *outSize,
const UInt64 *inSize, const UInt64 *outSize,
ICompressProgressInfo *progress);
};

View File

@@ -2,10 +2,10 @@
#include "StdAfx.h"
#include <initguid.h>
#include "../../../Common/MyInitGuid.h"
#include "../../../Common/ComTry.h"
#include "CopyCoder.h"
#include "../../../Common/ComTry.h"
// {23170F69-40C1-278B-0000-000000000000}
DEFINE_GUID(CLSID_CCompressCopyCoder,

View File

@@ -1,3 +1,3 @@
// StdAfx.cpp
#include "stdafx.h"
#include "StdAfx.h"

View File

@@ -1,8 +1,8 @@
// stdafx.h
// StdAfx.h
#ifndef __STDAFX_H
#define __STDAFX_H
#include <windows.h>
#include "../../../Common/MyWindows.h"
#endif
#endif

View File

@@ -66,8 +66,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,8,1,0
PRODUCTVERSION 3,8,1,0
FILEVERSION 4,7,0,0
PRODUCTVERSION 4,7,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -85,14 +85,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov\0"
VALUE "FileDescription", "Copy Coder\0"
VALUE "FileVersion", "3, 8, 1, 0\0"
VALUE "FileVersion", "4, 7, 0, 0\0"
VALUE "InternalName", "Copy\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2003 Igor Pavlov\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2004 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "Copy.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "3, 8, 1, 0\0"
VALUE "ProductVersion", "4, 7, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END