Final Platform Layer 0.9.9-beta
Loading...
Searching...
No Matches
Path functions

This category contains functions for retrieving and building paths. More...

Functions

fpl_common_api size_t fplChangeFileExtension (const char *filePath, const char *newFileExtension, char *destPath, const size_t maxDestLen)
 Changes the file extension on the given source path and writes the result into a destination buffer.
 
fpl_common_api const char * fplExtractFileExtension (const char *sourcePath)
 Extracts the file extension from the given source path.
 
fpl_common_api const char * fplExtractFileName (const char *sourcePath)
 Extracts the file name including the file extension from the given source path.
 
fpl_common_api size_t fplExtractFilePath (const char *sourcePath, char *destPath, const size_t maxDestLen)
 Extracts the directory path from the given file path.
 
fpl_platform_api size_t fplGetExecutableFilePath (char *destPath, const size_t maxDestLen)
 Gets the full path to this executable, including the executable file name.
 
fpl_platform_api size_t fplGetHomePath (char *destPath, const size_t maxDestLen)
 Gets the full path to your home directory.
 
fpl_common_api size_t fplPathCombine (char *destPath, const size_t maxDestPathLen, const size_t pathCount,...)
 Combines all given paths by the platform's path separator for a fixed number of arguments.
 

Detailed Description

This category contains functions for retrieving and building paths.

Function Documentation

◆ fplChangeFileExtension()

fpl_common_api size_t fplChangeFileExtension ( const char * filePath,
const char * newFileExtension,
char * destPath,
const size_t maxDestLen )

Changes the file extension on the given source path and writes the result into a destination buffer.

Parameters
[in]filePathThe file path to search for the extension.
[in]newFileExtensionThe new file extension.
[out]destPathThe destination buffer.
[in]maxDestLenThe total number of characters available in the destination buffer.
Returns
Returns the number of required/written characters, excluding the null-terminator.
See also
Changing the file extension

◆ fplExtractFileExtension()

fpl_common_api const char * fplExtractFileExtension ( const char * sourcePath)

Extracts the file extension from the given source path.

Parameters
[in]sourcePathThe source path to extract from.
Returns
Returns the pointer to the first character of the extension.
See also
Extracting the file extension

◆ fplExtractFileName()

fpl_common_api const char * fplExtractFileName ( const char * sourcePath)

Extracts the file name including the file extension from the given source path.

Parameters
[in]sourcePathThe source path to extract from.
Returns
Returns the pointer to the first character of the filename.
See also
Extracting the file name

◆ fplExtractFilePath()

fpl_common_api size_t fplExtractFilePath ( const char * sourcePath,
char * destPath,
const size_t maxDestLen )

Extracts the directory path from the given file path.

Parameters
[in]sourcePathThe source path to extract from.
[out]destPathThe destination buffer.
[in]maxDestLenThe total number of characters available in the destination buffer.
Returns
Returns the number of required/written characters, excluding the null-terminator.
See also
Extracting the file path

◆ fplGetExecutableFilePath()

fpl_platform_api size_t fplGetExecutableFilePath ( char * destPath,
const size_t maxDestLen )

Gets the full path to this executable, including the executable file name.

Parameters
[out]destPathThe destination buffer.
[in]maxDestLenThe total number of characters available in the destination buffer.
Returns
Returns the number of required/written characters, excluding the null-terminator.
See also
Get executable file path

◆ fplGetHomePath()

fpl_platform_api size_t fplGetHomePath ( char * destPath,
const size_t maxDestLen )

Gets the full path to your home directory.

Parameters
[out]destPathThe destination buffer.
[in]maxDestLenThe total number of characters available in the destination buffer.
Returns
Returns the number of required/written characters, excluding the null-terminator.
See also
Getting the home directory path

◆ fplPathCombine()

fpl_common_api size_t fplPathCombine ( char * destPath,
const size_t maxDestPathLen,
const size_t pathCount,
... )

Combines all given paths by the platform's path separator for a fixed number of arguments.

Parameters
[out]destPathThe destination buffer.
[in]maxDestPathLenThe total number of characters available in the destination buffer.
[in]pathCountThe number of dynamic path arguments.
[in]...The dynamic path arguments.
Returns
Returns the number of required/written characters, excluding the null-terminator.
See also
Combining paths