mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
7a544f5957
commit
9e5219ee32
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.
|
Use NSBundle's pathForResource:ofType:inDirectory method properly.
|
||||||
(Reported by Stevo Crvenkovski <stevoc@lotus.mpt.com.mk>.)
|
(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>
|
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
|
* src/Makefile.in: Added stuff to build and install the name
|
||||||
|
|
|
@ -43,21 +43,31 @@ extern NSString* NSLoadedClasses;
|
||||||
unsigned int _retainCount;
|
unsigned int _retainCount;
|
||||||
unsigned int _bundleType;
|
unsigned int _bundleType;
|
||||||
BOOL _codeLoaded;
|
BOOL _codeLoaded;
|
||||||
|
unsigned int _version;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSBundle *) mainBundle;
|
+ (NSBundle *) mainBundle;
|
||||||
+ (NSBundle *) bundleForClass: (Class)aClass;
|
+ (NSBundle *) bundleForClass: (Class)aClass;
|
||||||
+ (NSBundle *) bundleWithPath: (NSString *)path;
|
+ (NSBundle *) bundleWithPath: (NSString *)path;
|
||||||
|
+ (NSString *) pathForResource: (NSString *)name
|
||||||
|
ofType: (NSString *)ext
|
||||||
|
inDirectory: (NSString *)bundlePath
|
||||||
|
withVersion: (int)version;
|
||||||
- initWithPath: (NSString *)path;
|
- initWithPath: (NSString *)path;
|
||||||
- (NSString *) bundlePath;
|
- (NSString *) bundlePath;
|
||||||
- (Class) classNamed: (NSString *)className;
|
- (Class) classNamed: (NSString *)className;
|
||||||
- (Class) principalClass;
|
- (Class) principalClass;
|
||||||
|
- (unsigned) bundleVersion;
|
||||||
|
- (void) setBundleVersion: (unsigned)version;
|
||||||
|
|
||||||
- (NSArray *) pathsForResourcesOfType: (NSString *)extension
|
- (NSArray *) pathsForResourcesOfType: (NSString *)extension
|
||||||
inDirectory: (NSString *)bundlePath;
|
inDirectory: (NSString *)bundlePath;
|
||||||
+ (NSString *) pathForResource: (NSString *)name
|
+ (NSString *) pathForResource: (NSString *)name
|
||||||
ofType: (NSString *)ext
|
ofType: (NSString *)ext
|
||||||
inDirectory: (NSString *)bundlePath;
|
inDirectory: (NSString *)bundlePath;
|
||||||
|
+ (NSString *) pathForResource: (NSString *)name
|
||||||
|
ofType: (NSString *)ext
|
||||||
|
inDirectory: (NSString *)bundlePath;
|
||||||
- (NSString *) pathForResource: (NSString *)name
|
- (NSString *) pathForResource: (NSString *)name
|
||||||
ofType: (NSString *)ext;
|
ofType: (NSString *)ext;
|
||||||
- (NSString *) localizedStringForKey: (NSString *)key
|
- (NSString *) localizedStringForKey: (NSString *)key
|
||||||
|
|
|
@ -274,6 +274,27 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
return [[[NSBundle alloc] initWithPath: path] autorelease];
|
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;
|
- initWithPath:(NSString *)path;
|
||||||
{
|
{
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
|
@ -671,4 +692,17 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
return _infoDict;
|
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
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue