1 /*$
2  Copyright (C) 2013-2020 Azel.
3 
4  This file is part of AzPainter.
5 
6  AzPainter is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  AzPainter is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 $*/
19 
20 #ifndef MLIB_UTIL_FILE_H
21 #define MLIB_UTIL_FILE_H
22 
23 typedef struct _mFileStat mFileStat;
24 
25 enum MREADFILEFULL_FLAGS
26 {
27 	MREADFILEFULL_FILENAME_LOCALE = 1<<0,
28 	MREADFILEFULL_ADD_NULL = 1<<1,
29 	MREADFILEFULL_ACCEPT_EMPTY = 1<<2
30 };
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 mBool mIsFileExist(const char *filename,mBool bDirectory);
37 mBool mGetFileStat(const char *filename,mFileStat *dst);
38 mBool mCreateDir(const char *path);
39 mBool mCreateDirHome(const char *pathadd);
40 mBool mDeleteFile(const char *filename);
41 mBool mDeleteDir(const char *path);
42 
43 mBool mReadFileFull(const char *filename,uint8_t flags,mBuf *dstbuf);
44 mBool mReadFileHead(const char *filename,void *buf,int size);
45 
46 mBool mCopyFile(const char *src,const char *dst,int bufsize);
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif
53