BALL
1.5.0
include
BALL
SYSTEM
fileSystem.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
// $Id: fileSystem.h,v 1.14 2005/07/29 12:38:14 amoll Exp $
5
//
6
7
#ifndef BALL_SYSTEM_FILESYSTEM_H
8
#define BALL_SYSTEM_FILESYSTEM_H
9
10
#ifndef BALL_COMMON_H
11
# include <
BALL/common.h
>
12
#endif
13
14
#ifdef BALL_HAS_SYS_PARAM_H
15
# include <sys/param.h>
16
#endif
17
18
// if PATH_MAX is undefined (which sometimes happens on systems
19
// where there is no unambiguous value defined due to severel differing
20
// filesystems), we define it for ourselves to be 1kB
21
#ifndef PATH_MAX
22
# define BALL_PATH_MAX 1023
23
#else
24
# define BALL_PATH_MAX PATH_MAX
25
#endif
26
27
#ifndef BALL_DATATYPE_STRING_H
28
# include <
BALL/DATATYPE/string.h
>
29
#endif
30
31
namespace
BALL
32
{
41
class
BALL_EXPORT
FileSystem
42
{
43
public
:
44
48
52
static
const
char
PATH_SEPARATOR
;
53
57
static
const
char
*
const
CURRENT_DIRECTORY
;
58
62
static
const
char
*
const
PARENT_DIRECTORY
;
64
67
enum
68
{
71
MAX_FILENAME_LENGTH = 256,
// NAME_MAX seems to be too restrictive for modern Unixes
74
MAX_PATH_LENGTH =
BALL_PATH_MAX
75
};
76
80
92
static
void
canonizePath
(
String
& path);
93
98
static
String
baseName
(
const
String
& filename);
99
103
static
String
fileExtension
(
const
String
& filename);
104
109
static
String
path
(
const
String
& filename);
111
112
private
:
113
114
static
void
expandTilde_(
String
& path);
115
};
116
117
}
// namespace BALL
118
119
#endif // BALL_SYSTEM_FILESYSTEM_H
BALL_EXPORT
#define BALL_EXPORT
Definition:
COMMON/global.h:50
BALL::FileSystem::path
static String path(const String &filename)
BALL::FileSystem::PATH_SEPARATOR
static const char PATH_SEPARATOR
Definition:
fileSystem.h:52
BALL_PATH_MAX
#define BALL_PATH_MAX
Definition:
fileSystem.h:22
BALL::FileSystem::fileExtension
static String fileExtension(const String &filename)
BALL::String
Definition:
string.h:57
BALL::FileSystem::canonizePath
static void canonizePath(String &path)
BALL
Definition:
constants.h:13
BALL::FileSystem::baseName
static String baseName(const String &filename)
string.h
BALL::FileSystem::CURRENT_DIRECTORY
static const char *const CURRENT_DIRECTORY
Definition:
fileSystem.h:57
common.h
BALL::FileSystem
Definition:
fileSystem.h:42
BALL::FileSystem::PARENT_DIRECTORY
static const char *const PARENT_DIRECTORY
Definition:
fileSystem.h:62
Generated by
1.8.20