4 Copyright (C) 1995, 1996 Ovidiu Predescu and Mircea Oancea.
7 Author: Mircea Oancea <mircea@jupiter.elcom.pub.ro>
9 This file is part of libFoundation.
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted, provided
13 that the above copyright notice appear in all copies and that both that
14 copyright notice and this permission notice appear in supporting
17 We disclaim all warranties with regard to this software, including all
18 implied warranties of merchantability and fitness, in no event shall
19 we be liable for any special, indirect or consequential damages or any
20 damages whatsoever resulting from loss of use, data or profits, whether in
21 an action of contract, negligence or other tortious action, arising out of
22 or in connection with the use or performance of this software.
25 #ifndef __NSPathUtilities_h__
26 #define __NSPathUtilities_h__
28 #include <Foundation/NSString.h>
34 LF_EXPORT NSString *NSUserName(void);
35 LF_EXPORT NSString *NSHomeDirectory(void);
36 LF_EXPORT NSString *NSHomeDirectoryForUser(NSString* userName);
38 LF_EXPORT NSString *NSFullUserName();
39 LF_EXPORT NSString *NSTemporaryDirectory();
42 * Standard System Paths, primarily useful in the GNUstep environment
47 NSLocalDomainMask = 2,
48 NSNetworkDomainMask = 4,
49 NSSystemDomainMask = 8,
50 NSAllDomainsMask = 255
51 } NSSearchPathDomainMask;
54 NSApplicationDirectory = 1,
57 NSAllApplicationDirectory = 1000,
58 NSAllLibrariesDirectory
59 } NSSearchPathDirectory;
61 @class NSString, NSArray;
63 LF_EXPORT NSString *NSOpenStepRootDirectory(void);
64 LF_EXPORT NSArray *NSStandardLibraryPaths(void);
65 LF_EXPORT NSArray *NSStandardApplicationPaths(void);
68 NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory _directory,
69 NSSearchPathDomainMask _mask,
73 * String file naming utilities
76 @interface NSString(FilePathMethods)
78 + (NSString *)pathWithComponents:(NSArray *)components;
79 - (NSArray *)pathComponents;
80 - (unsigned int)completePathIntoString:(NSString **)outputName
81 caseSensitive:(BOOL)flag matchesIntoArray:(NSArray **)outputArray
82 filterTypes:(NSArray*)filterTypes;
83 - (const char *)fileSystemRepresentation;
84 - (BOOL)getFileSystemRepresentation:(char *)buffer
85 maxLength:(unsigned int)maxLength;
86 - (BOOL)isAbsolutePath;
87 - (NSString *)lastPathComponent;
88 - (NSString *)pathExtension;
89 - (NSString *)stringByAbbreviatingWithTildeInPath;
90 - (NSString *)stringByAppendingPathComponent:(NSString *)aString;
91 - (NSString *)stringByAppendingPathExtension:(NSString *)aString;
92 - (NSString *)stringByDeletingLastPathComponent;
93 - (NSString *)stringByDeletingPathExtension;
94 - (NSString *)stringByExpandingTildeInPath;
95 - (NSString *)stringByResolvingSymlinksInPath;
96 - (NSString *)stringByStandardizingPath;
97 - (NSArray *)stringsByAppendingPaths:(NSArray *)paths;
101 #endif /* __NSPathUtilities_h__ */
103 #ifndef __NSPathUtilitiesArray_h__
104 #define __NSPathUtilitiesArray_h__
106 #include <Foundation/NSArray.h>
108 @interface NSArray(FilePathMethods)
110 - (NSArray *)pathsMatchingExtensions:(NSArray *)_exts; /* new in MacOSX */
114 #endif /* __NSPathUtilitiesArray_h__ */