Kanzi Framework  3.9.0
Kanzi Engine API
kzs_resource_file.hpp File Reference

Resource file reading functions. More...

Macros

#define KZS_RESOURCE_FILE_ERROR
 Result value indicating that an error occurred in the function. More...
 

Functions

kzsError kzsResourceFileCreate (kzString resourceDirectory, kzString resourcePath, struct KzsResourceFile **out_resourceFile)
 Opens a resource. More...
 
kzsError kzsResourceFileDelete (struct KzsResourceFile *resourceFile)
 Closes a resource. More...
 
kzBool kzsResourceFileExists (kzString resourcePath)
 Returns true if resource exists. More...
 
kzUint kzsResourceFileGetPosition (const struct KzsResourceFile *resourceFile)
 Gets the current position in a resource. More...
 
kzInt kzsResourceFileGetSize (const struct KzsResourceFile *resourceFile)
 
kzInt kzsResourceFileRead (struct KzsResourceFile *resourceFile, kzUint byteCount, kanzi::byte *out_buffer)
 Reads bytes from a resource. More...
 
kzInt kzsResourceFileSkip (struct KzsResourceFile *resourceFile, kzUint byteCount)
 Skips bytes from a resource. More...
 

Detailed Description

Resource file reading functions.

Resource files provide simplified API for reading files (but not writing). This is the recommended API for reading resource files of the application, since full file-system API might not be available on all platforms.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

◆ KZS_RESOURCE_FILE_ERROR

#define KZS_RESOURCE_FILE_ERROR

Result value indicating that an error occurred in the function.

Function Documentation

◆ kzsResourceFileCreate()

kzsError kzsResourceFileCreate ( kzString  resourceDirectory,
kzString  resourcePath,
struct KzsResourceFile **  out_resourceFile 
)

Opens a resource.

◆ kzsResourceFileDelete()

kzsError kzsResourceFileDelete ( struct KzsResourceFile resourceFile)

Closes a resource.

◆ kzsResourceFileRead()

kzInt kzsResourceFileRead ( struct KzsResourceFile resourceFile,
kzUint  byteCount,
kanzi::byte out_buffer 
)

Reads bytes from a resource.

Returns the number of bytes read. Returns 0 if no bytes could be read, because the resource has been completely finished. Returns KZS_RESOURCE_FILE_ERROR if an error occurred.

◆ kzsResourceFileSkip()

kzInt kzsResourceFileSkip ( struct KzsResourceFile resourceFile,
kzUint  byteCount 
)

Skips bytes from a resource.

Returns the number of bytes skipped. Returns 0 if no bytes could be skipped, because the resource has been completely finished. Returns KZS_RESOURCE_FILE_ERROR if an error occurred.

◆ kzsResourceFileGetPosition()

kzUint kzsResourceFileGetPosition ( const struct KzsResourceFile resourceFile)

Gets the current position in a resource.

◆ kzsResourceFileExists()

kzBool kzsResourceFileExists ( kzString  resourcePath)

Returns true if resource exists.

◆ kzsResourceFileGetSize()

kzInt kzsResourceFileGetSize ( const struct KzsResourceFile resourceFile)