raw_file.h

Overview

Provides functions related to rawfiles, including searching for, reading, and closing rawfiles.

Since: 8

Related module: [Rawfile] (rawfile.md)

Summary

Structs

Name Description
RawFileDescriptor Defines the file descriptor of a rawfile.
RawFileDescriptor64 Defines the file descriptor of a large rawfile.
NOTE
This new API supports large rawfiles and provides better performance.

Types

Name Description
RawFile Provides access to the rawfiles in the rawfile directory.
RawFile64 Provides access to the rawfiles in the rawfile directory.
NOTE
This new API supports large rawfiles and provides better performance.

Function

Name Description
OH_ResourceManager_ReadRawFile (const RawFile *rawFile, void *buf, size_t length) Reads data of the specified length from the current position in a rawfile.
OH_ResourceManager_SeekRawFile (const RawFile *rawFile, long offset, int whence) Searches for the data read/write position based on the specified offset (in long) in a rawfile.
OH_ResourceManager_GetRawFileSize (RawFile *rawFile) Obtains the length of the rawfile, in long.
OH_ResourceManager_GetRawFileRemainingLength (const RawFile *rawFile) Obtains the remaining length of the rawfile, in long.
OH_ResourceManager_CloseRawFile (RawFile *rawFile) Closes a RawFile and releases all associated resources.
OH_ResourceManager_GetRawFileOffset (const RawFile *rawFile) Obtains the current offset of a rawfile, in long.
OH_ResourceManager_GetRawFileDescriptor (const RawFile *rawFile, RawFileDescriptor &descriptor) Opens a rawfile based on the specified offset and file length and obtains the file descriptor.
OH_ResourceManager_ReleaseRawFileDescriptor (const RawFileDescriptor &descriptor) Releases the file descriptor of a rawfile.
OH_ResourceManager_ReadRawFile64 (const RawFile64 *rawFile, void *buf, int64_t length) Reads data of the specified length from the current position in a rawfile.
NOTE
This new API supports large rawfiles and provides better performance.
OH_ResourceManager_SeekRawFile64 (const RawFile64 *rawFile, int64_t offset, int whence) Searches for the data read/write position based on the specified offset (in int64_t) in a large rawfile.
OH_ResourceManager_GetRawFileSize64 (RawFile64 *rawFile) Obtains the length of a large rawfile, in int64_t.
OH_ResourceManager_GetRawFileRemainingLength64 (const RawFile64 *rawFile) Obtains the remaining length of a rawfile, in long.
OH_ResourceManager_CloseRawFile64 (RawFile64 *rawFile) Closes a RawFile64 and releases all associated resources.
OH_ResourceManager_GetRawFileOffset64 (const RawFile64 *rawFile) Obtains the offset of a large rawfile, in int64_t.
OH_ResourceManager_GetRawFileDescriptor64 (const RawFile64 *rawFile, RawFileDescriptor64 *descriptor) Opens a rawfile based on the specified offset and file length and obtains the file descriptor.
OH_ResourceManager_ReleaseRawFileDescriptor64 (const RawFileDescriptor64 *descriptor) Releases the file descriptor of a rawfile.