ezEngine  Milestone 7
FileReader.h
1 #pragma once
2 
3 #include <Foundation/IO/Stream.h>
4 #include <Foundation/IO/FileSystem/Implementation/FileReaderWriterBase.h>
5 #include <Foundation/Containers/DynamicArray.h>
6 
11 class EZ_FOUNDATION_DLL ezFileReader : public ezFileReaderBase
12 {
13  EZ_DISALLOW_COPY_AND_ASSIGN(ezFileReader);
14 
15 public:
16 
18  ezFileReader() : m_bEOF(true) {}
19 
21  ~ezFileReader() { Close(); }
22 
27  ezResult Open(const char* szFile, ezUInt32 uiCacheSize = 1024 * 1024, bool bAllowFileEvents = true);
28 
30  void Close();
31 
33  virtual ezUInt64 ReadBytes(void* pReadBuffer, ezUInt64 uiBytesToRead) override;
34 
35 private:
36  ezUInt64 m_uiBytesCached;
37  ezUInt64 m_uiCacheReadPosition;
39  bool m_bEOF;
40 };
41 
42