Zen API
 All Classes Files Functions Variables Typedefs Macros Groups Pages
kDirectory Class Reference

Description

Collection of directory-related functions.

Public Member Functions

kStatus kDirectory_AppConfig (const kChar *appName, kChar *directory, kSize capacity)
 Gets the directory from which an application should load its configuration/resource files. More...
 
kStatus kDirectory_AppData (const kChar *appName, kChar *directory, kSize capacity)
 Gets a directory suitable for an application to write data files. More...
 
kStatus kDirectory_Application (kChar *directory, kSize capacity)
 Gets the directory in which the application executable file resides. More...
 
kStatus kDirectory_Copy (const kChar *source, const kChar *destination)
 Copies the specified directory, including all of its contents. More...
 
kStatus kDirectory_Create (const kChar *directory)
 Creates a directory at the specified location. More...
 
kStatus kDirectory_Current (kChar *directory, kSize capacity)
 Gets the current working directory. More...
 
kStatus kDirectory_Delete (const kChar *directory)
 Deletes the specified directory, including all of its contents. More...
 
kBool kDirectory_Exists (const kChar *directory)
 Reports whether the specified directory exists. More...
 
kStatus kDirectory_ListDirectories (const kChar *directory, kArrayList directories)
 Creates a list of the sub-directories in the specified directory. More...
 
kStatus kDirectory_ListEntries (const kChar *directory, kArrayList entries)
 Creates a list of the file system entries in the specified directory. More...
 
kStatus kDirectory_ListFiles (const kChar *directory, kArrayList files)
 List the files in the specified directory. More...
 
kStatus kDirectory_Move (const kChar *source, const kChar *destination)
 Moves the specified directory, including all of its contents. More...
 
kStatus kDirectory_Plugin (kChar *directory, kSize capacity)
 Gets the directory where plug-ins are located. More...
 
kStatus kDirectory_SetCurrent (const kChar *directory)
 Sets the current working directory. More...
 
kStatus kDirectory_Temp (kChar *directory, kSize capacity)
 Gets the path of a directory suitable for temporary files. More...
 

Member Function Documentation

kStatus kDirectory_AppConfig ( const kChar appName,
kChar directory,
kSize  capacity 
)

Gets the directory from which an application should load its configuration/resource files.

This function assumes the standard folder organization of a kApi-based application.

Parameters
appNameThe name of the application (optional).
directoryReturns the full path of the requested directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.
kStatus kDirectory_AppData ( const kChar appName,
kChar directory,
kSize  capacity 
)

Gets a directory suitable for an application to write data files.

This function assumes the standard folder organization of a kApi-based application.

Parameters
appNameThe name of the application (optional).
directoryReturns the full path of the requested directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.
kStatus kDirectory_Application ( kChar directory,
kSize  capacity 
)

Gets the directory in which the application executable file resides.

Parameters
directoryReturns the full path of the application directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.
kStatus kDirectory_Copy ( const kChar source,
const kChar destination 
)

Copies the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters
sourceFull path of the source directory.
destinationFull path of the destination directory.
Returns
Operation status.
kStatus kDirectory_Create ( const kChar directory)

Creates a directory at the specified location.

This function will fail if the directory already exists. Missing parent folders will be created automatically.

This function is only supported on Windows at this time.

Parameters
directoryFull path of the directory.
Returns
Operation status.
kStatus kDirectory_Current ( kChar directory,
kSize  capacity 
)

Gets the current working directory.

Parameters
directoryReturns the full path of the current working directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.
kStatus kDirectory_Delete ( const kChar directory)

Deletes the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters
directoryFull path of the directory.
Returns
Operation status.
kBool kDirectory_Exists ( const kChar directory)

Reports whether the specified directory exists.

This function is only supported on Windows at this time.

Parameters
directoryFull path of the directory.
Returns
kTRUE if the directory exists, kFALSE otherwise.
kStatus kDirectory_ListDirectories ( const kChar directory,
kArrayList  directories 
)

Creates a list of the sub-directories in the specified directory.

Use kArrayList_Purge to destroy the directory names returned by this function.

Parameters
directoryFull path of the directory.
directoriesReceives directory names (kArrayList<kString>).
Returns
Operation status.
kStatus kDirectory_ListEntries ( const kChar directory,
kArrayList  entries 
)

Creates a list of the file system entries in the specified directory.

Use kArrayList_Purge to destroy the entry names returned by this function.

Parameters
directoryFull path of the directory.
entriesReceives entry names (kArrayList<kString>).
Returns
Operation status.
kStatus kDirectory_ListFiles ( const kChar directory,
kArrayList  files 
)

List the files in the specified directory.

Use kArrayList_Purge to destroy the file names returned by this function.

Parameters
directoryFull path of the directory.
filesReceives file names (kArrayList<kString>).
Returns
Operation status.
kStatus kDirectory_Move ( const kChar source,
const kChar destination 
)

Moves the specified directory, including all of its contents.

This function is only supported on Windows at this time.

Parameters
sourceFull path of the source directory.
destinationFull path of the destination directory.
Returns
Operation status.
kStatus kDirectory_Plugin ( kChar directory,
kSize  capacity 
)

Gets the directory where plug-ins are located.

This function assumes the standard folder organization of a kApi-based application.

Parameters
directoryReturns the full path of the requested directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.
kStatus kDirectory_SetCurrent ( const kChar directory)

Sets the current working directory.

Parameters
directoryFull path of the desired working directory.
Returns
Operation status.
kStatus kDirectory_Temp ( kChar directory,
kSize  capacity 
)

Gets the path of a directory suitable for temporary files.

Parameters
directoryReturns the full path of the temp directory.
capacityMaximum number of characters (including null terminator).
Returns
Operation status.

The documentation for this class was generated from the following file: