|
static bool | Create () |
| The preferred entry point for the construction of the global APKFileHandler instance.
|
|
static void | Destroy () |
| Public accessor to destroy the APKFileHandler global instance.
|
|
static FILE * | Open (const char *filename, const char *mode, AZ::u64 &size) |
|
static int | Read (void *asset, char *buffer, int size) |
|
static int | Write (void *asset, const char *buffer, int size) |
|
static fpos_t | Seek (void *asset, fpos_t offset, int origin) |
| Same as, and is mapped to fseek when a file is opened.
|
|
static int | Close (void *asset) |
|
static int | FileLength (const char *filename) |
|
static AZ::IO::Result | ParseDirectory (const char *path, FindDirsCallbackType findCallback) |
|
static bool | IsDirectory (const char *path) |
| Check to see if a given path is a directory or not.
|
|
static bool | DirectoryOrFileExists (const char *path) |
| Checks to see if a path (file or directory) exists.
|
|
static void | SetNumBytesToRead (const size_t numBytesToRead) |
| Set the correct number of bytes to be read when calls to fread are redirected to APKFileHandler::Read.
|
|
static void | SetLoadFilesToMemory (const char *fileNames) |
| Set the names of the files that should be loaded to memory.
|
|
◆ Close()
static int AZ::Android::APKFileHandler::Close |
( |
void * |
asset | ) |
|
|
static |
Closes the file handle and frees it's allocated resources. Is mapped to fclose when a file is opened.
- Returns
- 0
◆ FileLength()
static int AZ::Android::APKFileHandler::FileLength |
( |
const char * |
filename | ) |
|
|
static |
Get the size, in bytes, of a file
- Parameters
-
filename | The full path to the file |
- Returns
- The size of the file, in bytes. Returns
◆ Open()
static FILE * AZ::Android::APKFileHandler::Open |
( |
const char * |
filename, |
|
|
const char * |
mode, |
|
|
AZ::u64 & |
size |
|
) |
| |
|
static |
Opens a file using the native assets manager and maps standard c file i/o
- Parameters
-
filename | The full path to the file |
mode | Access mode of the file to be opened, will ignore write operations |
size[out] | Returns the size of the file in bytes |
- Returns
- A standard c file handle
◆ ParseDirectory()
Uses JNI to cache the contents of a given directory at path
while providing each entry to findCallback
- Parameters
-
path | The full path to the desired directory |
findCallback | Callback used to find a specific file within a given directory |
- Returns
- If the directory was already cached AZ::IO::ResultCode::Success if the directory was already cached or
◆ Read()
static int AZ::Android::APKFileHandler::Read |
( |
void * |
asset, |
|
|
char * |
buffer, |
|
|
int |
size |
|
) |
| |
|
static |
Reads size
bytes of a given open file. Is mapped to fread when a file is opened
- Parameters
-
asset | Raw pointer to the AAsset |
buffer | Data blob to read into |
size | Number of bytes to read. When called from fread redirect, value could be ignored in favor of using the internal cached version to ensure we are reading only the necessary number of bytes, otherwise we would be reading more than necessary as the redirected seems to only pass in 1024. |
- Returns
- The number of bytes read, zero on EOF, or < 0 on error.
◆ Write()
static int AZ::Android::APKFileHandler::Write |
( |
void * |
asset, |
|
|
const char * |
buffer, |
|
|
int |
size |
|
) |
| |
|
static |
Writing to files inside an APK is unsupported. Is mapped to fwrite when a file is opened in order to correctly return an access error.
- Returns
- EACCES
The documentation for this class was generated from the following file:
- Code/Framework/AzCore/Platform/Android/AzCore/Android/APKFileHandler.h