Loading...
Searching...
No Matches
fileSystem.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: fileSystem.h,v 1.14 2005/07/29 12:38:14 amoll Exp $
//
#ifndef BALL_SYSTEM_FILESYSTEM_H
#define BALL_SYSTEM_FILESYSTEM_H
#ifndef BALL_COMMON_H
# include <BALL/common.h>
#endif
#ifdef BALL_HAS_SYS_PARAM_H
# include <sys/param.h>
#endif
// if PATH_MAX is undefined (which sometimes happens on systems
// where there is no unambiguous value defined due to severel differing
// filesystems), we define it for ourselves to be 1kB
#ifndef PATH_MAX
# define BALL_PATH_MAX 1023
#else
# define BALL_PATH_MAX PATH_MAX
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
namespace BALL
{
class BALL_EXPORT FileSystem
{
public:
static const char PATH_SEPARATOR;
static const char* const CURRENT_DIRECTORY;
static const char* const PARENT_DIRECTORY;
enum
{
MAX_FILENAME_LENGTH = 256, // NAME_MAX seems to be too restrictive for modern Unixes
MAX_PATH_LENGTH = BALL_PATH_MAX
};
static void canonizePath(String& path);
static String baseName(const String& filename);
static String fileExtension(const String& filename);
static String path(const String& filename);
private:
static void expandTilde_(String& path);
};
} // namespace BALL
#endif // BALL_SYSTEM_FILESYSTEM_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::FileSystem
Definition fileSystem.h:42
BALL::FileSystem::canonizePath
static void canonizePath(String &path)
BALL::FileSystem::path
static String path(const String &filename)
BALL::FileSystem::PARENT_DIRECTORY
static const char *const PARENT_DIRECTORY
Definition fileSystem.h:62
BALL::FileSystem::PATH_SEPARATOR
static const char PATH_SEPARATOR
Definition fileSystem.h:52
BALL::FileSystem::CURRENT_DIRECTORY
static const char *const CURRENT_DIRECTORY
Definition fileSystem.h:57
BALL::FileSystem::fileExtension
static String fileExtension(const String &filename)
BALL::FileSystem::MAX_FILENAME_LENGTH
@ MAX_FILENAME_LENGTH
Definition fileSystem.h:71
BALL::FileSystem::MAX_PATH_LENGTH
@ MAX_PATH_LENGTH
Definition fileSystem.h:74
BALL::FileSystem::baseName
static String baseName(const String &filename)
BALL::String
Definition string.h:57
common.h
BALL_PATH_MAX
#define BALL_PATH_MAX
Definition fileSystem.h:22
BALL
Definition constants.h:13
string.h