-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
Copy pathFileUtils.h
42 lines (35 loc) · 1.25 KB
/
FileUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef _FILE_UTILS_H_
#define _FILE_UTILS_H_
#include "TG3.h"
namespace CocosDenshion {
/**
@class FileUtils
@brief Offer tools of file system
*/
class FileUtils
{
public:
/**
@brief Whether the file is existed or not
@param pFilePath The absolute path of file.
@return If existed return true,or return false
*/
static bool isFileExisted(const char* pFilePath);
/**
@brief Set the ResourcePath and(or) the zip file name
@param pszResPath The absolute resource path
@param pszZipFileName The relative path of the .zip file
*/
static void setResource(const char* pszResPath, const char* pszZipFileName);
/**
@brief Get resource file data
@param[in] pszFileName The resource file name which contain the path
@param[in] pszMode The read mode of the file
@param[out] pSize If get the file data succeed the it will be the data size,or it will be 0
@return if success,the pointer of data will be returned,or NULL is returned
@warning If you get the file data succeed,you must delete it after used.
*/
static unsigned char* getFileData(const char* pszFileName, const char* pszMode, unsigned long * pSize);
};
} // end of namespace CocosDenshion
#endif