~ubuntu-branches/ubuntu/trusty/gnustep-base/trusty

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSBundle.h

Tags: upstream-1.11.2
ImportĀ upstreamĀ versionĀ 1.11.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  
22
22
   You should have received a copy of the GNU Library General Public
23
23
   License along with this library; if not, write to the Free
24
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
24
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
25
25
  */
26
26
 
27
27
#ifndef __NSBundle_h_GNUSTEP_BASE_INCLUDE
171
171
                  withVersion: (int)version;
172
172
 
173
173
/** <init />
174
 
 * Init the bundle for reading resources from path.  path must be an
175
 
 * absolute path to a directory on disk.  If path is nil or doesn't
176
 
 * exist, initWithPath: returns nil.  If a bundle for that path
177
 
 * already existed, it is returned in place of the receiver (and the
178
 
 * receiver is deallocated).
 
174
 * Init the bundle for reading resources from path.<br />
 
175
 * The MacOS-X documentation says that the path must be a full path to
 
176
 * a directory on disk.  However, it (in MacOS-X) version 10.3 at least)
 
177
 * actually accepts relative paths too.<br />
 
178
 * The GNUstep behavior is similar in that it accepts a relative path,
 
179
 * but GNUstep converts it to an absolute path by referring to the
 
180
 * current working directory when the is initialised, so an absolute
 
181
 * path is then used and a warning message is printed.<br />
 
182
 * On MacOS-X using a bundle initialised with a relative path will cause
 
183
 * a crash if the current working directory is changed between the point
 
184
 * at which the bundle was initialised and that at which it is used.<br />
 
185
 * If path is nil or can't be accessed, initWithPath: reallocates the
 
186
 * receiver and returns nil.<br />
 
187
 * If a bundle for that path already existed, it is returned in place
 
188
 * of the receiver (and the receiver is deallocated).
179
189
 */
180
190
- (id) initWithPath: (NSString*)path;
181
191
 
196
206
- (Class) principalClass;
197
207
 
198
208
/**
199
 
 *  Not implemented.  Create an instance and call the corresponding instance
200
 
 *  method instead.
 
209
  <p> Returns an array of paths for all resources with the specified
 
210
   extension and residing in the bundlePath directory. bundlePath can
 
211
   be any type of directory structure, but typically it is used to
 
212
   search for resources in a application or framework. For example,
 
213
   one could search for tiff files in the MyApp.app application using [NSBundle
 
214
   pathsForResourcesOfType: @"tiff" inDirectory: @"MyApp.app"].  It
 
215
   will search in any Resources subdirectory inside bundlePath as well
 
216
   as the main directory for resource files. If extension is nil or
 
217
   empty, all resources are returned.  </p>
201
218
 */
202
219
+ (NSArray*) pathsForResourcesOfType: (NSString*)extension
203
220
                         inDirectory: (NSString*)bundlePath;
210
227
   </p>
211
228
 */
212
229
- (NSArray*) pathsForResourcesOfType: (NSString*)extension
213
 
                         inDirectory: (NSString*)bundlePath;
 
230
                         inDirectory: (NSString*)subPath;
214
231
 
215
232
/**
216
233
  <p>
219
236
   in the following order:
220
237
   </p>
221
238
   <example>
222
 
     root path/Resources/bundlePath
223
 
     root path/Resources/bundlePath/"language.lproj"
224
 
     root path/bundlePath
225
 
     root path/bundlePath/"language.lproj"
 
239
     root path/Resources/subPath
 
240
     root path/Resources/subPath/"language.lproj"
 
241
     root path/subPath
 
242
     root path/subPath/"language.lproj"
226
243
   </example>
227
244
   <p>
228
245
   where language.lproj can be any localized language directory inside
235
252
*/
236
253
- (NSString*) pathForResource: (NSString*)name
237
254
                       ofType: (NSString*)ext
238
 
                  inDirectory: (NSString*)bundlePath;
 
255
                  inDirectory: (NSString*)subPath;
239
256
 
240
257
/**
241
258
   Returns an absolute path for a resource name with the extension ext
289
306
                               forPreferences: (NSArray *)preferencesArray;
290
307
 
291
308
- (BOOL) isLoaded;
 
309
 
292
310
/**
293
 
 *  Not implemented.
 
311
   This method returns the same information as
 
312
   -pathsForResourcesOfType:inDirectory: except that only non-localized
 
313
   resources and resources that match the localization localizationName
 
314
   are returned.
294
315
 */
295
316
- (NSArray*) pathsForResourcesOfType: (NSString*)extension
296
 
                         inDirectory: (NSString*)bundlePath
 
317
                         inDirectory: (NSString*)subPath
297
318
                     forLocalization: (NSString*)localizationName;
298
319
/**
299
320
 *  Not implemented.
300
321
 */
301
322
- (NSString*) pathForResource: (NSString*)name
302
323
                       ofType: (NSString*)ext
303
 
                  inDirectory: (NSString*)bundlePath
 
324
                  inDirectory: (NSString*)subPath
304
325
              forLocalization: (NSString*)localizationName;
305
326
 
306
327
/** Returns the info property list associated with the bundle. */