3 #ifndef __FILESTREAMS_H
4 #define __FILESTREAMS_H
7 #include "../../Windows/FileIO.h"
9 #include "../../Common/C_FileIO.h"
12 #include "../IStream.h"
13 #include "../../Common/MyCom.h"
17 public IStreamGetSize
,
22 NWindows::NFile::NIO::CInFile File
;
24 NC::NFile::NIO::CInFile File
;
27 virtual ~CInFileStream() {}
29 bool Open(LPCTSTR fileName
);
32 bool Open(LPCWSTR fileName
);
36 MY_UNKNOWN_IMP2(IInStream
, IStreamGetSize
)
38 STDMETHOD(Read
)(void *data
, UInt32 size
, UInt32
*processedSize
);
39 STDMETHOD(Seek
)(Int64 offset
, UInt32 seekOrigin
, UInt64
*newPosition
);
41 STDMETHOD(GetSize
)(UInt64
*size
);
45 class CStdInFileStream
:
46 public ISequentialInStream
,
51 // CStdInFileStream() File(INVALID_HANDLE_VALUE): {}
52 // void Open() { File = GetStdHandle(STD_INPUT_HANDLE); };
55 virtual ~CStdInFileStream() {}
56 STDMETHOD(Read
)(void *data
, UInt32 size
, UInt32
*processedSize
);
66 NWindows::NFile::NIO::COutFile File
;
68 NC::NFile::NIO::COutFile File
;
70 virtual ~COutFileStream() {}
71 bool Create(LPCTSTR fileName
, bool createAlways
);
74 bool Create(LPCWSTR fileName
, bool createAlways
);
78 MY_UNKNOWN_IMP1(IOutStream
)
80 STDMETHOD(Write
)(const void *data
, UInt32 size
, UInt32
*processedSize
);
81 STDMETHOD(Seek
)(Int64 offset
, UInt32 seekOrigin
, UInt64
*newPosition
);
82 STDMETHOD(SetSize
)(Int64 newSize
);
86 class CStdOutFileStream
:
87 public ISequentialOutStream
,
93 virtual ~CStdOutFileStream() {}
94 STDMETHOD(Write
)(const void *data
, UInt32 size
, UInt32
*processedSize
);