BrokeredFileSystem.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. #include "il2cpp-string-types.h"
  4. #include "os/c-api/OSGlobalEnums.h"
  5. #include "os/Directory.h"
  6. #include "os/ErrorCodes.h"
  7. #include "os/File.h"
  8. #include <cstdint>
  9. #include <set>
  10. namespace il2cpp
  11. {
  12. namespace os
  13. {
  14. class BrokeredFileSystem
  15. {
  16. public:
  17. // Folders
  18. static int CreateDirectoryW(const UTF16String& path);
  19. static int RemoveDirectoryW(const UTF16String& path);
  20. static std::set<std::string> GetFileSystemEntries(const UTF16String& path, const UTF16String& pathWithPattern, int32_t attributes, int32_t attributeMask, int* error);
  21. static os::ErrorCode FindFirstFileW(Directory::FindHandle* findHandle, const utils::StringView<Il2CppNativeChar>& searchPathWithPattern, Il2CppNativeString* resultFileName, int32_t* resultAttributes);
  22. static os::ErrorCode FindNextFileW(Directory::FindHandle* findHandle, Il2CppNativeString* resultFileName, int32_t* resultAttributes);
  23. static os::ErrorCode FindClose(void* osHandle);
  24. // Files
  25. static bool CopyFileW(const UTF16String& source, const UTF16String& destination, bool overwrite, int* error);
  26. static bool MoveFileW(const UTF16String& source, const UTF16String& destination, int* error);
  27. static int DeleteFileW(const UTF16String& path);
  28. static UnityPalFileAttributes GetFileAttributesW(const UTF16String& path, int* error);
  29. static bool SetFileAttributesW(const UTF16String& path, UnityPalFileAttributes attributes, int* error);
  30. static bool GetFileStat(const std::string& utf8Path, const UTF16String& path, FileStat* stat, int* error);
  31. static FileHandle* Open(const UTF16String& path, uint32_t desiredAccess, uint32_t shareMode, uint32_t creationDisposition, uint32_t flagsAndAttributes, int* error);
  32. // Cleanup
  33. static void CleanupStatics();
  34. };
  35. }
  36. }