diff --git a/ChangeLog b/ChangeLog index 3d680dbef..5231b69ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-10-21 Richard Frith-Macdonald + + * 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 * Source/NSString.m: ([-initWithCharacters:length:]) use diff --git a/Documentation/gsdoc/Base.gsdoc b/Documentation/gsdoc/Base.gsdoc index 5cf192161..a21c4ecb8 100644 --- a/Documentation/gsdoc/Base.gsdoc +++ b/Documentation/gsdoc/Base.gsdoc @@ -126,6 +126,7 @@ NSNotification NSNotificationCenter NSNotificationQueue + NSNull NSNumber NSNumberFormatter NSObject diff --git a/Documentation/gsdoc/Base.html b/Documentation/gsdoc/Base.html index 0931e20a4..4bc9ad883 100644 --- a/Documentation/gsdoc/Base.html +++ b/Documentation/gsdoc/Base.html @@ -122,6 +122,7 @@
  • NSNotification
  • NSNotificationCenter
  • NSNotificationQueue +
  • NSNull
  • NSNumber
  • NSNumberFormatter
  • NSObject diff --git a/Documentation/gsdoc/GNUmakefile b/Documentation/gsdoc/GNUmakefile index 5cce91547..71501d5a5 100644 --- a/Documentation/gsdoc/GNUmakefile +++ b/Documentation/gsdoc/GNUmakefile @@ -73,6 +73,7 @@ Base_GSDOC_FILES = Base.gsdoc \ NSNotification.gsdoc \ NSNotificationCenter.gsdoc \ NSNotificationQueue.gsdoc \ + NSNull.gsdoc \ NSNumber.gsdoc \ NSNumberFormatter.gsdoc \ NSObject.gsdoc \ diff --git a/Documentation/gsdoc/NSNotificationQueue.gsdoc b/Documentation/gsdoc/NSNotificationQueue.gsdoc index e983d3359..fa51d999f 100644 --- a/Documentation/gsdoc/NSNotificationQueue.gsdoc +++ b/Documentation/gsdoc/NSNotificationQueue.gsdoc @@ -1,6 +1,6 @@ - + NSNotificationQueue diff --git a/Documentation/gsdoc/NSNotificationQueue.html b/Documentation/gsdoc/NSNotificationQueue.html index 50b6f65d3..c08db2338 100644 --- a/Documentation/gsdoc/NSNotificationQueue.html +++ b/Documentation/gsdoc/NSNotificationQueue.html @@ -4,7 +4,7 @@ [Previous] [Up] -[Next] +[Next]

    NSNotificationQueue

    Authors

    diff --git a/Documentation/gsdoc/NSNull.gsdoc b/Documentation/gsdoc/NSNull.gsdoc new file mode 100644 index 000000000..c205b2038 --- /dev/null +++ b/Documentation/gsdoc/NSNull.gsdoc @@ -0,0 +1,33 @@ + + + + + NSNull + + + + + 0.1 + 21 October, 2000 + + + + NSNull + + Foundation/NSNull.h + NSObject + NSCoding + NSCopying + + + + null + + Return an object that can be used as a placeholder in a collection. + This method always returns the same object. + + + + + + diff --git a/Documentation/gsdoc/NSNull.html b/Documentation/gsdoc/NSNull.html new file mode 100644 index 000000000..00d65502c --- /dev/null +++ b/Documentation/gsdoc/NSNull.html @@ -0,0 +1,44 @@ + + NSNull + + +[Previous] +[Up] +[Next] +

    NSNull

    +

    Authors

    +
    +
    Richard Frith-Macdonald +
    +
    +

    Version: 0.1

    +

    Date: 21 October, 2000

    +

    NSNull

    +

    NSNull

    +

    Declared in: Foundation/NSNull.h

    +

    Inherits from: NSObject

    +

    Conforms to: NSObject +, NSCoding +, NSCopying +

    +
    + + +

    Instance Variables

    +
      +
    +

    Methods

    + +

    Class Methods

    +

    null

    ++ (NSNull*) null;
    + + Return an object that can be used as a placeholder in a collection. + This method always returns the same object. + +
    + + + diff --git a/Documentation/gsdoc/NSNumber.gsdoc b/Documentation/gsdoc/NSNumber.gsdoc index b716caf9c..dc9d3f553 100644 --- a/Documentation/gsdoc/NSNumber.gsdoc +++ b/Documentation/gsdoc/NSNumber.gsdoc @@ -1,6 +1,6 @@ - + NSNumber diff --git a/Documentation/gsdoc/NSNumber.html b/Documentation/gsdoc/NSNumber.html index 01e2e4b7d..ddce4556a 100644 --- a/Documentation/gsdoc/NSNumber.html +++ b/Documentation/gsdoc/NSNumber.html @@ -2,7 +2,7 @@ NSNumber -[Previous] +[Previous] [Up] [Next]

    NSNumber

    diff --git a/Headers/gnustep/base/Foundation.h b/Headers/gnustep/base/Foundation.h index 6ab364984..d9c2996fd 100644 --- a/Headers/gnustep/base/Foundation.h +++ b/Headers/gnustep/base/Foundation.h @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include diff --git a/Headers/gnustep/base/NSNull.h b/Headers/gnustep/base/NSNull.h new file mode 100644 index 000000000..c7d883903 --- /dev/null +++ b/Headers/gnustep/base/NSNull.h @@ -0,0 +1,39 @@ +/* Interface for NSNull for GNUStep + Copyright (C) 2000 Free Software Foundation, Inc. + + Written by: Richard Frith-Macdonald + 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 + +@interface NSNull : NSObject ++ (NSNull*) null; +@end + +#endif + +#endif /* __NSNull_h_GNUSTEP_BASE_INCLUDE */ diff --git a/Source/GNUmakefile b/Source/GNUmakefile index 6c4eddd47..f2f89783e 100644 --- a/Source/GNUmakefile +++ b/Source/GNUmakefile @@ -190,6 +190,7 @@ NSMethodSignature.m \ NSNotification.m \ NSNotificationCenter.m \ NSNotificationQueue.m \ +NSNull.m \ NSNumber.m \ NSNumberFormatter.m \ NSObjCRuntime.m \ @@ -291,6 +292,7 @@ NSMapTable.h \ NSMethodSignature.h \ NSNotification.h \ NSNotificationQueue.h \ +NSNull.h \ NSNumberFormatter.h \ NSObjCRuntime.h \ NSObject.h \ diff --git a/Source/NSNull.m b/Source/NSNull.m new file mode 100644 index 000000000..da4d9b74d --- /dev/null +++ b/Source/NSNull.m @@ -0,0 +1,102 @@ +/* Implementation for NSNull for GNUStep + Copyright (C) 2000 Free Software Foundation, Inc. + + Written by: Richard Frith-Macdonald + 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 + +@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 + +