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...
 
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...
 
kzUint kzsResourceFileGetPosition (const struct KzsResourceFile *resourceFile)
 Gets the current position in a resource. More...
 
kzBool kzsResourceFileExists (kzString resourcePath)
 Returns true if resource exists. More...
 
kzInt kzsResourceFileGetSize (const struct KzsResourceFile *resourceFile)
 

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

#define KZS_RESOURCE_FILE_ERROR

Result value indicating that an error occurred in the function.

Function Documentation

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

Opens a resource.

kzsError kzsResourceFileDelete ( struct KzsResourceFile resourceFile)

Closes a resource.

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.

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.

kzInt kzsResourceFileGetSize ( const struct KzsResourceFile resourceFile)