mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Changes from Richard Frith-Macdonald. See ChangeLog Apr 25 01:30:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2313 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
02688c779f
commit
5933e1ac9a
3 changed files with 53 additions and 0 deletions
|
@ -33,6 +33,15 @@ Sat May 3 12:28:48 1997 Andrew McCallum <mccallum@jprc.com>
|
|||
Use NSBundle's pathForResource:ofType:inDirectory method properly.
|
||||
(Reported by Stevo Crvenkovski <stevoc@lotus.mpt.com.mk>.)
|
||||
|
||||
Fri Apr 25 01:30:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* src/NSBundle.m:
|
||||
Added missing methods to conform to OpenStep spec, also added
|
||||
[+ pathForResource:ofType:inDirectory:]
|
||||
|
||||
* src/include/NSBundle.h:
|
||||
Added missing methods to conform to OpenStep spec.
|
||||
|
||||
Thu Apr 24 10:30:00 1997 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* src/Makefile.in: Added stuff to build and install the name
|
||||
|
|
|
@ -43,21 +43,31 @@ extern NSString* NSLoadedClasses;
|
|||
unsigned int _retainCount;
|
||||
unsigned int _bundleType;
|
||||
BOOL _codeLoaded;
|
||||
unsigned int _version;
|
||||
}
|
||||
|
||||
+ (NSBundle *) mainBundle;
|
||||
+ (NSBundle *) bundleForClass: (Class)aClass;
|
||||
+ (NSBundle *) bundleWithPath: (NSString *)path;
|
||||
+ (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext
|
||||
inDirectory: (NSString *)bundlePath
|
||||
withVersion: (int)version;
|
||||
- initWithPath: (NSString *)path;
|
||||
- (NSString *) bundlePath;
|
||||
- (Class) classNamed: (NSString *)className;
|
||||
- (Class) principalClass;
|
||||
- (unsigned) bundleVersion;
|
||||
- (void) setBundleVersion: (unsigned)version;
|
||||
|
||||
- (NSArray *) pathsForResourcesOfType: (NSString *)extension
|
||||
inDirectory: (NSString *)bundlePath;
|
||||
+ (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext
|
||||
inDirectory: (NSString *)bundlePath;
|
||||
+ (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext
|
||||
inDirectory: (NSString *)bundlePath;
|
||||
- (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext;
|
||||
- (NSString *) localizedStringForKey: (NSString *)key
|
||||
|
|
|
@ -274,6 +274,27 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
|||
return [[[NSBundle alloc] initWithPath: path] autorelease];
|
||||
}
|
||||
|
||||
+ (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext
|
||||
inDirectory: (NSString *)bundlePath
|
||||
{
|
||||
return [self pathForResource:name
|
||||
ofType:ext
|
||||
inDirectory:bundlePath
|
||||
withVersion:0];
|
||||
}
|
||||
|
||||
+ (NSString *) pathForResource: (NSString *)name
|
||||
ofType: (NSString *)ext
|
||||
inDirectory: (NSString *)bundlePath
|
||||
withVersion: (int)version
|
||||
{
|
||||
NSBundle* bundle = [NSBundle bundleWithPath:bundlePath];
|
||||
|
||||
[bundle setBundleVersion:version];
|
||||
return [bundle pathForResource:name ofType:ext inDirectory:nil];
|
||||
}
|
||||
|
||||
- initWithPath:(NSString *)path;
|
||||
{
|
||||
struct stat statbuf;
|
||||
|
@ -671,4 +692,17 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
|||
return _infoDict;
|
||||
}
|
||||
|
||||
- (unsigned)bundleVersion
|
||||
{
|
||||
return _version;
|
||||
}
|
||||
|
||||
/* Since I don't know how version numbers should behave - the version
|
||||
number is not used. (FIXME)
|
||||
*/
|
||||
- (void)setBundleVersion:(unsigned)version
|
||||
{
|
||||
_version = version;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue