* 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

@ -1,3 +1,7 @@
2004-11-04 Georg Fleischmann
* Headers/Foundation/NSTimeZone.h, Source/NSTimeZone.m
(+knownTimeZoneNames:): New method.
2004-11-03 Richard Frith-Macdonald <rfm@gnu.org> 2004-11-03 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSThread.m: Revert change from september to fix memory * Source/NSThread.m: Revert change from september to fix memory

View file

@ -1,8 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>GNUstep.org</title> <title>GNUstep.org</title>
<link rel="stylesheet" href="../gnustep-main.css" type="text/css"> <link rel="stylesheet" href="../gnustep-main.css" type="text/css">
<style type="text/css" media="screen"> <style type="text/css" media="screen">
@import "../gnustep-main-2.css"; @import "../gnustep-main-2.css";
@ -10,16 +11,11 @@
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-type" content="text/html; charset=UTF-8">
</head> </head>
<body> <body>
<div class="header"> <div class="header">
<a href="http://gnustep.org/"><img src="../gnustep-header14.jpg" alt="GNUstep.org" width="560" height="74"></a> </div> <a href="http://gnustep.org/"><img src="../gnustep-header14.jpg" alt="GNUstep.org" width="560" height="74"></a> </div>
<div class="container"> <div class="container">
<div class="content"> <div class="content">
<h2>GNUstep System Documentation</h2> <h2>GNUstep System Documentation</h2>
<p> <p>
@ -30,8 +26,7 @@
specification created by NeXT, Inc. (now Apple). (<a specification created by NeXT, Inc. (now Apple). (<a
href="http://gnustep.org/">Top</a>) href="http://gnustep.org/">Top</a>)
</p> </p>
<div style="clear: both;"></div> <div style="clear: both;"></div> </div>
</div>
<div class="content"> <div class="content">
<h2>User Documentation</h2> <h2>User Documentation</h2>
@ -66,8 +61,7 @@
<li><a href="documentation/User/Gui/LanguageSetup.html">Setup for East Asian Languages</a></li> <li><a href="documentation/User/Gui/LanguageSetup.html">Setup for East Asian Languages</a></li>
</ul> </ul>
</td> </td>
</tr></table> </tr></table> </div>
</div>
<div class="content"> <div class="content">
<h2>Developer Documentation</h2> <h2>Developer Documentation</h2>
@ -131,8 +125,7 @@
</tr> </tr>
</table> </table>
</td> </td>
</tr></table> </tr></table> </div>
</div>
<div class="content"> <div class="content">
@ -161,6 +154,7 @@
<a href="../experience/apps.html">Applications</a><br /> <a href="../experience/apps.html">Applications</a><br />
<a href="../resources/documentation/User/GNUstep/userfaq_toc.html">User FAQ</a><br /> <a href="../resources/documentation/User/GNUstep/userfaq_toc.html">User FAQ</a><br />
<a href="../experience/documentation.html">Getting Started</a><br /> <a href="../experience/documentation.html">Getting Started</a><br />
<a href="../information/donate.html">Donations</a><br />
<br /> <br />
<b>Developers</b><br /> <b>Developers</b><br />
<a href="../resources/docs-web.html">Documentation</a><br /> <a href="../resources/docs-web.html">Documentation</a><br />

View file

@ -40,6 +40,7 @@
// Getting Time Zone Information // Getting Time Zone Information
+ (NSDictionary*) abbreviationDictionary; + (NSDictionary*) abbreviationDictionary;
+ (NSArray*) knownTimeZoneNames;
//Getting Arrays of Time Zones //Getting Arrays of Time Zones
+ (NSArray*) timeZoneArray; + (NSArray*) timeZoneArray;

View file

@ -1006,6 +1006,33 @@ static NSMapTable *absolutes = 0;
return abbreviationDictionary; 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 + (id) allocWithZone: (NSZone*)z
{ {
if (self == NSTimeZoneClass) if (self == NSTimeZoneClass)