Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzs_resource_file.h 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

kzsException kzsResourceFileCreate (kzString resourcePath, struct KzsResourceFile **out_resourceFile)
 Opens a resource. More...
 
kzsError kzsResourceFileDelete (struct KzsResourceFile *resourceFile)
 Closes a resource. More...
 
kzInt kzsResourceFileRead (struct KzsResourceFile *resourceFile, kzUint byteCount, kzByte *out_buffer)
 Reads bytes from a resource. More...
 
kzInt kzsResourceFileSkip (struct KzsResourceFile *resourceFile, kzUint byteCount)
 Skips bytes from a resource. More...
 
kzUint kzsResourceFileGetPosition (const struct KzsResourceFile *resourceFile)
 Gets the current position in a resource. More...
 
kzBool kzsResourceFileExists (kzString resourcePath)
 Returns true if resource exists. 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-2019 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZS_RESOURCE_FILE_ERROR

Result value indicating that an error occurred in the function.

Function Documentation

kzsException kzsResourceFileCreate ( kzString  resourcePath,
struct KzsResourceFile **  out_resourceFile 
)

Opens a resource.

kzsError kzsResourceFileDelete ( struct KzsResourceFile resourceFile)

Closes a resource.

kzInt kzsResourceFileRead ( struct KzsResourceFile resourceFile,
kzUint  byteCount,
kzByte 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.

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.

kzUint kzsResourceFileGetPosition ( const struct KzsResourceFile resourceFile)

Gets the current position in a resource.

kzBool kzsResourceFileExists ( kzString  resourcePath)

Returns true if resource exists.