MemoryMappedFile.h 560 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <string>
  3. #include "File.h"
  4. namespace il2cpp
  5. {
  6. namespace os
  7. {
  8. class MemoryMappedFile
  9. {
  10. public:
  11. static void* Map(FileHandle* file)
  12. {
  13. return Map(file, 0, 0);
  14. }
  15. static void Unmap(void* address)
  16. {
  17. Unmap(address, 0);
  18. }
  19. static void* Map(FileHandle* file, size_t length, size_t offset);
  20. static void Unmap(void* address, size_t length);
  21. #if IL2CPP_TARGET_POSIX
  22. static void* Map(int fd, size_t length, size_t offset);
  23. #endif
  24. };
  25. }
  26. }