openharmony 鸿蒙 capi-raw-dir-h

2026-08-25 浏览 (1)

raw_dir.h

Overview

Provides functions related to rawfile directories, including traversing and closing rawfile directories.

File to include: <rawfile/raw_dir.h>

Library: librawfile.z.so

System capability: SystemCapability.Global.ResourceManager

Since: 8

Related module: rawfile

Summary

Structs

Nametypedef KeywordDescription
RawDirRawDirProvides access to the rawfile directory.

Functions

NameDescription
const char *OH_ResourceManager_GetRawFileName(RawDir *rawDir, int index)Obtains the name of a file in rawfile based on the index. You can use this function to traverse the rawfile directory.
int OH_ResourceManager_GetRawFileCount(RawDir *rawDir)Obtains the number of rawfiles in RawDir. You can use this function to obtain available indexes in OH_ResourceManager_GetRawFileName.
void OH_ResourceManager_CloseRawDir(RawDir *rawDir)Closes an opened RawDir and releases all associated resources.

Function Description

OH_ResourceManager_GetRawFileName()

const char *OH_ResourceManager_GetRawFileName(RawDir *rawDir, int index)

Description

Obtains the name of a file in rawfile based on the index. You can use this function to traverse the rawfile directory.

Since: 8

Parameters

NameDescription
RawDir *rawDirPointer to RawDir.
int indexIndex of the rawfile in RawDir.

Returns

TypeDescription
const char *File name obtained if the rawfile exists in the directory. The file name returned can be used as the input parameter of OH_ResourceManager_OpenRawFile.
If no file is found after all files in the directory are traversed, NULL is returned.

Reference

OH_ResourceManager_OpenRawFile

OH_ResourceManager_GetRawFileCount()

int OH_ResourceManager_GetRawFileCount(RawDir *rawDir)

Description

Obtains the number of rawfiles in RawDir. You can use this function to obtain available indexes in OH_ResourceManager_GetRawFileName.

Since: 8

Parameters

NameDescription
RawDir *rawDirPointer to RawDir.

Returns

TypeDescription
intNumber of files in rawDir. If rawDir is empty, 0 is returned.

Reference

OH_ResourceManager_GetRawFileName

OH_ResourceManager_CloseRawDir()

void OH_ResourceManager_CloseRawDir(RawDir *rawDir)

Description

Closes an opened RawDir and releases all associated resources.

Since: 8

Parameters

NameDescription
RawDir *rawDirPointer to RawDir.

Reference

OH_ResourceManager_OpenRawDir

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-i18n-initialtimezonerule

openharmony 鸿蒙 capi-i18n-timezonerules

openharmony 鸿蒙 capi-resmgr-common-h

openharmony 鸿蒙 capi-i18n-annualtimezonerule

openharmony 鸿蒙 errorcode-font-manager

openharmony 鸿蒙 capi-i18n-timezonerulequery

openharmony 鸿蒙 capi-errorcode-h

openharmony 鸿蒙 js-apis-resource-manager

openharmony 鸿蒙 js-apis-sendableResource

openharmony 鸿蒙 capi-rawfile

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/Wjx9wc4X