This commit is contained in:
Igor Pavlov
2003-12-11 00:00:00 +00:00
committed by Kornel Lesiński
commit 8c1b5c7b7e
982 changed files with 118799 additions and 0 deletions

55
7zip/Common/FileStreams.h Executable file
View File

@@ -0,0 +1,55 @@
// FileStreams.h
#pragma once
#ifndef __FILESTREAMS_H
#define __FILESTREAMS_H
#include "Windows/FileIO.h"
#include "../IStream.h"
#include "Common/MyCom.h"
class CInFileStream:
public IInStream,
public IStreamGetSize,
public CMyUnknownImp
{
public:
NWindows::NFile::NIO::CInFile File;
CInFileStream() {}
bool Open(LPCTSTR fileName);
#ifndef _UNICODE
bool Open(LPCWSTR fileName);
#endif
MY_UNKNOWN_IMP1(IStreamGetSize)
STDMETHOD(Read)(void *data, UINT32 size, UINT32 *processedSize);
STDMETHOD(ReadPart)(void *data, UINT32 size, UINT32 *processedSize);
STDMETHOD(Seek)(INT64 offset, UINT32 seekOrigin, UINT64 *newPosition);
STDMETHOD(GetSize)(UINT64 *size);
};
class COutFileStream:
public IOutStream,
public CMyUnknownImp
{
public:
NWindows::NFile::NIO::COutFile File;
COutFileStream() {}
bool Open(LPCTSTR fileName);
#ifndef _UNICODE
bool Open(LPCWSTR fileName);
#endif
MY_UNKNOWN_IMP
STDMETHOD(Write)(const void *data, UINT32 size, UINT32 *processedSize);
STDMETHOD(WritePart)(const void *data, UINT32 size, UINT32 *processedSize);
STDMETHOD(Seek)(INT64 offset, UINT32 seekOrigin, UINT64 *newPosition);
STDMETHOD(SetSize)(INT64 newSize);
};
#endif