MPIO v1.4.0
directory.h File Reference

Common directory functions. More...

#include <stdbool.h>

Functions

bool createDirectory (const char *path)
 Creates a new directory, if it do not already exist. (MT-Safe)
 
bool isDirectoryExists (const char *path)
 Returns true if directory exists. (MT-Safe)
 
char * getDataDirectory (bool isShared)
 Returns application data directory. (MT-Safe)
 
char * getAppDataDirectory (const char *appName, bool isShared)
 Returns application data directory + name. (MT-Safe)
 
char * getResourcesDirectory ()
 Returns bundled resources directory. (MT-Safe)
 

Detailed Description

Common directory functions.

Function Documentation

◆ createDirectory()

bool createDirectory ( const char * path)

Creates a new directory, if it do not already exist. (MT-Safe)

Parameters
[in]pathtarget directory path string
Returns
True if a new directory was created, otherwise false.

◆ isDirectoryExists()

bool isDirectoryExists ( const char * path)

Returns true if directory exists. (MT-Safe)

Parameters
[in]pathtarget directory path string

◆ getDataDirectory()

char * getDataDirectory ( bool isShared)

Returns application data directory. (MT-Safe)

The resulting path can be used to store data between application runs, saves, downloaded updates.

Note
You should free() allocated string manually.
Parameters
isSharedis data directory shared between multiple users
Returns
An allocated data directory string on success, otherwise NULL.

◆ getAppDataDirectory()

char * getAppDataDirectory ( const char * appName,
bool isShared )

Returns application data directory + name. (MT-Safe)

The resulting path can be used to store data between application runs, saves, downloaded updates.

Note
You should free() allocated string manually.
Parameters
[in]appNametarget application name string
isSharedis data directory shared between multiple users
Returns
An allocated data directory string on success, otherwise NULL.

◆ getResourcesDirectory()

char * getResourcesDirectory ( )

Returns bundled resources directory. (MT-Safe)

This function returns the path to the resources within the built application. It is needed on macOS, iOS, Android to load bundled resources at runtime.

Note
You should free() allocated string manually.
Returns
An allocated resources directory string on success, otherwise NULL.