filepath.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FILEPATHUTIL_H__
00025 #define __FILEPATHUTIL_H__
00026
00027 #include <time.h>
00028 #include <pmplib/ucs2char.h>
00029
00030 #ifdef FILEPATH_EXPORTS
00031 #define FILEPATHAPI __declspec(dllexport)
00032 #else
00033 #define FILEPATHAPI
00034 #endif
00035
00036
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00069 FILEPATHAPI ucs2char_t* filepath_addslash(ucs2char_t* path);
00070
00081 FILEPATHAPI ucs2char_t* filepath_removeslash(ucs2char_t* path);
00082
00092 FILEPATHAPI const ucs2char_t* filepath_combinepath(ucs2char_t* dst, size_t size, const ucs2char_t* path, const ucs2char_t* file);
00093
00101 FILEPATHAPI void filepath_strippath(ucs2char_t* path);
00102
00111 FILEPATHAPI const ucs2char_t* filepath_skippath(const ucs2char_t* path);
00112
00119 FILEPATHAPI void filepath_remove_filespec(ucs2char_t* path);
00120
00131 FILEPATHAPI const ucs2char_t* filepath_skiproot(const ucs2char_t* path, const ucs2char_t* root);
00132
00145 FILEPATHAPI const ucs2char_t* filepath_changeroot(const ucs2char_t* path, const ucs2char_t* root);
00146
00155 FILEPATHAPI const ucs2char_t* filepath_skipadirectory(const ucs2char_t* path);
00156
00163 FILEPATHAPI void filepath_add_extension(ucs2char_t* path, const ucs2char_t* ext);
00164
00171 FILEPATHAPI void filepath_remove_extension(ucs2char_t* path);
00172
00182 FILEPATHAPI int filepath_relative_to_absolute(ucs2char_t* absolute, const ucs2char_t* base, const ucs2char_t* relative);
00183
00191 FILEPATHAPI int filepath_path_canonicalize(ucs2char_t* dst, const ucs2char_t* src);
00192
00204 FILEPATHAPI int filepath_encode(ucs2char_t* path);
00205
00217 FILEPATHAPI int filepath_decode(ucs2char_t* path);
00218
00238 typedef int (*filepath_findfile_callback)(void *instance, const ucs2char_t* found_path, const ucs2char_t* found_file);
00239
00252 FILEPATHAPI int find_file(const ucs2char_t* path, int recursive, filepath_findfile_callback callback, void *instance);
00253
00260 FILEPATHAPI int filepath_file_exists(const ucs2char_t* path);
00261
00269 FILEPATHAPI int filepath_hasext(const ucs2char_t* filename, const ucs2char_t* ext);
00270
00277 FILEPATHAPI int filepath_is_dir(const ucs2char_t *path);
00278
00285 FILEPATHAPI int filepath_is_relative(const ucs2char_t* path);
00286
00294 FILEPATHAPI int filepath_is_same_root(const ucs2char_t* path1, const ucs2char_t* path2);
00295
00302 FILEPATHAPI time_t filepath_mtime(const ucs2char_t *filename);
00303
00317 FILEPATHAPI int filepath_compare_lastupdate(const ucs2char_t* file1, const ucs2char_t* file2);
00318
00325 FILEPATHAPI uint32_t filepath_size(const ucs2char_t *filename);
00326
00333 FILEPATHAPI int filepath_removefile(const ucs2char_t* file);
00334
00342 FILEPATHAPI int filepath_copyfile(const ucs2char_t* src, const ucs2char_t* dst);
00343
00349 #ifdef __cplusplus
00350 }
00351 #endif
00352
00353 #endif