summaryrefslogtreecommitdiff
path: root/src/inc/fstream.h
diff options
context:
space:
mode:
authorJiyoung Yun <jy910.yun@samsung.com>2016-11-23 10:09:09 (GMT)
committerJiyoung Yun <jy910.yun@samsung.com>2016-11-23 10:09:09 (GMT)
commit4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (patch)
tree98110734c91668dfdbb126fcc0e15ddbd93738ca /src/inc/fstream.h
parentfa45f57ed55137c75ac870356a1b8f76c84b229c (diff)
downloadcoreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.zip
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.gz
coreclr-4b4aad7217d3292650e77eec2cf4c198ea9c3b4b.tar.bz2
Imported Upstream version 1.1.0upstream/1.1.0
Diffstat (limited to 'src/inc/fstream.h')
-rw-r--r--src/inc/fstream.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/inc/fstream.h b/src/inc/fstream.h
new file mode 100644
index 0000000..aa81ec8
--- /dev/null
+++ b/src/inc/fstream.h
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+
+#ifndef __FSTREAM_H_INCLUDED__
+#define __FSTREAM_H_INCLUDED__
+
+#include <objidl.h>
+
+class CFileStream : public IStream
+{
+ public:
+ CFileStream();
+ virtual ~CFileStream();
+
+ HRESULT OpenForRead(LPCWSTR wzFilePath);
+ HRESULT OpenForWrite(LPCWSTR wzFilePath);
+
+ // IUnknown methods:
+ STDMETHODIMP_(ULONG) AddRef();
+ STDMETHODIMP_(ULONG) Release();
+ STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj);
+
+ // ISequentialStream methods:
+ STDMETHODIMP Read(void *pv, ULONG cb, ULONG *pcbRead);
+ STDMETHODIMP Write(void const *pv, ULONG cb, ULONG *pcbWritten);
+
+ // IStream methods:
+ STDMETHODIMP Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);
+ STDMETHODIMP SetSize(ULARGE_INTEGER libNewSize);
+ STDMETHODIMP CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);
+ STDMETHODIMP Commit(DWORD grfCommitFlags);
+ STDMETHODIMP Revert();
+ STDMETHODIMP LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
+ STDMETHODIMP UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);
+ STDMETHODIMP Stat(STATSTG *pstatstg, DWORD grfStatFlag);
+ STDMETHODIMP Clone(IStream **ppIStream);
+
+ private:
+ BOOL Close();
+
+ private:
+ LONG _cRef;
+ HANDLE _hFile;
+
+};
+
+#endif
+