1998-02-05 22:06:20 +00:00
|
|
|
/* Interface for NSValue for GNUStep
|
1996-02-22 15:59:37 +00:00
|
|
|
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
|
|
|
Written by: Adam Fedor <fedor@boulder.colorado.edu>
|
1996-02-22 15:59:37 +00:00
|
|
|
Created: 1995
|
1995-03-23 03:47:56 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-03-23 03:47:56 +00:00
|
|
|
|
|
|
|
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
|
1999-09-09 02:56:20 +00:00
|
|
|
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
|
1995-03-23 03:47:56 +00:00
|
|
|
*/
|
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef __NSValue_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSValue_h_GNUSTEP_BASE_INCLUDE
|
1995-03-18 17:15:15 +00:00
|
|
|
|
1995-04-17 21:13:20 +00:00
|
|
|
#include <Foundation/NSObject.h>
|
|
|
|
#include <Foundation/NSGeometry.h>
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
@class NSString;
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* The <code>NSValue</code> class can wrap a single primitive value as an
|
|
|
|
* object so it can be used in the containers and other places where an object
|
|
|
|
* reference is needed. Once initialized, an <code>NSValue</code> is
|
|
|
|
* immutable, and there is no <code>NSMutableValue</code> class. You
|
|
|
|
* initialize it by giving it a pointer to the primitive value, and you should
|
|
|
|
* be careful this does not get freed until after the <code>NSValue</code> is
|
|
|
|
* no longer used.
|
|
|
|
*/
|
1995-03-18 17:15:15 +00:00
|
|
|
@interface NSValue : NSObject <NSCopying, NSCoding>
|
|
|
|
|
|
|
|
// Allocating and Initializing
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Create new instance with specified value (a pointer) of given type, which
|
|
|
|
* is a string code obtainable through the compile-time operator
|
|
|
|
* <code>@encode(...)</code>. For example:
|
|
|
|
<example>
|
|
|
|
NSValue *theValue = [NSValue value: &n withObjCType: @encode(int)];
|
|
|
|
</example>
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) value: (const void*)value withObjCType: (const char*)type;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create new instance holding anObject. This is useful if you want to add
|
|
|
|
* anObject to a collection such as [NSArray] but don't want it to be retained
|
|
|
|
* (a weak reference).
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) valueWithNonretainedObject: (id)anObject;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to create instance holding an <code>NSPoint</code>
|
|
|
|
* structure.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) valueWithPoint: (NSPoint)point;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to create instance holding a pointer. Same as
|
|
|
|
* using <code>@encode(void *)</code> in +value:withObjCType: .
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) valueWithPointer: (const void*)pointer;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to create instance holding an <code>NSRange</code>
|
|
|
|
* structure.
|
|
|
|
*/
|
2001-01-12 14:29:34 +00:00
|
|
|
+ (NSValue*) valueWithRange: (NSRange)range;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to create instance holding an <code>NSRect</code>
|
|
|
|
* structure.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) valueWithRect: (NSRect)rect;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convenience method to create instance holding an <code>NSSize</code>
|
|
|
|
* structure.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSValue*) valueWithSize: (NSSize)size;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
1997-09-18 14:56:47 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Synonym for value:withObjCType: .
|
|
|
|
*/
|
1999-06-14 09:07:52 +00:00
|
|
|
+ (NSValue*) valueWithBytes: (const void*)value objCType: (const char*)type;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/** <init/>
|
|
|
|
* Initialize with value of type, parallel to value:withObjCType: .
|
|
|
|
*/
|
2001-12-17 14:31:42 +00:00
|
|
|
- (id) initWithBytes: (const void*)data objCType: (const char*)type;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compares this instance to another <code>NSValue</code>. For equality,
|
|
|
|
* both contents and declared type of the two values must match.
|
|
|
|
*/
|
1998-03-12 14:21:20 +00:00
|
|
|
- (BOOL) isEqualToValue: (NSValue*)other;
|
1997-09-18 14:56:47 +00:00
|
|
|
#endif
|
|
|
|
|
1995-03-18 17:15:15 +00:00
|
|
|
// Accessing Data
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Copies bytes from the pointer receiver was initialized with into buffer
|
|
|
|
* pointed to by value. Number of bytes copied is determined by the type. If
|
|
|
|
* type was a void * pointer or object id, the memory address itself is
|
|
|
|
* copied.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (void) getValue: (void*)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the string <code>@encode(...)</code> compatible type the receiver
|
|
|
|
* was initialized with.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (const char*) objCType;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with an object ID, return it, else raises
|
|
|
|
* <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (id) nonretainedObjectValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with a void * pointer, return it, else raises
|
|
|
|
* <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (void*) pointerValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with an <code>NSRange</code> value, return it,
|
|
|
|
* else raises <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
2001-01-12 14:29:34 +00:00
|
|
|
- (NSRange) rangeValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with an <code>NSRect</code> value, return it,
|
|
|
|
* else raises <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (NSRect) rectValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with an <code>NSSize</code> value, return it,
|
|
|
|
* else raises <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (NSSize) sizeValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* If receiver was initialized with an <code>NSPoint</code> value, return it,
|
|
|
|
* else raises <code>NSInternalInconsistencyException</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (NSPoint) pointValue;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Subclass of [NSValue] offering convenience methods for initializing from
|
|
|
|
* and accessing as any C primitive numeric type. On access, the value will
|
|
|
|
* be type-converted if necessary, using standard C conversion rules.
|
|
|
|
*/
|
1998-03-12 14:21:20 +00:00
|
|
|
@interface NSNumber : NSValue <NSCopying,NSCoding>
|
1995-03-18 17:15:15 +00:00
|
|
|
|
|
|
|
// Allocating and Initializing
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from boolean value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithBool: (BOOL)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from signed char value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
+ (NSNumber*) numberWithChar: (signed char)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from double value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithDouble: (double)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from float value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithFloat: (float)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from (signed) int value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
+ (NSNumber*) numberWithInt: (signed int)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from (signed) long value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
+ (NSNumber*) numberWithLong: (signed long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from (signed) long long value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
+ (NSNumber*) numberWithLongLong: (signed long long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from (signed) short value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
+ (NSNumber*) numberWithShort: (signed short)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from unsigned char value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithUnsignedChar: (unsigned char)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from unsigned int value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithUnsignedInt: (unsigned int)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from unsigned long value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithUnsignedLong: (unsigned long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from unsigned long long value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithUnsignedLongLong: (unsigned long long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** New instance from unsigned short value. */
|
1995-03-23 03:47:56 +00:00
|
|
|
+ (NSNumber*) numberWithUnsignedShort: (unsigned short)value;
|
1995-03-18 17:15:15 +00:00
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from boolean value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithBool: (BOOL)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from signed char value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (id) initWithChar: (signed char)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from double value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithDouble: (double)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from float value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithFloat: (float)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from (signed) int value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (id) initWithInt: (signed int)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from (signed) long value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (id) initWithLong: (signed long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from (signed) long long value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (id) initWithLongLong: (signed long long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from (signed) short value. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (id) initWithShort: (signed short)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from unsigned char value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithUnsignedChar: (unsigned char)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from unsigned int value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithUnsignedInt: (unsigned int)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from unsigned long value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithUnsignedLong: (unsigned long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from unsigned long long value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithUnsignedLongLong: (unsigned long long)value;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Initialize from unsigned short value. */
|
2000-03-19 20:57:09 +00:00
|
|
|
- (id) initWithUnsignedShort: (unsigned short)value;
|
1998-02-05 22:06:20 +00:00
|
|
|
|
1995-03-18 17:15:15 +00:00
|
|
|
// Accessing Data
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Return value as a BOOL; this will in fact be a char value converted
|
|
|
|
* if necessary from type initialized with; if you wish to consider anything
|
|
|
|
* nonzero TRUE do not compare directly to YES, but use <code>'!= NO'</code>.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (BOOL) boolValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a signed char, converting if necessary. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (signed char) charValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a double, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (double) doubleValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a float, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (float) floatValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a (signed) int, converting if necessary. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (signed int) intValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a (signed) long, converting if necessary. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (signed long) longValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as a (signed) long long, converting if necessary. */
|
|
|
|
- (signed long long) longLongValue;
|
|
|
|
/** Returns value as a (signed) short, converting if necessary. */
|
2000-08-07 22:00:31 +00:00
|
|
|
- (signed short) shortValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as an unsigned char, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (unsigned char) unsignedCharValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as an unsigned int, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (unsigned int) unsignedIntValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as an unsigned long, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (unsigned long) unsignedLongValue;
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns value as an unsigned long long, converting if necessary. */
|
|
|
|
- (unsigned long long) unsignedLongLongValue;
|
|
|
|
/** Returns value as an unsigned short, converting if necessary. */
|
1995-03-23 03:47:56 +00:00
|
|
|
- (unsigned short) unsignedShortValue;
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Returns -description . */
|
|
|
|
- (NSString*) stringValue;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the string representation of this number using a non-localised
|
|
|
|
* conversion (decimal point is '.' irrespective of the locale).
|
|
|
|
*/
|
1998-02-05 22:06:20 +00:00
|
|
|
- (NSString*) description;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* <p>
|
|
|
|
* Produces a string representation of the number. For a boolean
|
|
|
|
* this will be either 'true' or 'false'. For other numbers the
|
|
|
|
* format is produced using the initWithFormat:locale:... method
|
|
|
|
* of NSString, and the format depends on the type of number as
|
|
|
|
* follows -
|
|
|
|
* </p>
|
|
|
|
* <deflist>
|
|
|
|
* <term>char</term>
|
|
|
|
* <desc>%i</desc>
|
|
|
|
* <term> short</term>
|
|
|
|
* <desc>%hi</desc>
|
|
|
|
* <term> int</term>
|
|
|
|
* <desc>%i</desc>
|
|
|
|
* <term> long</term>
|
|
|
|
* <desc>%li</desc>
|
|
|
|
* <term> long long</term>
|
|
|
|
* <desc>%lli</desc>
|
|
|
|
* <term> unsigned char</term>
|
|
|
|
* <desc>%u</desc>
|
|
|
|
* <term> unsigned short</term>
|
|
|
|
* <desc>%hu</desc>
|
|
|
|
* <term> unsigned int</term>
|
|
|
|
* <desc>%u</desc>
|
|
|
|
* <term> unsigned long</term>
|
|
|
|
* <desc>%lu</desc>
|
|
|
|
* <term> unsigned long long</term>
|
|
|
|
* <desc>%llu</desc>
|
|
|
|
* <term> float</term>
|
|
|
|
* <desc>%0.7g</desc>
|
|
|
|
* <term> double</term>
|
|
|
|
* <desc>%0.16g</desc>
|
|
|
|
* </deflist>
|
|
|
|
*/
|
1998-02-05 22:06:20 +00:00
|
|
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale;
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* Compares receiver with otherNumber, using C type conversion if necessary,
|
|
|
|
* and returns <code>NSOrderedAscending</code>,
|
|
|
|
* <code>NSOrderedDescending</code>, or <code>NSOrderedSame</code> depending
|
|
|
|
* on whether it is less than, greater than, or equal to otherNumber.
|
|
|
|
*/
|
1995-03-23 03:47:56 +00:00
|
|
|
- (NSComparisonResult) compare: (NSNumber*)otherNumber;
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether receiver and otherNumber represent the same numerical value.
|
|
|
|
*/
|
1998-02-05 22:06:20 +00:00
|
|
|
- (BOOL) isEqualToNumber: (NSNumber*)otherNumber;
|
1995-03-18 17:15:15 +00:00
|
|
|
@end
|
1995-03-23 03:47:56 +00:00
|
|
|
|
1999-06-14 09:07:52 +00:00
|
|
|
#ifndef NO_GNUSTEP
|
2003-04-17 06:20:17 +00:00
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/**
|
|
|
|
* GNUstep specific (non-standard) additions to the NSNumber class.
|
|
|
|
*/
|
2003-04-17 06:20:17 +00:00
|
|
|
@interface NSNumber(GSCategories)
|
2004-06-22 22:27:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Parses string as a <code>double</code>, <code>int</code>, or <code>unsigned
|
|
|
|
* int</code> depending on what characters are present. Uses
|
|
|
|
* <code>atof</code> and <code>atoi</code> which don't report errors, so be
|
|
|
|
* careful if the string might contain an invalid value.
|
|
|
|
*/
|
2003-04-17 06:20:17 +00:00
|
|
|
+ (NSValue*) valueFromString: (NSString *)string;
|
|
|
|
@end
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Note: Defines a method that is not in the OpenStep spec, but makes
|
|
|
|
subclassing easier. */
|
1995-04-03 20:07:18 +00:00
|
|
|
@interface NSValue (Subclassing)
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
/** Used by value: withObjCType: to determine the concrete subclass to alloc. */
|
2000-03-19 20:57:09 +00:00
|
|
|
+ (Class) valueClassWithObjCType: (const char*)type;
|
1995-04-03 20:07:18 +00:00
|
|
|
|
|
|
|
@end
|
2000-03-19 20:57:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Cache info for internal use by NSNumber concrete subclasses.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2000-03-23 18:57:43 +00:00
|
|
|
int typeLevel;
|
|
|
|
void (*getValue)(NSNumber*, SEL, void*);
|
2000-03-19 20:57:09 +00:00
|
|
|
} GSNumberInfo;
|
|
|
|
|
|
|
|
GSNumberInfo *GSNumberInfoFromObject(NSNumber *o);
|
|
|
|
#define GS_SMALL 16
|
|
|
|
/*
|
|
|
|
* Get cached values for integers in the range -GS_SMALL to +GS_SMALL
|
|
|
|
*/
|
|
|
|
unsigned GSSmallHash(int n);
|
1999-06-14 09:07:52 +00:00
|
|
|
#endif
|
1995-04-03 20:07:18 +00:00
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#endif /* __NSValue_h_GNUSTEP_BASE_INCLUDE */
|