mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 08:41:03 +00:00
Added NSNull to provide standard placeholder object for marking a nul in
a collection etc. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7879 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4386ba0c61
commit
78e1106ecc
14 changed files with 236 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2000-10-21 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Headers/Foundation/NSNull.h: New placeholder class.
|
||||||
|
* Source/NSNull.m: New placeholder class.
|
||||||
|
* Source/GNUmakefile: Build NSNull and install header.
|
||||||
|
* Documentation/gsdoc/GNUmakefile: Build NSNull documentation
|
||||||
|
* Documentation/gsdoc/NSNull.gsdoc: NSNull documentation
|
||||||
|
|
||||||
2000-10-20 Richard Frith-Macdonald <rfm@gnu.org>
|
2000-10-20 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSString.m: ([-initWithCharacters:length:]) use
|
* Source/NSString.m: ([-initWithCharacters:length:]) use
|
||||||
|
|
|
@ -126,6 +126,7 @@
|
||||||
<item><uref url="NSNotification.html">NSNotification</uref></item>
|
<item><uref url="NSNotification.html">NSNotification</uref></item>
|
||||||
<item><uref url="NSNotificationCenter.html">NSNotificationCenter</uref></item>
|
<item><uref url="NSNotificationCenter.html">NSNotificationCenter</uref></item>
|
||||||
<item><uref url="NSNotificationQueue.html">NSNotificationQueue</uref></item>
|
<item><uref url="NSNotificationQueue.html">NSNotificationQueue</uref></item>
|
||||||
|
<item><uref url="NSNull.html">NSNull</uref></item>
|
||||||
<item><uref url="NSNumber.html">NSNumber</uref></item>
|
<item><uref url="NSNumber.html">NSNumber</uref></item>
|
||||||
<item><uref url="NSNumberFormatter.html">NSNumberFormatter</uref></item>
|
<item><uref url="NSNumberFormatter.html">NSNumberFormatter</uref></item>
|
||||||
<item><uref url="NSObject.html">NSObject</uref></item>
|
<item><uref url="NSObject.html">NSObject</uref></item>
|
||||||
|
|
|
@ -122,6 +122,7 @@
|
||||||
<li><a href ="NSNotification.html">NSNotification</a>
|
<li><a href ="NSNotification.html">NSNotification</a>
|
||||||
<li><a href ="NSNotificationCenter.html">NSNotificationCenter</a>
|
<li><a href ="NSNotificationCenter.html">NSNotificationCenter</a>
|
||||||
<li><a href ="NSNotificationQueue.html">NSNotificationQueue</a>
|
<li><a href ="NSNotificationQueue.html">NSNotificationQueue</a>
|
||||||
|
<li><a href ="NSNull.html">NSNull</a>
|
||||||
<li><a href ="NSNumber.html">NSNumber</a>
|
<li><a href ="NSNumber.html">NSNumber</a>
|
||||||
<li><a href ="NSNumberFormatter.html">NSNumberFormatter</a>
|
<li><a href ="NSNumberFormatter.html">NSNumberFormatter</a>
|
||||||
<li><a href ="NSObject.html">NSObject</a>
|
<li><a href ="NSObject.html">NSObject</a>
|
||||||
|
|
|
@ -73,6 +73,7 @@ Base_GSDOC_FILES = Base.gsdoc \
|
||||||
NSNotification.gsdoc \
|
NSNotification.gsdoc \
|
||||||
NSNotificationCenter.gsdoc \
|
NSNotificationCenter.gsdoc \
|
||||||
NSNotificationQueue.gsdoc \
|
NSNotificationQueue.gsdoc \
|
||||||
|
NSNull.gsdoc \
|
||||||
NSNumber.gsdoc \
|
NSNumber.gsdoc \
|
||||||
NSNumberFormatter.gsdoc \
|
NSNumberFormatter.gsdoc \
|
||||||
NSObject.gsdoc \
|
NSObject.gsdoc \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
||||||
<gsdoc base="NSNotificationQueue" prev="NSNotificationCenter" next="NSNumber" up="Base">
|
<gsdoc base="NSNotificationQueue" prev="NSNotificationCenter" next="NSNull" up="Base">
|
||||||
<head>
|
<head>
|
||||||
<title>NSNotificationQueue</title>
|
<title>NSNotificationQueue</title>
|
||||||
<author name="Richard Frith-Macdonald">
|
<author name="Richard Frith-Macdonald">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<body>
|
<body>
|
||||||
<a href ="NSNotificationCenter.html">[Previous]</a>
|
<a href ="NSNotificationCenter.html">[Previous]</a>
|
||||||
<a href ="Base.html">[Up]</a>
|
<a href ="Base.html">[Up]</a>
|
||||||
<a href ="NSNumber.html">[Next]</a>
|
<a href ="NSNull.html">[Next]</a>
|
||||||
<h1>NSNotificationQueue</h1>
|
<h1>NSNotificationQueue</h1>
|
||||||
<h3>Authors </h3>
|
<h3>Authors </h3>
|
||||||
<dl>
|
<dl>
|
||||||
|
|
33
Documentation/gsdoc/NSNull.gsdoc
Normal file
33
Documentation/gsdoc/NSNull.gsdoc
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
||||||
|
<gsdoc base="NSNull" prev="NSNotificationQueue" next="NSNumber" up="Base">
|
||||||
|
<head>
|
||||||
|
<title>NSNull</title>
|
||||||
|
<author name="Richard Frith-Macdonald">
|
||||||
|
<email address="rfm@gnu.org"/>
|
||||||
|
<url url="http://www.gnustep.org/developers/whoiswho.html"/>
|
||||||
|
</author>
|
||||||
|
<version>0.1</version>
|
||||||
|
<date>21 October, 2000</date>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<chapter>
|
||||||
|
<heading>NSNull</heading>
|
||||||
|
<class name="NSNull" super="NSObject">
|
||||||
|
<declared>Foundation/NSNull.h</declared>
|
||||||
|
<conform>NSObject</conform>
|
||||||
|
<conform>NSCoding</conform>
|
||||||
|
<conform>NSCopying</conform>
|
||||||
|
<desc>
|
||||||
|
</desc>
|
||||||
|
<method type="NSNull*" factory="yes">
|
||||||
|
<sel>null</sel>
|
||||||
|
<desc>
|
||||||
|
Return an object that can be used as a placeholder in a collection.
|
||||||
|
This method always returns the same object.
|
||||||
|
</desc>
|
||||||
|
</method>
|
||||||
|
</class>
|
||||||
|
</chapter>
|
||||||
|
</body>
|
||||||
|
</gsdoc>
|
44
Documentation/gsdoc/NSNull.html
Normal file
44
Documentation/gsdoc/NSNull.html
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
<html><head>
|
||||||
|
<title>NSNull</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href ="NSNotificationQueue.html">[Previous]</a>
|
||||||
|
<a href ="Base.html">[Up]</a>
|
||||||
|
<a href ="NSNumber.html">[Next]</a>
|
||||||
|
<h1>NSNull</h1>
|
||||||
|
<h3>Authors </h3>
|
||||||
|
<dl>
|
||||||
|
<dt><a href ="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
|
||||||
|
<dd>
|
||||||
|
</dl>
|
||||||
|
<p>Version: 0.1</p>
|
||||||
|
<p>Date: 21 October, 2000</p>
|
||||||
|
<h2><a name ="cont-0">NSNull</a></h2>
|
||||||
|
<h2><a name ="NSNull">NSNull</a></h2>
|
||||||
|
<p><b>Declared in: </b> Foundation/NSNull.h</p>
|
||||||
|
<p><b>Inherits from: </b> NSObject</p>
|
||||||
|
<p><b>Conforms to: </b> NSObject
|
||||||
|
, NSCoding
|
||||||
|
, NSCopying
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
<h2>Instance Variables </h2>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
<h2>Methods </h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href ="NSNull.html#method-0">+null</a>
|
||||||
|
</ul>
|
||||||
|
<hr><h2>Class Methods </h2>
|
||||||
|
<h3><a name ="method-0">null</a></h3>
|
||||||
|
+ (NSNull*) <b>null</b>;<br>
|
||||||
|
|
||||||
|
Return an object that can be used as a placeholder in a collection.
|
||||||
|
This method always returns the same object.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.6//EN" "http://www.gnustep.org/gsdoc-0_6_6.xml">
|
||||||
<gsdoc base="NSNumber" prev="NSNotificationQueue" next="NSNumberFormatter" up="Base">
|
<gsdoc base="NSNumber" prev="NSNull" next="NSNumberFormatter" up="Base">
|
||||||
<head>
|
<head>
|
||||||
<title>NSNumber</title>
|
<title>NSNumber</title>
|
||||||
<author name="Richard Frith-Macdonald">
|
<author name="Richard Frith-Macdonald">
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<title>NSNumber</title>
|
<title>NSNumber</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<a href ="NSNotificationQueue.html">[Previous]</a>
|
<a href ="NSNull.html">[Previous]</a>
|
||||||
<a href ="Base.html">[Up]</a>
|
<a href ="Base.html">[Up]</a>
|
||||||
<a href ="NSNumberFormatter.html">[Next]</a>
|
<a href ="NSNumberFormatter.html">[Next]</a>
|
||||||
<h1>NSNumber</h1>
|
<h1>NSNumber</h1>
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
#include <Foundation/NSMethodSignature.h>
|
#include <Foundation/NSMethodSignature.h>
|
||||||
#include <Foundation/NSNotification.h>
|
#include <Foundation/NSNotification.h>
|
||||||
#include <Foundation/NSNotificationQueue.h>
|
#include <Foundation/NSNotificationQueue.h>
|
||||||
|
#include <Foundation/NSNull.h>
|
||||||
#include <Foundation/NSPathUtilities.h>
|
#include <Foundation/NSPathUtilities.h>
|
||||||
#include <Foundation/NSPortCoder.h>
|
#include <Foundation/NSPortCoder.h>
|
||||||
#include <Foundation/NSPortMessage.h>
|
#include <Foundation/NSPortMessage.h>
|
||||||
|
|
39
Headers/gnustep/base/NSNull.h
Normal file
39
Headers/gnustep/base/NSNull.h
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/* Interface for NSNull for GNUStep
|
||||||
|
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
Date: 2000
|
||||||
|
|
||||||
|
This file is part of the GNUstep Base Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NSNull_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
#define __NSNull_h_GNUSTEP_BASE_INCLUDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An object to use as a placeholder - in collections for instance.
|
||||||
|
*/
|
||||||
|
#ifndef NO_MACOS_X
|
||||||
|
#include <Foundation/NSObject.h>
|
||||||
|
|
||||||
|
@interface NSNull : NSObject <NSCoding, NSCopying>
|
||||||
|
+ (NSNull*) null;
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __NSNull_h_GNUSTEP_BASE_INCLUDE */
|
|
@ -190,6 +190,7 @@ NSMethodSignature.m \
|
||||||
NSNotification.m \
|
NSNotification.m \
|
||||||
NSNotificationCenter.m \
|
NSNotificationCenter.m \
|
||||||
NSNotificationQueue.m \
|
NSNotificationQueue.m \
|
||||||
|
NSNull.m \
|
||||||
NSNumber.m \
|
NSNumber.m \
|
||||||
NSNumberFormatter.m \
|
NSNumberFormatter.m \
|
||||||
NSObjCRuntime.m \
|
NSObjCRuntime.m \
|
||||||
|
@ -291,6 +292,7 @@ NSMapTable.h \
|
||||||
NSMethodSignature.h \
|
NSMethodSignature.h \
|
||||||
NSNotification.h \
|
NSNotification.h \
|
||||||
NSNotificationQueue.h \
|
NSNotificationQueue.h \
|
||||||
|
NSNull.h \
|
||||||
NSNumberFormatter.h \
|
NSNumberFormatter.h \
|
||||||
NSObjCRuntime.h \
|
NSObjCRuntime.h \
|
||||||
NSObject.h \
|
NSObject.h \
|
||||||
|
|
102
Source/NSNull.m
Normal file
102
Source/NSNull.m
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
/* Implementation for NSNull for GNUStep
|
||||||
|
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Written by: Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
Date: 2000
|
||||||
|
|
||||||
|
This file is part of the GNUstep Base Library.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library; if not, write to the Free
|
||||||
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* An object to use as a placeholder - in collections for instance.
|
||||||
|
*/
|
||||||
|
#include <Foundation/NSNull.h>
|
||||||
|
|
||||||
|
@implementation NSNull
|
||||||
|
|
||||||
|
static NSNull *null = 0;
|
||||||
|
|
||||||
|
+ (id) allocWithZone: (NSZone*)z
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (id) alloc
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (null == 0)
|
||||||
|
{
|
||||||
|
null = NSAllocateObject(self, 0, NSDefaultMallocZone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (NSNull*) null
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) autorelease
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) copyWithZone: (NSZone*)z
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) copy
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) initWithCoder: (NSCoder*)aCoder
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) isEqual: (id)other
|
||||||
|
{
|
||||||
|
if (other == self)
|
||||||
|
return YES
|
||||||
|
else
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) release
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) retain
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue