Add a few 10.6 NSURL methods to NSBundle.

Based on patch by julian.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33367 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2011-06-22 23:01:01 +00:00
parent e40a3d2625
commit f6bec228b9
3 changed files with 86 additions and 0 deletions

View file

@ -184,6 +184,9 @@ GS_EXPORT NSString* const NSLoadedClasses;
* not readable, return nil. If you want the main bundle of an
* application or a tool, it's better if you use +mainBundle. */
+ (NSBundle*) bundleWithPath: (NSString*)path;
#if OS_API_VERSION(100600,GS_API_LATEST)
+ (NSBundle*) bundleWithURL: (NSURL*)url;
#endif
/**
Returns an absolute path for a resource name with the extension
@ -204,6 +207,13 @@ GS_EXPORT NSString* const NSLoadedClasses;
inDirectory: (NSString*)bundlePath
withVersion: (int)version;
#if OS_API_VERSION(100600,GS_API_LATEST)
+ (NSURL*) URLForResource: (NSString*)name
withExtension: (NSString*)ext
subdirectory: (NSString*)subpath
inBundleWithURL: (NSURL*)bundleURL;
#endif
/** <init />
* Init the bundle for reading resources from path.<br />
* The MacOS-X documentation says that the path must be a full path to
@ -226,6 +236,10 @@ GS_EXPORT NSString* const NSLoadedClasses;
*/
- (id) initWithPath: (NSString*)path;
#if OS_API_VERSION(100600,GS_API_LATEST)
- (id) initWithURL: (NSURL*)url;
#endif
/** Return the path to the bundle - an absolute path. */
- (NSString*) bundlePath;
@ -299,6 +313,18 @@ GS_EXPORT NSString* const NSLoadedClasses;
- (NSString*) pathForResource: (NSString*)name
ofType: (NSString*)ext;
#if OS_API_VERSION(100600,GS_API_LATEST)
- (NSURL*) URLForResource: (NSString*)name
withExtension: (NSString*)extension;
- (NSURL*) URLForResource: (NSString*)name
withExtension: (NSString*)extension
subdirectory: (NSString*)subpath;
- (NSURL*) URLForResource: (NSString*)name
withExtension: (NSString*)extension
subdirectory: (NSString*)subpath
localization: (NSString*)localizationName;
#endif
/**
<p>Returns the value for the key found in the strings file tableName, or
Localizable.strings if tableName is nil.</p>