File multiplatform abstraction to read contents of a file.
More...
#include <File.h>
|
| File (const std::string &path, bool bundle=true, bool logEnabled=true) |
| Creates a File object. More...
|
|
bool | open (std::string mode="rb", bool showErrors=true) |
| Open the file.
|
|
void | close () |
| Close the file.
|
|
size_t | read (void *buffer, size_t count) |
| Read into buffer the number of 'count' bytes.
|
|
long | getSize () |
| Returns the size of the file.
|
|
size_t | write (const void *ptr, size_t size, size_t count) |
| Writes into the file.
|
|
bool | exists () |
| Returns true if the file exists.
|
|
const std::string & | getFullPath () |
| Returns the full path of the file, may contain bundle folder.
|
|
|
static std::string | load (std::string filename, bool bundle=true, std::string mode="rb", bool showErrors=true) |
| Convenient function to load files without deal with low level api.
|
|
static bool | existsPath (const std::string &path) |
| Returns true if the path exists.
|
|
static bool | makePath (const std::string &path) |
| Creates a folder.
|
|
static void | clearPatchFiles () |
| Clean overrided files in bundle.
|
|
static void | setPatchFile (const std::string &filename, const std::string &filepath) |
| Override files in bundle.
|
|
static const std::map< std::string, std::string > & | getPatchFiles () |
| Returns overrided files in bundle.
|
|
|
FILE * | pFile |
|
long | size |
|
std::string | path |
|
std::string | osPath |
|
bool | bundle |
|
|
static bool | sPatchFilesLoaded |
|
static std::map< std::string, std::string > | patchFiles |
|
File multiplatform abstraction to read contents of a file.
File::File |
( |
const std::string & |
path, |
|
|
bool |
bundle = true , |
|
|
bool |
logEnabled = true |
|
) |
| |
Creates a File object.
- Parameters
-
path | The path where the file can be found. |
bundle | If the file is inside the bundle. The bundle is the package created at build-time. |
logEnabled | |
The documentation for this class was generated from the following files:
- D:/prj/rag/include/rag/File.h
- D:/prj/rag/include/rag/File.cpp