* Headers/Foundation/NSTimeZone.h, Source/NSTimeZone.m

(+knownTimeZoneNames:): New method.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20295 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2004-11-05 03:47:03 +00:00
parent d2161f1c01
commit 65997ec654
4 changed files with 39 additions and 13 deletions

View file

@ -1006,6 +1006,33 @@ static NSMapTable *absolutes = 0;
return abbreviationDictionary;
}
/**
* Returns an array of all known time zone names.
*/
+ (NSArray*) knownTimeZoneNames
{
static NSArray *namesArray = nil;
int i;
id temp_array;
NSArray *regionsArray, *array;
/* We create the array only when we need it to reduce overhead. */
if (namesArray != nil)
return namesArray;
temp_array = [NSMutableArray array];
regionsArray = [self timeZoneArray];
for (i = 0; i < [regionsArray count]; i++)
{
array = [regionsArray objectAtIndex:i];
[temp_array addObjectsFromArray: array];
}
namesArray = [[NSArray alloc] initWithArray: temp_array];
return namesArray;
}
+ (id) allocWithZone: (NSZone*)z
{
if (self == NSTimeZoneClass)