[ Home ]

file_string.c File Reference

Path and file name string manipulation. More...

#include <string.h>
#include <stdio.h>
#include "../common/common_utils.h"
#include "../common/platform.h"
#include "../string/wtstring.h"

Include dependency graph for file_string.c:


Functions

PUBLIC char * FS_getFileName (char *path)
 Returns file name from path string.
PUBLIC void FS_RemoveExtension (const char *in, char *out)
 Removes file extension from path string.
PUBLIC char * FS_getFileExtension (const char *in)
 Returns file extension from path string.
PUBLIC wtBoolean FS_getFileBase (const char *in, char *out, W32 size_out)
 Returns base file name from path string.
PUBLIC wtBoolean FS_getPath (const char *in, char *out, W32 size_out)
 Returns path from full path.

Detailed Description

Path and file name string manipulation.

Author:
Michael Liebscher
Date:
2006-2007

Function Documentation

PUBLIC wtBoolean FS_getFileBase ( const char *  in,
char *  out,
W32  size_out 
)

Returns base file name from path string.

Parameters:
[in] in Path to get file extension from.
[in,out] out File name.
[in] size_out Size of out buffer in bytes.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

PUBLIC char* FS_getFileExtension ( const char *  in  ) 

Returns file extension from path string.

Parameters:
[in] in Path to get file extension from.
Returns:
Pointer to file extension, otherwise NULL.
Note:
Extension cannot be longer than 31 characters.

PUBLIC char* FS_getFileName ( char *  path  ) 

Returns file name from path string.

Parameters:
[in] path Path to get file name from.
Returns:
Pointer to start of file name, otherwise NULL.

PUBLIC wtBoolean FS_getPath ( const char *  in,
char *  out,
W32  size_out 
)

Returns path from full path.

Parameters:
[in] in Path with file name.
[in,out] out path.
[in] size_out Size of out buffer in bytes.
Returns:
On success true, otherwise false.

Here is the call graph for this function:

PUBLIC void FS_RemoveExtension ( const char *  in,
char *  out 
)

Removes file extension from path string.

Parameters:
[in] in Path to remove file extension.
[in] out Pointer to hold path string.
Returns:
Nothing.