//CFTTFile_Buffered - [2020-04-13 11:57:46]
#ifndef _CFTTFILE_BUFFERED_H_
#define _CFTTFILE_BUFFERED_H_

#include "CFTTAsyncEvent.h"
#include "CFTTFile.h"

/*
0026405C CFTTFile_Buffered::CFTTFile_Buffered(uint,uint,EFTTMemHeapID)
002642D8 CFTTFile_Buffered::~CFTTFile_Buffered()
002642F4 CFTTFile_Buffered::~CFTTFile_Buffered()
0026387C CFTTFile_Buffered::Initialise()
0026397C CFTTFile_Buffered::Shutdown()
002640F8 CFTTFile_Buffered::FillBuffer(int,long long)
00264302 CFTTFile_Buffered::Read(void *,long long)
00264518 CFTTFile_Buffered::Write(void const*,long long)
00264746 CFTTFile_Buffered::GetPos()
0026475A CFTTFile_Buffered::Seek(long long,int)
002648C6 CFTTFile_Buffered::GetAttributes()
002648D4 CFTTFile_Buffered::Close()
00264A26 CFTTFile_Buffered::IsOpen()
00264A30 CFTTFile_Buffered::ReadCallback(CFTTAsyncEvent<TFTTFileAsyncEventData> *,TFTTFileAsyncEventData const*,void *)
00264A56 CFTTFile_Buffered::GetAsyncHandler()
00264A64 CFTTFile_Buffered::GetModeFlags()
00265854 CFTTFile_Buffered::UseBufferedAccess()

CFTTFile           0x18
CFTTFile_Buffered  0x48

00263D18
v15 = operator new(0x48, v6, 0, v14);
result = CFTTFile_Buffered::CFTTFile_Buffered((int)v15, v9, 0x8000, 4096, v6);

.data.rel.ro:00329844 _ZTV17CFTTFile_Buffered DCD 0           ; DATA XREF: LOAD:00029A80↑o

_Z18FTTFILE_Initialisev
*/

class CFTTFile_Buffered : public CFTTFile {
public:
  CFTTFile_Buffered(CFTTFile *pCFTTFile,
                    uint count,
                    uint aglin,
                    EFTTMemHeapID eHeapId);            //0026405C
  virtual ~CFTTFile_Buffered();                        //002642D8 002642F4
  static void Initialise();                            //0026387C
  static void Shutdown();                              //0026397C
  bool FillBuffer(int a2, int64 end);                  //002640F8
  virtual int64 Read(void *buf, int64 buflen);         //00264302
  virtual int64 Write(void const *buf, int64 buflen);  //00264518
  virtual int64 GetPos();                              //00264746
  virtual int64 Seek(int64 dpos, int whence);          //0026475A
  virtual TFTTFileAttributes *GetAttributes();         //002648C6
  virtual bool Close();                                //002648D4
  virtual bool IsOpen();                               //00264A26
  static void ReadCallback(CFTTAsyncEvent<TFTTFileAsyncEventData> *pAsycEvent,
                           TFTTFileAsyncEventData const *pEventData,
                           void *data);              //00264A30
  virtual CFTTFile_AsyncHandler *GetAsyncHandler();  //00264A56
  virtual int GetModeFlags();                        //00264A64
  virtual bool UseBufferedAccess() const;            //00265854

  static CFTTAsyncEvent<TFTTFileAsyncEventData> *ms_pEvent;

  CFTTFile *pFile_8;
  uint mod_C;
  int aglin_10;
  int aglin_14;

  int64 i64Arrar_18[2];  //根据参数选择 i64Arrar_18 数组中的一个
  uint8 *bufArray_28[2];
  uint8 byArray_30[2];  //.text:00264110   ADD.W R7, R5, #0x30 根据参数选择其中的一个
  uint8 byArray_32[2];
  int field_34;
  volatile int64 curPos_38;
  int64 size_40;
};

/*
00000000 CFTTFile_Buffered struc ; (sizeof=0x48, mappedto_314)
00000000 vptr            DCD ?                   ; offset
00000004 field_4         DCD ?
00000008 pCFTTFile_8     DCD ?                   ; offset
0000000C len_C           DCD ?
00000010 len_10          DCD ?
00000014 field_14        DCD ?
00000018 field_18        DCQ ?
00000020 field_20        DCQ ?
00000028 field_28        DCD ?
0000002C field_2C        DCD ?
00000030 field_30        DCD ?
00000034 field_34        DCD ?
00000038 curPos_38       DCQ ?
00000040 field_40        DCQ ?
00000048 CFTTFile_Buffered ends

4C 08 B4 D7             vptr
00 00 00 00             field_4
80 B7 CB D0             pCFTTFile_8
00 80 00 00             len_C
00 10 00 00             len_10
00 00 00 00             field_14
00 00 00 00 00 00 00 00 field_18
00 80 00 00 00 00 00 00 field_20
C0 C8 E6 D0             field_28
40 09 E6 D0             field_2C
00 00 00 00             field_30
00 00 00 00             field_34
04 00 00 00 00 00 00 00 curPos_38
E0 64 16 00 00 00 00 00 field_40
*/
#endif  //_CFTTFILE_BUFFERED_H_