Loading...
Searching...
No Matches
BALL::FileSystem Class Reference
Foundation Classes » Operating system support

`#include <BALL/SYSTEM/fileSystem.h>`

## Public Types

Enums
enum | { MAX_FILENAME_LENGTH = 256 , MAX_PATH_LENGTH = BALL_PATH_MAX }

## Static Public Attributes

Char Constants
static const char | PATH_SEPARATOR
static const char *const | CURRENT_DIRECTORY
static const char *const | PARENT_DIRECTORY

## Static methods

static void | canonizePath (String &path)
static String | baseName (const String &filename)
static String | fileExtension (const String &filename)
static String | path (const String &filename)

## Detailed Description

File System Class This class is a wrapper around some very basic properties of the machine's file system properties. The method ( canonizePath ) is mainly used by File to obtain a unique and unambiguous representation of a path.

Definition at line 41 of file fileSystem.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
MAX_FILENAME_LENGTH | The maximum length of a filename.
MAX_PATH_LENGTH | The maximum length for a full path.

Definition at line 67 of file fileSystem.h.

## Member Function Documentation

## baseName()

String BALL::FileSystem::baseName | ( | const String & | filename | ) |

static

Return the base name of a file. This strips the path from the filename, i.e. everything before and including the last occurence of PATH_SEPARATOR .

## canonizePath()

void BALL::FileSystem::canonizePath | ( | String & | path | ) |

static

Convert a given filename to a canonical name. This method creates a unique and unambiguous representation of any absolute or relative path. It expands the user's homedirectory ('~') and duplicate or redundant separators, e.g. '//' is reduced to /'/' and '/./' is removed. Also, all occurrences of PATH_SEPARATOR are canonized to '/'. NOTE: if the path starts with '\', we do not canonize further and assume it to be a UNC path.

## fileExtension()

String BALL::FileSystem::fileExtension | ( | const String & | filename | ) |

static

Return the extension of a file of present. If file has no extension an empty String is returned.

## path()

String BALL::FileSystem::path | ( | const String & | filename | ) |

static

Return the path to a file. This method returns the path to a file, i.e. everything up to and including the last occurence of PATH_SEPARATOR .

## Member Data Documentation

## CURRENT_DIRECTORY

const char* const BALL::FileSystem::CURRENT_DIRECTORY

static

The string used to indicate the current directory. This is usually '.'

Definition at line 57 of file fileSystem.h.

## PARENT_DIRECTORY

const char* const BALL::FileSystem::PARENT_DIRECTORY

static

The string indicating the parent directory. This is usually '..'

Definition at line 62 of file fileSystem.h.

## PATH_SEPARATOR

const char BALL::FileSystem::PATH_SEPARATOR

static

The character separating directories in a path. This is usually '/'.

Definition at line 52 of file fileSystem.h.