📄 zip.cpp
字号:
// Zip.cpp: implementation of the CZip class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Note.h"
#include "Zip.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CZip::CZip(CString strInputFile)
{
m_strFileName=strInputFile;
ASSERT(!m_strFileName.IsEmpty());
}
CZip::~CZip()
{
}
void CZip::SwapSize(CString strOutputFile)
{
ASSERT(!strOutputFile.IsEmpty());
ASSERT(strOutputFile.CompareNoCase(m_strFileName));
CZipFile zf(strOutputFile, 0);
char buf[BUF_SIZE];
CFile file(m_strFileName, CFile::modeRead);
zip_fileinfo zi;
zf.UpdateZipInfo(zi, file);
zf.OpenNewFileInZip(m_strFileName, zi, Z_BEST_COMPRESSION);
int size_read;
do
{
size_read = file.Read(buf, BUF_SIZE);
if (size_read)
zf.WriteInFileInZip(buf, size_read);
}
while (size_read == BUF_SIZE);
zf.Close();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -