00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_SYSTEM_FILESYSTEM_H
00008 #define BALL_SYSTEM_FILESYSTEM_H
00009
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013
00014 #include <limits.h>
00015 #ifdef BALL_HAS_SYS_PARAM_H
00016 # include <sys/param.h>
00017 #endif
00018
00019
00020
00021
00022 #ifndef PATH_MAX
00023 # define BALL_PATH_MAX 1023
00024 #else
00025 # define BALL_PATH_MAX PATH_MAX
00026 #endif
00027
00028 #ifndef BALL_DATATYPE_STRING_H
00029 # include <BALL/DATATYPE/string.h>
00030 #endif
00031
00032 namespace BALL
00033 {
00042 class BALL_EXPORT FileSystem
00043 {
00044 public:
00045
00049
00053 static const char PATH_SEPARATOR;
00054
00058 static const char* const CURRENT_DIRECTORY;
00059
00063 static const char* const PARENT_DIRECTORY;
00065
00068 enum
00069 {
00072 MAX_FILENAME_LENGTH = 256,
00075 MAX_PATH_LENGTH = BALL_PATH_MAX
00076 };
00077
00081
00089 static void canonizePath(String& path);
00090
00095 static String baseName(const String& filename);
00096
00101 static String path(const String& filename);
00103
00104 private:
00105
00106 static void expandTilde_(String& path);
00107 };
00108
00109 }
00110
00111 #endif // BALL_SYSTEM_FILESYSTEM_H