Oolite
Loading...
Searching...
No Matches
NSFileManagerOOExtensions.h
Go to the documentation of this file.
1/*
2
3NSFileManagerOOExtensions.h
4
5This extends NSFileManager and adds some methods to insulate the
6main oolite code from the gory details of creating/chdiring to the
7commander save directory, as well as handling OXZ inspection
8
9Oolite
10Copyright (C) 2004-2013 Giles C Williams and contributors
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU General Public License for more details.
21
22You should have received a copy of the GNU General Public License
23along with this program; if not, write to the Free Software
24Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
25MA 02110-1301, USA.
26
27*/
28
29#pragma once
30
31#import "OOFoundation.h"
32
33#define SAVEDIR "oolite-saves"
34
35#if OOLITE_SDL
36#define SNAPSHOTDIR "snapshots"
37#endif
38
39@interface NSFileManager (OOExtensions)
40
41- (NSArray*)commanderContentsOfPath:(NSString*)savePath;
42- (NSString*)defaultCommanderPath;
43
44/*
45 Wrappers for methods that were deprecated in Leopard but whose replacements
46 still aren't in GNUstep.
47*/
48- (NSArray*)oo_directoryContentsAtPath:(NSString*)path;
49- (BOOL)oo_createDirectoryAtPath:(NSString*)path attributes:(NSDictionary*)attributes;
50- (NSDictionary*)oo_fileAttributesAtPath:(NSString*)path traverseLink:(BOOL)yorn;
51- (NSDictionary*)oo_fileSystemAttributesAtPath:(NSString*)path;
52- (BOOL)oo_removeItemAtPath:(NSString*)path;
53- (BOOL)oo_moveItemAtPath:(NSString*)src toPath:(NSString*)dest;
54
55#if OOLITE_SDL
56- (BOOL)chdirToSnapshotPath;
57#endif
58
59// this also checks inside OXZ files; always returns NO for directories
60- (BOOL)oo_oxzFileExistsAtPath:(NSString*)path;
61
62@end