diff options
Diffstat (limited to 'libs/cocos2d/Support/CCFileUtils.h')
-rwxr-xr-x | libs/cocos2d/Support/CCFileUtils.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/libs/cocos2d/Support/CCFileUtils.h b/libs/cocos2d/Support/CCFileUtils.h new file mode 100755 index 0000000..0455202 --- /dev/null +++ b/libs/cocos2d/Support/CCFileUtils.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * cocos2d for iPhone: http://www.cocos2d-iphone.org | ||
3 | * | ||
4 | * Copyright (c) 2008-2010 Ricardo Quesada | ||
5 | * Copyright (c) 2011 Zynga Inc. | ||
6 | * | ||
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
8 | * of this software and associated documentation files (the "Software"), to deal | ||
9 | * in the Software without restriction, including without limitation the rights | ||
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
11 | * copies of the Software, and to permit persons to whom the Software is | ||
12 | * furnished to do so, subject to the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice shall be included in | ||
15 | * all copies or substantial portions of the Software. | ||
16 | * | ||
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
20 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
23 | * THE SOFTWARE. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | |||
28 | #import <Foundation/Foundation.h> | ||
29 | |||
30 | |||
31 | /** Helper class to handle file operations */ | ||
32 | @interface CCFileUtils : NSObject | ||
33 | { | ||
34 | } | ||
35 | |||
36 | /** Returns the fullpath of an filename. | ||
37 | |||
38 | If this method is when Retina Display is enabled, then the | ||
39 | Retina Display suffix will be appended to the file (See ccConfig.h). | ||
40 | |||
41 | If the Retina Display image doesn't exist, then it will return the "non-Retina Display" image | ||
42 | |||
43 | */ | ||
44 | +(NSString*) fullPathFromRelativePath:(NSString*) relPath; | ||
45 | @end | ||
46 | |||
47 | /** loads a file into memory. | ||
48 | the caller should release the allocated buffer. | ||
49 | |||
50 | @returns the size of the allocated buffer | ||
51 | @since v0.99.5 | ||
52 | */ | ||
53 | NSInteger ccLoadFileIntoMemory(const char *filename, unsigned char **out); | ||
54 | |||
55 | |||
56 | /** removes the HD suffix from a path | ||
57 | |||
58 | @returns NSString * without the HD suffix | ||
59 | @since v0.99.5 | ||
60 | */ | ||
61 | NSString *ccRemoveHDSuffixFromFile( NSString *path ); | ||
62 | |||