Merge pull request #9 from gunyarakun/fix-typo
[cocotron.git] / Foundation / NSBundle.h
blobea936accaa5be279652aa07789d8b3651d847199
1 /* Copyright (c) 2006-2007 Christopher J. W. Lloyd
3 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
9 #import <Foundation/NSObject.h>
11 @class NSArray, NSDictionary, NSString, NSError, NSMutableDictionary, NSURL;
13 FOUNDATION_EXPORT NSString *const NSBundleDidLoadNotification;
14 FOUNDATION_EXPORT NSString *const NSLoadedClasses;
16 @interface NSBundle : NSObject {
17 NSString *_path;
18 NSString *_resourcePath;
19 NSString *_pluginPath;
20 NSDictionary *_infoDictionary;
21 NSString *_executablePath;
22 NSArray *_lookInDirectories;
23 NSMutableDictionary *_localizedTables;
24 BOOL _isLoaded;
27 + (NSArray *)allBundles;
28 + (NSArray *)allFrameworks;
30 + (NSBundle *)mainBundle;
32 + (NSBundle *)bundleForClass:(Class)aClass;
33 + (NSBundle *)bundleWithIdentifier:(NSString *)identifier;
34 + (NSBundle *)bundleWithPath:(NSString *)path;
36 + (NSString *)pathForResource:(NSString *)name ofType:(NSString *)type inDirectory:(NSString *)path;
37 + (NSArray *)pathsForResourcesOfType:(NSString *)type inDirectory:(NSString *)path;
38 + (NSArray *)preferredLocalizationsFromArray:(NSArray *)localizations;
39 + (NSArray *)preferredLocalizationsFromArray:(NSArray *)localizations forPreferences:(NSArray *)preferences;
41 - initWithPath:(NSString *)path;
43 - (NSString *)bundlePath;
44 - (NSString *)resourcePath;
45 - (NSString *)builtInPlugInsPath;
46 - (NSDictionary *)infoDictionary;
47 - (NSDictionary *)localizedInfoDictionary;
48 - objectForInfoDictionaryKey:(NSString *)key;
49 - (NSString *)bundleIdentifier;
50 - (NSString *)developmentLocalization;
51 - (NSArray *)executableArchitectures;
52 - (NSString *)executablePath;
53 - (NSArray *)localizations;
54 - (NSArray *)preferredLocalizations;
55 - (NSString *)privateFrameworksPath;
56 - (NSString *)sharedFrameworksPath;
57 - (NSString *)sharedSupportPath;
59 - (NSString *)pathForAuxiliaryExecutable:(NSString *)executable;
61 - (Class)principalClass;
62 - (Class)classNamed:(NSString *)className;
64 - (BOOL)isLoaded;
65 - (BOOL)preflightAndReturnError:(NSError **)error;
67 - (BOOL)load;
68 - (BOOL)loadAndReturnError:(NSError **)error;
69 - (BOOL)unload;
71 - (NSURL *)URLForResource:(NSString *)name withExtension:(NSString *)ext;
72 - (NSURL *)URLForResource:(NSString *)name withExtension:(NSString *)ext subdirectory:(NSString *)subpath;
73 - (NSURL *)URLForResource:(NSString *)name withExtension:(NSString *)ext subdirectory:(NSString *)subpath localization:(NSString *)localizationName;
75 - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)type;
76 - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)type inDirectory:(NSString *)path;
77 - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)type inDirectory:(NSString *)path forLocalization:(NSString *)localization;
79 - (NSArray *)pathsForResourcesOfType:(NSString *)type inDirectory:(NSString *)path;
80 - (NSArray *)pathsForResourcesOfType:(NSString *)type inDirectory:(NSString *)path forLocalization:(NSString *)localization;
82 - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)value table:(NSString *)table;
84 @end
86 FOUNDATION_EXPORT NSString *NSLocalizedString(NSString *key, NSString *comment);
87 FOUNDATION_EXPORT NSString *NSLocalizedStringFromTable(NSString *key, NSString *table, NSString *comment);
88 FOUNDATION_EXPORT NSString *NSLocalizedStringFromTableInBundle(NSString *key, NSString *table, NSBundle *bundle, NSString *comment);