diff --git a/global/resource_management/include/rawfile/raw_file.h b/global/resource_management/include/rawfile/raw_file.h index 0fb7627fe8b506fff4415cf7596797ee922f0ccd..85eb3c545071b0a9d6141b2dd2a568850f39e9f3 100644 --- a/global/resource_management/include/rawfile/raw_file.h +++ b/global/resource_management/include/rawfile/raw_file.h @@ -120,7 +120,8 @@ typedef struct { * @param rawFile Indicates the pointer to {@link RawFile}. * @param buf Indicates the pointer to the buffer for receiving the data read. * @param length Indicates the number of bytes to read. - * @return Returns the number of bytes read if any; returns 0 if the number reaches the end of file (EOF). + * @return Returns the number of bytes read if any; + * if the number reaches the end of file (EOF) or rawFile is nullptr also returns 0 * @since 8 * @version 1.0 */ @@ -146,7 +147,7 @@ int OH_ResourceManager_SeekRawFile(const RawFile *rawFile, long offset, int when * @brief Obtains the raw file length represented by an long. * * @param rawFile Indicates the pointer to {@link RawFile}. - * @return Returns the total length of the raw file. + * @return Returns the total length of the raw file. If rawFile is nullptr also returns 0. * @since 8 * @version 1.0 */ @@ -156,7 +157,7 @@ long OH_ResourceManager_GetRawFileSize(RawFile *rawFile); * @brief Obtains the remaining raw file length represented by an long. * * @param rawFile Indicates the pointer to {@link RawFile}. - * @return Returns the remaining length of the raw file. + * @return Returns the remaining length of the raw file. If rawFile is nullptr also returns 0. * @since 11 * @version 1.0 */ @@ -180,7 +181,7 @@ void OH_ResourceManager_CloseRawFile(RawFile *rawFile); * The current offset of a raw file. * * @param rawFile Indicates the pointer to {@link RawFile}. - * @return Returns the current offset of a raw file. + * @return Returns the current offset of a raw file. If rawFile is nullptr also returns 0. * @since 8 * @version 1.0 */ @@ -219,7 +220,8 @@ bool OH_ResourceManager_ReleaseRawFileDescriptor(const RawFileDescriptor &descri * @param rawFile Indicates the pointer to {@link RawFile64}. * @param buf Indicates the pointer to the buffer for receiving the data read. * @param length Indicates the number of bytes to read. - * @return Returns the number of bytes read if any; returns 0 if the number reaches the end of file (EOF). + * @return Returns the number of bytes read if any; + * returns 0 if the number reaches the end of file (EOF). or rawFile is nullptr also returns 0 * @since 11 * @version 1.0 */ @@ -245,7 +247,7 @@ int OH_ResourceManager_SeekRawFile64(const RawFile64 *rawFile, int64_t offset, i * @brief Obtains the raw file length represented by an int64_t. * * @param rawFile Indicates the pointer to {@link RawFile64}. - * @return Returns the total length of the raw file. + * @return Returns the total length of the raw file. If rawFile is nullptr also returns 0. * @since 11 * @version 1.0 */ @@ -255,7 +257,7 @@ int64_t OH_ResourceManager_GetRawFileSize64(RawFile64 *rawFile); * @brief Obtains the remaining raw file length represented by an int64_t. * * @param rawFile Indicates the pointer to {@link RawFile64}. - * @return Returns the remaining length of the raw file. + * @return Returns the remaining length of the raw file. If rawFile is nullptr also returns 0. * @since 11 * @version 1.0 */ @@ -279,7 +281,7 @@ void OH_ResourceManager_CloseRawFile64(RawFile64 *rawFile); * The current offset of a raw file. * * @param rawFile Indicates the pointer to {@link RawFile64}. - * @return Returns the current offset of a raw file. + * @return Returns the current offset of a raw file. If rawFile is nullptr also returns 0. * @since 11 * @version 1.0 */ diff --git a/global/resource_management/include/rawfile/raw_file_manager.h b/global/resource_management/include/rawfile/raw_file_manager.h index ca3fabae47ed4536a565057cbf303e007117313a..42a8ff9c3bbaaf6bd08b9f2f6eeea179ae817e3b 100644 --- a/global/resource_management/include/rawfile/raw_file_manager.h +++ b/global/resource_management/include/rawfile/raw_file_manager.h @@ -66,7 +66,7 @@ typedef struct NativeResourceManager NativeResourceManager; * * @param env Indicates the pointer to the JavaScipt Native Interface (napi) environment. * @param jsResMgr Indicates the JavaScipt resource manager. - * @return Returns the pointer to {@link NativeResourceManager}. + * @return Returns the pointer to {@link NativeResourceManager}. If failed returns nullptr. * @since 8 * @version 1.0 */ @@ -92,8 +92,8 @@ void OH_ResourceManager_ReleaseNativeResourceManager(NativeResourceManager *resM * {@link OH_ResourceManager_InitNativeResourceManager}. * @param dirName Indicates the name of the raw file directory to open. You can pass an empty string to open the * top-level raw file directory. - * @return Returns the pointer to {@link RawDir}. After you finish using the pointer, call - * {@link OH_ResourceManager_CloseRawDir} to release it. + * @return Returns the pointer to {@link RawDir}. If failed or mgr is nullptr also returns nullptr. + * After you finish using the pointer, call {@link OH_ResourceManager_CloseRawDir} to release it. * @see OH_ResourceManager_InitNativeResourceManager * @see OH_ResourceManager_CloseRawDir * @since 8 @@ -109,8 +109,8 @@ RawDir *OH_ResourceManager_OpenRawDir(const NativeResourceManager *mgr, const ch * @param mgr Indicates the pointer to {@link NativeResourceManager} obtained by calling * {@link OH_ResourceManager_InitNativeResourceManager}. * @param fileName Indicates the file path relative to the top-level raw file directory. - * @return Returns the pointer to {@link RawFile}. After you finish using the pointer, call - * {@link OH_ResourceManager_CloseRawFile} to release it. + * @return Returns the pointer to {@link RawFile}. If failed or mgr and fileName is nullptr also returns nullptr. + * After you finish using the pointer, call {@link OH_ResourceManager_CloseRawFile} to release it. * @see OH_ResourceManager_InitNativeResourceManager * @see OH_ResourceManager_CloseRawFile * @since 8 @@ -126,8 +126,8 @@ RawFile *OH_ResourceManager_OpenRawFile(const NativeResourceManager *mgr, const * @param mgr Indicates the pointer to {@link NativeResourceManager} obtained by calling * {@link OH_ResourceManager_InitNativeResourceManager}. * @param fileName Indicates the file path relative to the top-level raw file directory. - * @return Returns the pointer to {@link RawFile64}. After you finish using the pointer, call - * {@link OH_ResourceManager_CloseRawFile64} to release it. + * @return Returns the pointer to {@link RawFile64}. If failed or mgr and fileName is nullptr also returns nullptr. + * After you finish using the pointer, call {@link OH_ResourceManager_CloseRawFile64} to release it. * @see OH_ResourceManager_InitNativeResourceManager * @see OH_ResourceManager_CloseRawFile64 * @since 11