From 50e044c0c920135dc3a1f57938d9d03723221488 Mon Sep 17 00:00:00 2001 From: cuiruibin Date: Fri, 6 Sep 2024 17:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ENDK=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=20Signed?= =?UTF-8?q?-off-by:=20cuiruibin=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filemanagement/file_uri/include/oh_file_uri.h | 20 +++++++++++++++++++ .../file_uri/liboh_file_uri.ndk.json | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/filemanagement/file_uri/include/oh_file_uri.h b/filemanagement/file_uri/include/oh_file_uri.h index 799cb6eea..03754be90 100644 --- a/filemanagement/file_uri/include/oh_file_uri.h +++ b/filemanagement/file_uri/include/oh_file_uri.h @@ -21,6 +21,10 @@ * @kit CoreFileKit * * @brief uri verification and conversion + * * This class is mainly for URI format verification and URI conversion processing; + * The conversion and operation of the media library type URI is not supported, + * and the class only converts according to the existing specifications, + * and there is no guarantee that the conversion result will actually exist. * @library libohfileuri.so * @syscap SystemCapability.FileManagement.AppFileService * @since 12 @@ -93,6 +97,22 @@ FileManagement_ErrCode OH_FileUri_GetFullDirectoryUri(const char *uri, unsigned * @since 12 */ bool OH_FileUri_IsValidUri(const char *uri, unsigned int length); + +/** +* @brief Gets the fileName From uri. +* This function obtains that the last segment of the URI string is the return value of the function, +* and the URI of the media type is not supported +* @param uri Input a pointer to the uri string. +* @param length The length of the input uri. +* @param result Output a pointer to a FileName string. Please use free() to clear the resource. +* @return Returns the status code of the execution. +* {@link ERR_PARAMS} 401 - Invalid input parameter. +* {@link ERR_ENOMEM} 13900011 - Failed to apply for memory or failed to copy memory. +* {@link ERR_OK} 0 - This operation was successfully executed. +* @syscap SystemCapability.FileManagement.AppFileService +* @since 13 + */ +FileManagement_ErrCode OH_FileUri_GetFileName(const char *uri, unsigned int length, char **result); #ifdef __cplusplus }; #endif diff --git a/filemanagement/file_uri/liboh_file_uri.ndk.json b/filemanagement/file_uri/liboh_file_uri.ndk.json index 776c160a8..d17efcd7a 100644 --- a/filemanagement/file_uri/liboh_file_uri.ndk.json +++ b/filemanagement/file_uri/liboh_file_uri.ndk.json @@ -13,5 +13,9 @@ { "first_introduced": "12", "name":"OH_FileUri_IsValidUri" + }, + { + "first_introduced": "13", + "name":"OH_FileUri_GetFileName" } ] \ No newline at end of file -- Gitee