跳至内容

FileIO

导航: 示例Cauldron杂项

FileIO

为 FidelityFX Cauldron 框架提供文件读写支持。

函数

ReadFileAll

int64_t ReadFileAll(const wchar_t *fileName, void *buffer, size_t bufferLen)

执行完整的读取文件操作。

返回: 读取的字节数。

参数

  • fileName (constwchar_t *) – [输入] 要读取的文件。
  • buffer (void *) – [输入] 用于复制读取文件数据的缓冲区。
  • bufferLen (size_t) – [输入] 要读取的数据量。

返回: int64_t

来源: framework/cauldron/framework/inc/misc/fileio.h (第 46 行, 第 13 列)

ReadFilePartial

int64_t ReadFilePartial(const wchar_t *fileName, void *buffer, size_t bufferLen, int64_t readOffset=0)

执行部分读取文件操作。

返回: 读取的字节数。

参数

  • fileName (constwchar_t *) – [输入] 要读取的文件。
  • buffer (void *) – [输入] 用于复制读取文件数据的缓冲区。
  • bufferLen (size_t) – [输入] 要读取的数据量。
  • readOffset (int64_t) – [输入] 开始读取的文件偏移量。

返回: int64_t

来源: framework/cauldron/framework/inc/misc/fileio.h (第 58 行, 第 13 列)

GetFileSize

int64_t GetFileSize(const wchar_t *fileName)

获取文件大小(以字节为单位)。

返回: 文件中包含的字节数。

参数

  • fileName (const wchar_t *) – [输入] 要查询大小的文件。

返回: int64_t

来源: framework/cauldron/framework/inc/misc/fileio.h (第 67 行, 第 13 列)

ParseJsonFile

bool ParseJsonFile(const wchar_t *fileName, json &jsonOut)

读取和解析 json 文件的辅助函数。

返回: 如果操作成功,则返回 True,否则返回 False。

参数

  • fileName (const wchar_t *) – [输入] 要读取和解析的 json 文件。
  • jsonOut (json &) – [输出] 从文件中读取的 json 数据。

返回: bool

来源: framework/cauldron/framework/inc/misc/fileio.h (第 77 行, 第 10 列)

© . This site is unofficial and not affiliated with AMD.