From 4830f27a40323fe859dc166337a2b861877b7121 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 1 Jan 2018 13:40:09 +0100 Subject: sync with upstream --- .../include/kodi/libXBMC_addon.h | 35 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 5 deletions(-) (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h') diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h index c264578..5ef6bdc 100644 --- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h +++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h @@ -139,6 +139,7 @@ typedef struct CB_AddOn char* (*GetLocalizedString)(const void* addonData, long dwCode); char* (*GetDVDMenuLanguage)(const void* addonData); void (*FreeString)(const void* addonData, char* str); + void (*FreeStringArray)(const void* addonData, char** arr, int numElements); void* (*OpenFile)(const void* addonData, const char* strFileName, unsigned int flags); void* (*OpenFileForWrite)(const void* addonData, const char* strFileName, bool bOverWrite); @@ -155,7 +156,8 @@ typedef struct CB_AddOn int (*GetFileChunkSize)(const void* addonData, void* file); bool (*FileExists)(const void* addonData, const char *strFileName, bool bUseCache); int (*StatFile)(const void* addonData, const char *strFileName, struct __stat64* buffer); - char *(*GetFileProperty)(const void* addonData, void* file, XFILE::FileProperty type, const char *name); + char *(*GetFilePropertyValue)(const void* addonData, void* file, XFILE::FileProperty type, const char *name); + char **(*GetFilePropertyValues)(const void* addonData, void* file, XFILE::FileProperty type, const char *name, int *numPorperties); bool (*DeleteFile)(const void* addonData, const char *strFileName); bool (*CanOpenDirectory)(const void* addonData, const char* strURL); bool (*CreateDirectory)(const void* addonData, const char *strPath); @@ -299,6 +301,16 @@ namespace ADDON { m_Callbacks->FreeString(m_Handle->addonData, str); } + + /*! + * @brief Free the memory used by arr including its elements + * @param arr The string array to free + * @param numElements The length of the array + */ + void FreeStringArray(char** arr, int numElements) + { + m_Callbacks->FreeStringArray(m_Handle->addonData, arr, numElements); + } /*! * @brief Open the file with filename via XBMC's CFile. Needs to be closed by calling CloseFile() when done. @@ -468,13 +480,26 @@ namespace ADDON /*! * @brief Get a property from an open file. * @param file The file to get an property for - * @param type type of the requested property. - * @param name of the requested property / can be null. + * @param type Type of the requested property. + * @param name Name of the requested property / can be null. * @return The value of the requested property, must be FreeString'ed. */ - char *GetFileProperty(void* file, XFILE::FileProperty type, const char *name) + char *GetFilePropertyValue(void* file, XFILE::FileProperty type, const char *name) + { + return m_Callbacks->GetFilePropertyValue(m_Handle->addonData, file, type, name); + } + + /*! + * @brief Get multiple property values from an open file. + * @param file The file to get the property values for + * @param type Type of the requested property. + * @param name Name of the requested property / can be null. + * @param numValues Number of property values returned. + * @return List of values of the requested property, must be FreeStringArray'ed. + */ + char **GetFilePropertyValues(void* file, XFILE::FileProperty type, const char *name, int *numValues) { - return m_Callbacks->GetFileProperty(m_Handle->addonData, file, type, name); + return m_Callbacks->GetFilePropertyValues(m_Handle->addonData, file, type, name, numValues); } /*! -- cgit v1.2.3