mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-21 04:32:03 +00:00
Filesystem change
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16565 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
16e25ec2a4
commit
32ae9a0f45
34 changed files with 1712 additions and 2890 deletions
|
@ -70,10 +70,8 @@ static NSLock* cache_lock = nil;
|
|||
+ (NSCharacterSet*) _bitmapForSet: (NSString*)setname number: (int)number
|
||||
{
|
||||
NSCharacterSet *set;
|
||||
NSArray *paths;
|
||||
NSString *bundle_path, *set_path;
|
||||
NSString *set_path;
|
||||
NSBundle *bundle;
|
||||
NSEnumerator *enumerator;
|
||||
|
||||
if (!cache_lock)
|
||||
cache_lock = [NSLock new];
|
||||
|
@ -84,27 +82,20 @@ static NSLock* cache_lock = nil;
|
|||
{
|
||||
NS_DURING
|
||||
|
||||
paths = NSSearchPathForDirectoriesInDomains(GSLibrariesDirectory,
|
||||
NSAllDomainsMask, YES);
|
||||
enumerator = [paths objectEnumerator];
|
||||
while ((set == nil) && (bundle_path = [enumerator nextObject]))
|
||||
{
|
||||
bundle = [NSBundle bundleWithPath: bundle_path];
|
||||
|
||||
set_path = [bundle pathForResource: setname
|
||||
ofType: @"dat"
|
||||
inDirectory: NSCharacterSet_PATH];
|
||||
if (set_path != nil)
|
||||
{
|
||||
NS_DURING
|
||||
/* Load the character set file */
|
||||
set = [self characterSetWithBitmapRepresentation:
|
||||
[NSData dataWithContentsOfFile: set_path]];
|
||||
NS_HANDLER
|
||||
NSLog(@"Unable to read NSCharacterSet file %@", set_path);
|
||||
set = nil;
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
bundle = [NSBundle bundleForLibrary: @"gnustep-base"];
|
||||
set_path = [bundle pathForResource: setname
|
||||
ofType: @"dat"
|
||||
inDirectory: NSCharacterSet_PATH];
|
||||
if (set_path != nil)
|
||||
{
|
||||
NS_DURING
|
||||
/* Load the character set file */
|
||||
set = [self characterSetWithBitmapRepresentation:
|
||||
[NSData dataWithContentsOfFile: set_path]];
|
||||
NS_HANDLER
|
||||
NSLog(@"Unable to read NSCharacterSet file %@", set_path);
|
||||
set = nil;
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
|
||||
/* If we didn't load a set then raise an exception */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue