Directories
[Platform Abstraction]


Functions

bool changeDirectory (const Char *dir)
void getCurrentDirectory (Char *buffer, int bufferSize)
void getExecutableDirectory (const char *argv0, Char *buffer, int bufferSize)
char getSystemPathSeparator ()
void splitPath (const Char *path, int part, Char *buffer, int bufSize)
void makeNativePath (Char *path)
void makeGenericPath (Char *path)
DirIdx dirOpen (const Char *path)
void dirClose (DirIdx idx)
bool dirNextEntry (DirIdx idx)
const ChardirGetEntryName (DirIdx idx)

Function Documentation

bool changeDirectory const Char   dir
 

Change the current working directory.

void dirClose DirIdx    idx
 

Close a directory index.

const Char* dirGetEntryName DirIdx    idx
 

Get the name of the current directory entry.

bool dirNextEntry DirIdx    idx
 

Move to the next directory entry.

Returns:
False when there are no more entries.

DirIdx dirOpen const Char   path
 

Create an directory index, which can be iterated to examine it's contents.

void getCurrentDirectory Char   buffer,
int    bufferSize
 

Copy the current working directory path into a buffer.

void getExecutableDirectory const char *    argv0,
Char   buffer,
int    bufferSize
 

Given the argv[0] parameter supplied to main(), locate the directory containing the program's executable file.

char getSystemPathSeparator  
 

Retrieve the system's path separation character. For Unix and BeOS, this will return the forward slash '/', for Win32 the backslash '\'. MacOS, when it is supported, will return ':'.

void makeGenericPath Char   path
 

Convert from the system's native path separator character to the generic forward slash '/'.

void makeNativePath Char   path
 

Convert from the generic path seperator ('/') to the system's native path format ('\' on Win32, '/' on POSIX, ':' on MacOS.

void splitPath const Char   path,
int    part,
Char   buffer,
int    bufSize
 

Extract a specific portion of a path. Returns the requested portion in the generic path format (using '/' to separate directories).

Parameters:
path  the path
part  the section to extract:
  • DIRECTORY: the directory list
  • FILENAME: the file name and extension
  • BASENAME: the file name with no extension
  • EXTENSION: the file extension
Parameters:
buffer  buffer to hold the extracted result.
bufSize  the size of the buffer.


Flat Four Engine
Copyright (C) 2001 by 379, Inc.
This page generated by Doxygen