/usr/include/BALL/SYSTEM/fileSystem.h is in libball1.4-dev 1.4.1+20111206-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | // -*- 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
#include <limits.h>
#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
{
/** File System Class
This class is a wrapper around some very basic properties
of the machine's file system properties.
The method ( \link FileSystem::canonizePath canonizePath \endlink ) is mainly used
by \link File File \endlink to obtain a unique and unambiguous representation
of a path.
\ingroup System
*/
class BALL_EXPORT FileSystem
{
public:
/** @name Char Constants
*/
//@{
/** The character separating directories in a path.
This is usually <tt>'/'</tt>.
*/
static const char PATH_SEPARATOR;
/** The string used to indicate the current directory.
This is usually <tt>'.'</tt>
*/
static const char* const CURRENT_DIRECTORY;
/** The string indicating the parent directory.
This is usually <tt>'..'</tt>
*/
static const char* const PARENT_DIRECTORY;
//@}
/** @name Enums
*/
enum
{
/** The maximum length of a filename.
*/
MAX_FILENAME_LENGTH = 256, // NAME_MAX seems to be too restrictive for modern Unixes
/** The maximum length for a full path.
*/
MAX_PATH_LENGTH = BALL_PATH_MAX
};
/** @name Static methods
*/
//@{
/** 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 (<tt>'~'</tt>) and
duplicate or redundant separators, e.g.
'//' is reduced to /'/' and '/./' is removed.
Also, all occurrences of \link FileSystem::PATH_SEPARATOR PATH_SEPARATOR \endlink
are canonized to '/'.
NOTE: if the path starts with '\\', we do not canonize further and assume it to
be a UNC path.
*/
static void canonizePath(String& path);
/** Return the base name of a file.
This strips the path from the filename, i.e. everything
before and including the last occurence of \link FileSystem::PATH_SEPARATOR PATH_SEPARATOR \endlink .
*/
static String baseName(const String& filename);
/** 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 \link FileSystem::PATH_SEPARATOR PATH_SEPARATOR \endlink .
*/
static String path(const String& filename);
//@}
private:
static void expandTilde_(String& path);
};
} // namespace BALL
#endif // BALL_SYSTEM_FILESYSTEM_H
|