kzc_file.hpp File Reference

Core file utilities. More...

Macros

#define KZ_FEATURE_MISC
 

Functions

KANZI_API kzsError kzcFileGetExtension (const struct KzcMemoryManager *memoryManger, kzString filePath, kzMutableString *out_extension)
 Get the file extension of a file with given path. More...
 
KANZI_API kzsException kzcFileReadBinaryFile (const struct KzcMemoryManager *memoryManager, kzString filePath, kzUint *out_size, kanzi::byte **out_data)
 Reads binary content of a file with given path. More...
 
KANZI_API kzsException kzcFileReadBinaryResource (const struct KzcMemoryManager *memoryManager, kzString resourcePath, kzUint *out_size, kanzi::byte **out_data)
 Reads binary content of a resource with given path. More...
 
KANZI_API kzsException kzcFileReadTextFile (const struct KzcMemoryManager *memoryManager, kzString filePath, kzMutableString *out_string)
 Reads the data from the file system to the string with given path. More...
 
KANZI_API kzsException kzcFileReadTextFileLines (const struct KzcMemoryManager *memoryManager, kzString filePath, kzMutableString **out_lines)
 Reads text lines of a file with given path. More...
 
KANZI_API kzsException kzcFileReadTextResource (const struct KzcMemoryManager *memoryManager, kzString filePath, kzMutableString *out_string)
 Reads the data from a resource file to the string with given path. More...
 
KANZI_API kzsException kzcFileReadTextResourceLines (const struct KzcMemoryManager *memoryManager, kzString resourcePath, kzMutableString **out_lines)
 Reads text lines of a resource file with given path. More...
 
KANZI_API kzsException kzcFileWriteBinaryFile (const struct KzcMemoryManager *memoryManager, kzString filePath, kzUint size, const kanzi::byte *data)
 Writes binary data to a file with given path. More...
 
KANZI_API kzsException kzcFileWriteTextFile (const struct KzcMemoryManager *memoryManager, kzString filePath, kzUint lineCount, const kzString *lines)
 Writes text lines to a file with given path. More...
 
KANZI_API kzBool kzcFileExists (kzString filePath)
 Returns true if file exists. More...
 

Detailed Description

Core file utilities.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

#define KZ_FEATURE_MISC

Function Documentation

KANZI_API kzsError kzcFileGetExtension ( const struct KzcMemoryManager memoryManger,
kzString  filePath,
kzMutableString out_extension 
)

Get the file extension of a file with given path.

KANZI_API kzsException kzcFileReadBinaryFile ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzUint out_size,
kanzi::byte **  out_data 
)

Reads binary content of a file with given path.

The caller must free the returned data using kzcMemoryFreePointer().

KANZI_API kzsException kzcFileReadBinaryResource ( const struct KzcMemoryManager memoryManager,
kzString  resourcePath,
kzUint out_size,
kanzi::byte **  out_data 
)

Reads binary content of a resource with given path.

The caller must free the returned data using kzcMemoryFreePointer().

KANZI_API kzsException kzcFileReadTextFile ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzMutableString out_string 
)

Reads the data from the file system to the string with given path.

KANZI_API kzsException kzcFileReadTextFileLines ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzMutableString **  out_lines 
)

Reads text lines of a file with given path.

KANZI_API kzsException kzcFileReadTextResource ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzMutableString out_string 
)

Reads the data from a resource file to the string with given path.

The behavior is platform dependent. E.g. in Android, a "file" is something on the file system and a "resource" is inside APK. In Windows the path for "resources" can be configured.

KANZI_API kzsException kzcFileReadTextResourceLines ( const struct KzcMemoryManager memoryManager,
kzString  resourcePath,
kzMutableString **  out_lines 
)

Reads text lines of a resource file with given path.

KANZI_API kzsException kzcFileWriteBinaryFile ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzUint  size,
const kanzi::byte data 
)

Writes binary data to a file with given path.

KANZI_API kzsException kzcFileWriteTextFile ( const struct KzcMemoryManager memoryManager,
kzString  filePath,
kzUint  lineCount,
const kzString lines 
)

Writes text lines to a file with given path.

KANZI_API kzBool kzcFileExists ( kzString  filePath)

Returns true if file exists.