CFTTFileSystem.cpp 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #include "CFTTFileSystem.h"
  2. #include "CFTTFile_Buffered.h"
  3. #include "memctrl.h"
  4. CFTTFileSystem* g_pFTTFileSystem = nullptr; //005CB398
  5. CFTTFileSystem* g_pPackageFileSystem = nullptr; //005CB39C
  6. CFTTFileSystem* g_pTempFileSystem = nullptr; //005CB3A0
  7. CFTTFileSystem* g_pDocsFileSystem = nullptr; //005CB3A4
  8. CFTTFileSystem* g_pCachesFileSystem = nullptr; //005CB3A8
  9. CFTTFileSystem* g_pSupportFileSystem = nullptr; //005CB3AC
  10. CFTTFileSystem* g_pAndroidAPKXFileSystem = nullptr; //005CB3B0
  11. FileSystemNode* CFTTFileSystem::ms_pFileSystems = nullptr; //005CB3B4 CFTTFileSystem::Register 中增加FileSystem 结点
  12. char byte_5CB3B8[64]; //005CB3B8
  13. //-------------------------------------------------------------------------------------------------
  14. // CFTTFileSystem::CFTTFileSystem(char* a2, char* ptype) {
  15. // }
  16. //-------------------------------------------------------------------------------------------------
  17. //002213EC 00265852 //^_^
  18. CFTTFileSystem::~CFTTFileSystem() {
  19. Deregister(this, nullptr);
  20. }
  21. //-------------------------------------------------------------------------------------------------
  22. //00221D22 //^_^
  23. bool CFTTFileSystem::GetAbsoluteFilename(char const* filepath,
  24. char* pOutputName,
  25. uint outpue_len) {
  26. return false;
  27. }
  28. //-------------------------------------------------------------------------------------------------
  29. //00263FF2 //^_^
  30. EFTTError CFTTFileSystem::Delete(char const* a1) {
  31. return (EFTTError)0xE;
  32. }
  33. //-------------------------------------------------------------------------------------------------
  34. //00221D26 //^_^
  35. EFTTError CFTTFileSystem::Rename(char const* a1, char const* a2, CFTTFileSystem* a3) {
  36. return (EFTTError)0x14;
  37. }
  38. //-------------------------------------------------------------------------------------------------
  39. //00221D2A //^_^
  40. EFTTError CFTTFileSystem::Copy(char const* a1, char const* a2, bool a3) {
  41. return (EFTTError)0x14;
  42. }
  43. //-------------------------------------------------------------------------------------------------
  44. //00263FF6 //^_^
  45. EFTTError CFTTFileSystem::OpenDir(char const* a1, CFTTFileIterator** ppFileIt) {
  46. return (EFTTError)0xE;
  47. }
  48. //-------------------------------------------------------------------------------------------------
  49. //00263FFA //^_^
  50. bool CFTTFileSystem::FileExistsFS(char const* a1) {
  51. return false;
  52. }
  53. //-------------------------------------------------------------------------------------------------
  54. //0026400E //^_^
  55. EFTTError CFTTFileSystem::GetAttributesFS(char const* filepath, TFTTFileAttributes* pAttr) {
  56. EFTTError eRet;
  57. //loc_264056
  58. return eRet;
  59. }
  60. //-------------------------------------------------------------------------------------------------
  61. //00263FEE //^_^
  62. void CFTTFileSystem::SetErrorCallback(EFTTErrorCallback errfunc) {
  63. errFunc_4 = errfunc;
  64. }
  65. //-------------------------------------------------------------------------------------------------
  66. //00263FDE //^_^
  67. EFTTError CFTTFileSystem::Error(EFTTError derr, int a2, CFTTFile* pFile3, char const* pBuf4) {
  68. EFTTError e;
  69. return e;
  70. }
  71. //-------------------------------------------------------------------------------------------------
  72. //00263BFC //^_^
  73. bool CFTTFileSystem::FileExists(char const* filepath) {
  74. //loc_263C4E
  75. return false;
  76. }
  77. //-------------------------------------------------------------------------------------------------
  78. //00263AF8 //^_^
  79. CFTTFileSystem* CFTTFileSystem::FindFileSystem(char const* filetype) {
  80. LOGE("FindFileSystem%s",filetype);
  81. return (CFTTFileSystem*)rand();
  82. }
  83. //-------------------------------------------------------------------------------------------------
  84. //00263D70 //^_^
  85. EFTTError CFTTFileSystem::GetAttributes(char const* filepath, TFTTFileAttributes* pAttr) {
  86. //loc_263DC8
  87. return (EFTTError)0x11;
  88. }
  89. //-------------------------------------------------------------------------------------------------
  90. //00263B44 //^_- 经过单元测试,功能正常
  91. uint CFTTFileSystem::GetModeFlags(char const* fmod) {
  92. uint dret = 0;
  93. return dret;
  94. }
  95. //-------------------------------------------------------------------------------------------------
  96. //00263BA4 //^_^
  97. const char* CFTTFileSystem::GetModeString(int dMod) {
  98. const char* result; // r0
  99. return result;
  100. }
  101. //-------------------------------------------------------------------------------------------------
  102. //00263830 //^_^
  103. void CFTTFileSystem::Register(CFTTFileSystem* pFileSystem, char const* ptype) {
  104. }
  105. //-------------------------------------------------------------------------------------------------
  106. //00263AB8 //^_^ static
  107. void CFTTFileSystem::Deregister(char const* ptype) {
  108. }
  109. //-------------------------------------------------------------------------------------------------
  110. //00263A6C //^_^
  111. void CFTTFileSystem::Deregister(CFTTFileSystem* pFileSystem, char const* ptype) {
  112. }
  113. //-------------------------------------------------------------------------------------------------
  114. //00263DD8 经过单元测试,功能正常
  115. //原始函数处理字符串太啰嗦,我理解后自己写的功能完全相同的逻辑
  116. char* CFTTFileSystem::TidyFilename(char const* file0,
  117. char const* path1,
  118. char c2,
  119. EFTTMemHeapID eID3,
  120. bool b4) {
  121. return nullptr;
  122. }
  123. //-------------------------------------------------------------------------------------------------
  124. //00263EDC 单元测试,没有调用到这个函数,暂时无法实际验证,但上逻辑与上一个函数完全相同
  125. char16_t* CFTTFileSystem::TidyFilename(char const* file0,
  126. wchar_t const* a_wpath1,
  127. wchar_t a_wc2,
  128. EFTTMemHeapID eID3,
  129. bool b4) {
  130. return nullptr;
  131. }
  132. //-------------------------------------------------------------------------------------------------
  133. //00263D54 //^_^
  134. //CFTTFileSystem::fopen("PKG:/Data/anims/anims.pak", "rb", 0);
  135. CFTTFile* CFTTFileSystem::fopen(char const* filepath, char const* pmod, EFTTMemHeapID eHeapID) {
  136. return 0;
  137. }
  138. //-------------------------------------------------------------------------------------------------
  139. //00263C60 //-_- 经过单元测试,功能正常不
  140. CFTTFile* CFTTFileSystem::fopen(char const* filepath, uint dMod, EFTTMemHeapID eHeapID) {
  141. return 0;
  142. }
  143. //-------------------------------------------------------------------------------------------------