mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-25 01:31:08 +00:00
* Source/NSBundle.m: add NSBundle pathForAuxiliaryExecutable: and -privateFrameworksPath and their URL counterparts
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36973 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
91d53d6709
commit
b0d091bb19
3 changed files with 82 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-08-14 Lubos Dolezel <lubos@dolezel.info>
|
||||
|
||||
* Source/NSBundle.m: add NSBundle pathForAuxiliaryExecutable: and
|
||||
-privateFrameworksPath and their URL counterparts
|
||||
|
||||
2013-08-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Headers/Foundation/NSThread.h:
|
||||
|
|
|
@ -348,11 +348,22 @@ GS_EXPORT NSString* const NSLoadedClasses;
|
|||
/** Returns the full path to the plug-in subdirectory of the bundle. */
|
||||
- (NSString *) builtInPlugInsPath;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST)
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
|
||||
/** Returns the full path to the plug-in subdirectory of the bundle. */
|
||||
- (NSURL *) builtInPlugInsURL;
|
||||
#endif
|
||||
|
||||
/** Returns the full path to the private frameworks subdirectory of the bundle. */
|
||||
- (NSString *) privateFrameworksPath;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
|
||||
/** Returns the full path to the private frameworks subdirectory of the bundle. */
|
||||
- (NSURL *) privateFrameworksURL;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/** Returns the bundle identifier, as defined by the CFBundleIdentifier
|
||||
key in the infoDictionary */
|
||||
- (NSString *) bundleIdentifier;
|
||||
|
@ -454,6 +465,13 @@ GS_EXPORT NSString* const NSLoadedClasses;
|
|||
- (NSURL *) executableURL;
|
||||
#endif
|
||||
|
||||
- (NSString *) pathForAuxiliaryExecutable: (NSString *) executableName;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
|
||||
- (NSURL *)URLForAuxiliaryExecutable: (NSString *) executableName;
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5,GS_API_LATEST)
|
||||
|
|
|
@ -2742,6 +2742,35 @@ IF_NO_GC(
|
|||
return [NSURL fileURLWithPath: [self executablePath]];
|
||||
}
|
||||
|
||||
- (NSString *) pathForAuxiliaryExecutable: (NSString *) executableName
|
||||
{
|
||||
NSString *version = _frameworkVersion;
|
||||
|
||||
if (!version)
|
||||
version = @"Current";
|
||||
|
||||
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
||||
{
|
||||
#if !defined(__MINGW__)
|
||||
return [_path stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"Versions/%@/%@",
|
||||
version, executableName]];
|
||||
#else
|
||||
return [_path stringByAppendingPathComponent: executableName];
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
return [_path stringByAppendingPathComponent: executableName];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSURL *) URLForAuxiliaryExecutable: (NSString *) executableName
|
||||
{
|
||||
return [NSURL fileURLWithPath: [self pathForAuxiliaryExecutable:
|
||||
executableName]];
|
||||
}
|
||||
|
||||
- (NSString *) resourcePath
|
||||
{
|
||||
NSString *version = _frameworkVersion;
|
||||
|
@ -2821,6 +2850,35 @@ IF_NO_GC(
|
|||
return [NSURL fileURLWithPath: [self builtInPlugInsPath]];
|
||||
}
|
||||
|
||||
- (NSString *) privateFrameworksPath
|
||||
{
|
||||
NSString *version = _frameworkVersion;
|
||||
|
||||
if (!version)
|
||||
version = @"Current";
|
||||
|
||||
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
||||
{
|
||||
#if !defined(__MINGW__)
|
||||
return [_path stringByAppendingPathComponent:
|
||||
[NSString stringWithFormat:@"Versions/%@/PrivateFrameworks",
|
||||
version]];
|
||||
#else
|
||||
return [_path stringByAppendingPathComponent: @"PrivateFrameworks"];
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
return [_path stringByAppendingPathComponent: @"PrivateFrameworks"];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSURL *) privateFrameworksURL
|
||||
{
|
||||
return [NSURL fileURLWithPath: [self privateFrameworksPath]];
|
||||
}
|
||||
|
||||
|
||||
- (NSString*) bundleIdentifier
|
||||
{
|
||||
return [[self infoDictionary] objectForKey: @"CFBundleIdentifier"];
|
||||
|
|
Loading…
Reference in a new issue