12 #ifndef __KOME_CORE_FILE_TOOL_H__
13 #define __KOME_CORE_FILE_TOOL_H__
57 std::string
getdir(
const char* path );
66 std::string
getpath(
const char* dir,
const char* file );
116 const char*
getargv(
int index );
124 std::string
getext(
const char* path );
168 FILE*
fileopen(
const char* path,
const char* mode );
177 void fileseek( FILE* fp,
long long offset,
int origin );
194 bool copyfile(
const char* src,
const char* dst );
232 unsigned long long filesize(
const char* path );
242 std::string
searchfile(
const char* dir,
const char* fileName,
const bool recursive );
245 #endif // __KOME_CORE_FILE_TOOL_H__
std::string getabsolutepath(const char *dir, const char *file)
get absolute path
bool copyfile(const char *src, const char *dst)
copies file
bool removedirs(const char *path)
remove directories
std::string getfilename(const char *path)
get file name
void setarguments(int argc, char **argv)
set arguments
bool makedirs(const char *path)
make directories
std::string getplugindir()
gets mspp plugin paths
const char * getargv(int index)
get argument
std::string getmodulefile()
gets module file path
int getargc()
get number of arguments
bool isdirectory(const char *path)
judge whether file is directory
std::string getdir(const char *path)
get dir that the file exists
std::string gethomedir()
gets current user's home directory
unsigned long long filesize(const char *path)
gets the file size
std::string getext(const char *path)
get the extension of the file
bool checkfile(const char *path)
check file before open. (This function calls fileexists and isdirectory )
bool fileexists(const char *path)
judge whether file exists
std::string getpath(const char *dir, const char *file)
get file path
bool makedirectory(const char *path)
creates directory
FILE * fileopen(const char *path, const char *mode)
opens file
void fileseek(FILE *fp, long long offset, int origin)
sets file position
std::string getmoduledir()
gets module file directory
bool removefile(const char *path)
removes file
long long filetell(FILE *fp)
gets file position
std::string searchfile(const char *dir, const char *fileName, const bool recursive)
searches file
std::string absolutepath(const char *path)
get absolute path
bool isabsolutepath(const char *file)
judges whether the specified file path is absolute file path or not.
std::string getenvariable(const char *name)
get environment variable