| 1 |
// Copyright 2018 Emanuele Sorce, [email protected] |
| 2 |
// License: GPL version 2 (see included gpl.txt) |
| 3 |
// |
| 4 |
// Functions protoypes for functions that wrap common PHYSFS functionalities |
| 5 |
// |
| 6 |
|
| 7 |
#ifndef PHYSFS_UTILSH |
| 8 |
#define PHYSFS_UTILSH |
| 9 |
|
| 10 |
#include <string> |
| 11 |
|
| 12 |
|
| 13 |
Sint64 physfs_size(SDL_RWops *context); |
| 14 |
Sint64 physfs_seek(SDL_RWops *context, Sint64 offset, int whence); |
| 15 |
size_t physfs_read(SDL_RWops *context, void *ptr, size_t size, size_t maxnum); |
| 16 |
size_t physfs_write(SDL_RWops *context, const void *ptr, size_t size, size_t num); |
| 17 |
int physfs_close(SDL_RWops *context); |
| 18 |
|
| 19 |
// Get a string explaining the last error happened to physfs |
| 20 |
std::string physfs_getErrorString(); |
| 21 |
|
| 22 |
// Read a buffer from an handle |
| 23 |
PHYSFS_sint64 physfs_read |
| 24 |
( |
| 25 |
PHYSFS_File * handle, |
| 26 |
void * buffer, |
| 27 |
PHYSFS_uint32 objSize, |
| 28 |
PHYSFS_uint32 objCount |
| 29 |
); |
| 30 |
|
| 31 |
// Write a buffer to an handle |
| 32 |
PHYSFS_sint64 physfs_write |
| 33 |
( |
| 34 |
PHYSFS_File * handle, |
| 35 |
const void * buffer, |
| 36 |
PHYSFS_uint32 objSize, |
| 37 |
PHYSFS_uint32 objCount |
| 38 |
); |
| 39 |
|
| 40 |
// get the preferred config directory |
| 41 |
std::string physfs_getDir(); |
| 42 |
|
| 43 |
// return if the file is a directory |
| 44 |
bool physfs_isDirectory(const std::string& file); |
| 45 |
|
| 46 |
#endif |