diff options
author | Christian Fetzer <fetzer.ch@googlemail.com> | 2012-09-28 23:01:51 +0200 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@googlemail.com> | 2012-09-29 15:38:32 +0200 |
commit | 20bd8cdb2ebef079b6876c48f946fe53a382c6e2 (patch) | |
tree | 3f2150a3b9b61d8ebdb6b9a6595e184459e8dfe9 /lib | |
parent | 60e10a91e7e1788a081a163fa3e9e9278b301c3c (diff) |
[addons] Added FileExists, StatFile, DeleteFile, CreateDirectory, DirectoryExists and RemoveDirectory to libXBMCaddon
Diffstat (limited to 'lib')
-rw-r--r-- | lib/addons/library.xbmc.addon/libXBMC_addon.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp index 7db3824b28..a9308e5638 100644 --- a/lib/addons/library.xbmc.addon/libXBMC_addon.cpp +++ b/lib/addons/library.xbmc.addon/libXBMC_addon.cpp @@ -206,6 +206,30 @@ DLLEXPORT int XBMC_get_file_chunk_size(void *hdl, void* cb, void* file) return ((CB_AddOnLib*)cb)->GetFileChunkSize(((AddonCB*)hdl)->addonData, file); } +DLLEXPORT bool XBMC_file_exists(void *hdl, void* cb, const char *strFileName, bool bUseCache) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->FileExists(((AddonCB*)hdl)->addonData, strFileName, bUseCache); +} + +DLLEXPORT int XBMC_stat_file(void *hdl, void* cb, const char *strFileName, struct ::__stat64* buffer) +{ + if (cb == NULL) + return -1; + + return ((CB_AddOnLib*)cb)->StatFile(((AddonCB*)hdl)->addonData, strFileName, buffer); +} + +DLLEXPORT bool XBMC_delete_file(void *hdl, void* cb, const char *strFileName) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->DeleteFile(((AddonCB*)hdl)->addonData, strFileName); +} + DLLEXPORT bool XBMC_can_open_directory(void *hdl, void* cb, const char* strURL) { if (cb == NULL) @@ -214,4 +238,28 @@ DLLEXPORT bool XBMC_can_open_directory(void *hdl, void* cb, const char* strURL) return ((CB_AddOnLib*)cb)->CanOpenDirectory(((AddonCB*)hdl)->addonData, strURL); } +DLLEXPORT bool XBMC_create_directory(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->CreateDirectory(((AddonCB*)hdl)->addonData, strPath); +} + +DLLEXPORT bool XBMC_directory_exists(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->DirectoryExists(((AddonCB*)hdl)->addonData, strPath); +} + +DLLEXPORT bool XBMC_remove_directory(void *hdl, void* cb, const char *strPath) +{ + if (cb == NULL) + return false; + + return ((CB_AddOnLib*)cb)->RemoveDirectory(((AddonCB*)hdl)->addonData, strPath); +} + }; |