1995-03-23 03:47:56 +00:00
|
|
|
/* Interface for NSBundle for GNUStep
|
1999-04-22 21:26:10 +00:00
|
|
|
Copyright (C) 1995, 1997, 1999 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
|
|
|
Date: 1995
|
1995-03-23 03:47:56 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-03-23 03:47:56 +00:00
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Library General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
1999-09-09 02:56:20 +00:00
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1999-09-16 07:21:34 +00:00
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef __NSBundle_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSBundle_h_GNUSTEP_BASE_INCLUDE
|
1995-03-18 17:15:15 +00:00
|
|
|
|
1995-04-17 21:13:20 +00:00
|
|
|
#include <Foundation/NSObject.h>
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
@class NSArray;
|
1997-01-06 22:30:33 +00:00
|
|
|
@class NSDictionary;
|
1999-04-22 21:26:10 +00:00
|
|
|
@class NSMutableDictionary;
|
1997-01-06 22:30:33 +00:00
|
|
|
|
2000-06-14 04:03:56 +00:00
|
|
|
GS_EXPORT NSString* NSBundleDidLoadNotification;
|
|
|
|
GS_EXPORT NSString* NSShowNonLocalizedStrings;
|
|
|
|
GS_EXPORT NSString* NSLoadedClasses;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
@interface NSBundle : NSObject
|
|
|
|
{
|
1999-04-22 21:26:10 +00:00
|
|
|
NSString *_path;
|
|
|
|
NSArray *_bundleClasses;
|
|
|
|
Class _principalClass;
|
|
|
|
NSDictionary *_infoDict;
|
|
|
|
NSMutableDictionary *_localizations;
|
|
|
|
unsigned _bundleType;
|
|
|
|
BOOL _codeLoaded;
|
|
|
|
unsigned _version;
|
1995-03-18 17:15:15 +00:00
|
|
|
}
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (NSArray*) allBundles;
|
|
|
|
+ (NSArray*) allFrameworks;
|
|
|
|
+ (NSBundle*) mainBundle;
|
|
|
|
+ (NSBundle*) bundleForClass: (Class)aClass;
|
|
|
|
+ (NSBundle*) bundleWithPath: (NSString*)path;
|
|
|
|
+ (NSString*) pathForResource: (NSString*)name
|
|
|
|
ofType: (NSString*)ext
|
|
|
|
inDirectory: (NSString*)bundlePath;
|
|
|
|
+ (NSString*) pathForResource: (NSString*)name
|
|
|
|
ofType: (NSString*)ext
|
|
|
|
inDirectory: (NSString*)bundlePath
|
|
|
|
withVersion: (int)version;
|
|
|
|
- (id) initWithPath: (NSString*)path;
|
|
|
|
- (NSString*) bundlePath;
|
|
|
|
- (Class) classNamed: (NSString*)className;
|
1997-01-06 22:30:33 +00:00
|
|
|
- (Class) principalClass;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
- (NSArray*) pathsForResourcesOfType: (NSString*)extension
|
|
|
|
inDirectory: (NSString*)bundlePath;
|
|
|
|
- (NSString*) pathForResource: (NSString*)name
|
|
|
|
ofType: (NSString*)ext
|
|
|
|
inDirectory: (NSString*)bundlePath;
|
|
|
|
- (NSString*) pathForResource: (NSString*)name
|
|
|
|
ofType: (NSString*)ext;
|
|
|
|
- (NSString*) localizedStringForKey: (NSString*)key
|
|
|
|
value: (NSString*)value
|
|
|
|
table: (NSString*)tableName;
|
|
|
|
- (NSString*) resourcePath;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
1997-09-01 21:59:51 +00:00
|
|
|
- (unsigned) bundleVersion;
|
|
|
|
- (void) setBundleVersion: (unsigned)version;
|
|
|
|
|
1997-01-06 22:30:33 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
1999-09-16 07:21:34 +00:00
|
|
|
- (NSDictionary*) infoDictionary;
|
1997-09-01 21:59:51 +00:00
|
|
|
- (BOOL) load;
|
1997-01-06 22:30:33 +00:00
|
|
|
#endif
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
1998-11-02 10:55:53 +00:00
|
|
|
#ifndef NO_GNUSTEP
|
1997-10-18 19:49:50 +00:00
|
|
|
@interface NSBundle (GNUstep)
|
|
|
|
|
2000-06-12 05:17:41 +00:00
|
|
|
+ (NSString *) _absolutePathOfExecutable: (NSString *)path;
|
1999-04-14 10:36:04 +00:00
|
|
|
+ (NSString*) _gnustep_target_cpu;
|
|
|
|
+ (NSString*) _gnustep_target_dir;
|
|
|
|
+ (NSString*) _gnustep_target_os;
|
|
|
|
+ (NSString*) _library_combo;
|
1999-04-22 21:26:10 +00:00
|
|
|
+ (NSBundle*) gnustepBundle;
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (NSString*) pathForGNUstepResource: (NSString*)name
|
|
|
|
ofType: (NSString*)ext
|
|
|
|
inDirectory: (NSString*)bundlePath;
|
1997-10-18 19:49:50 +00:00
|
|
|
|
|
|
|
@end
|
1999-04-22 21:26:10 +00:00
|
|
|
#define GSLocalizedString(key, comment) \
|
|
|
|
[[NSBundle gnustepBundle] localizedStringForKey:(key) value:@"" table:nil]
|
|
|
|
#define GSLocalizedStringFromTable(key, tbl, comment) \
|
|
|
|
[[NSBundle gnustepBundle] localizedStringForKey:(key) value:@"" table:(tbl)]
|
|
|
|
|
1998-11-02 10:55:53 +00:00
|
|
|
#endif
|
1997-10-18 19:49:50 +00:00
|
|
|
|
1997-01-06 22:30:33 +00:00
|
|
|
#define NSLocalizedString(key, comment) \
|
|
|
|
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
|
|
|
|
#define NSLocalizedStringFromTable(key, tbl, comment) \
|
|
|
|
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:(tbl)]
|
|
|
|
#define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) \
|
|
|
|
[bundle localizedStringForKey:(key) value:@"" table:(tbl)]
|
|
|
|
|
1999-04-23 02:54:45 +00:00
|
|
|
#ifndef NO_GNUSTEP
|
|
|
|
#define NSLocalizedStringFromTableInFramework(key, tbl, fpth, comment) \
|
|
|
|
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" \
|
|
|
|
table: [bundle pathForGNUstepResource:(tbl) ofType: nil inDirectory: (fpth)]
|
|
|
|
#endif
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#endif /* __NSBundle_h_GNUSTEP_BASE_INCLUDE */
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|