Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
FileFunctions.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_FILE_TOOL_H__
13 #define __KOME_CORE_FILE_TOOL_H__
14 
15 
16 #include <string>
17 #include <vector>
18 
25 bool fileexists( const char* path );
26 
33 bool isdirectory( const char* path );
34 
41 bool checkfile( const char* path );
42 
49 std::string getfilename( const char* path );
50 
57 std::string getdir( const char* path );
58 
66 std::string getpath( const char* dir, const char* file );
67 
74 std::string absolutepath( const char* path );
75 
85 std::string getabsolutepath( const char* dir, const char* file );
86 
93 bool isabsolutepath( const char* file );
94 
101 void setarguments( int argc, char** argv );
102 
108 int getargc();
109 
116 const char* getargv( int index );
117 
124 std::string getext( const char* path );
125 
132 std::string getenvariable( const char* name );
133 
139 std::string getmodulefile();
140 
146 std::string getmoduledir();
147 
153 std::string gethomedir();
154 
159 std::string getplugindir();
160 
168 FILE* fileopen( const char* path, const char* mode );
169 
177 void fileseek( FILE* fp, long long offset, int origin );
178 
185 long long filetell( FILE* fp );
186 
194 bool copyfile( const char* src, const char* dst );
195 
202 bool removefile( const char* path );
203 
210 bool makedirectory( const char* path );
211 
217 bool removedirs( const char* path );
218 
224 bool makedirs( const char* path );
225 
232 unsigned long long filesize( const char* path );
233 
242 std::string searchfile( const char* dir, const char* fileName, const bool recursive );
243 
244 
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