16 #ifndef __STDC_LIMIT_MACROS
17 # define __STDC_LIMIT_MACROS
19 #ifndef __STDC_CONSTANT_MACROS
20 # define __STDC_CONSTANT_MACROS
23 #include "objfw-defs.h"
25 #ifdef OF_HAVE_SYS_TYPES_H
26 # include <sys/types.h>
29 #import "OFJSONRepresentation.h"
30 #import "OFMessagePackRepresentation.h"
31 #import "OFSerialization.h"
34 OF_ASSUME_NONNULL_BEGIN
44 OF_SUBCLASSING_RESTRICTED
49 union of_number_value {
52 unsigned long long unsigned_;
54 const char *_typeEncoding;
60 @property (readonly, nonatomic)
bool boolValue;
65 @property (readonly, nonatomic)
signed char charValue;
70 @property (readonly, nonatomic)
short shortValue;
75 @property (readonly, nonatomic)
int intValue;
80 @property (readonly, nonatomic)
long longValue;
85 @property (readonly, nonatomic)
long long longLongValue;
90 @property (readonly, nonatomic)
unsigned char unsignedCharValue;
95 @property (readonly, nonatomic)
unsigned short unsignedShortValue;
100 @property (readonly, nonatomic)
unsigned int unsignedIntValue;
105 @property (readonly, nonatomic)
unsigned long unsignedLongValue;
110 @property (readonly, nonatomic)
unsigned long long unsignedLongLongValue;
115 @property (readonly, nonatomic)
float floatValue;
120 @property (readonly, nonatomic)
double doubleValue;
125 @property (readonly, nonatomic)
OFString *stringValue;
127 #ifdef OF_HAVE_UNAVAILABLE
128 + (instancetype)valueWithBytes: (const
void *)bytes
129 objCType: (const
char *)objCType OF_UNAVAILABLE;
130 + (instancetype)valueWithPointer: (const
void *)pointer OF_UNAVAILABLE;
131 + (instancetype)valueWithNonretainedObject: (
id)object OF_UNAVAILABLE;
132 + (instancetype)valueWithRange: (
of_range_t)range OF_UNAVAILABLE;
133 + (instancetype)valueWithPoint: (
of_point_t)point OF_UNAVAILABLE;
134 + (instancetype)valueWithDimension: (
of_dimension_t)dimension OF_UNAVAILABLE;
135 + (instancetype)valueWithRectangle: (
of_rectangle_t)rectangle OF_UNAVAILABLE;
144 + (instancetype)numberWithBool: (
bool)value;
152 + (instancetype)numberWithChar: (
signed char)value;
160 + (instancetype)numberWithShort: (
short)value;
168 + (instancetype)numberWithInt: (
int)value;
176 + (instancetype)numberWithLong: (
long)value;
184 + (instancetype)numberWithLongLong: (
long long)value;
192 + (instancetype)numberWithUnsignedChar: (
unsigned char)value;
200 + (instancetype)numberWithUnsignedShort: (
unsigned short)value;
208 + (instancetype)numberWithUnsignedInt: (
unsigned int)value;
216 + (instancetype)numberWithUnsignedLong: (
unsigned long)value;
224 + (instancetype)numberWithUnsignedLongLong: (
unsigned long long)value;
232 + (instancetype)numberWithFloat: (
float)value;
240 + (instancetype)numberWithDouble: (
double)value;
242 - (instancetype)init OF_UNAVAILABLE;
243 #ifdef OF_HAVE_UNAVAILABLE
244 - (instancetype)initWithBytes: (const
void *)bytes
245 objCType: (const
char *)objCType OF_UNAVAILABLE;
246 - (instancetype)initWithPointer: (const
void *)pointer OF_UNAVAILABLE;
247 - (instancetype)initWithNonretainedObject: (
id)object OF_UNAVAILABLE;
248 - (instancetype)initWithRange: (
of_range_t)range OF_UNAVAILABLE;
249 - (instancetype)initWithPoint: (
of_point_t)point OF_UNAVAILABLE;
250 - (instancetype)initWithDimension: (
of_dimension_t)dimension OF_UNAVAILABLE;
251 - (instancetype)initWithRectangle: (
of_rectangle_t)rectangle OF_UNAVAILABLE;
260 - (instancetype)initWithBool: (
bool)value;
269 - (instancetype)initWithChar: (
signed char)value;
277 - (instancetype)initWithShort: (
short)value;
285 - (instancetype)initWithInt: (
int)value;
293 - (instancetype)initWithLong: (
long)value;
302 - (instancetype)initWithLongLong: (
long long)value;
311 - (instancetype)initWithUnsignedChar: (
unsigned char)value;
320 - (instancetype)initWithUnsignedShort: (
unsigned short)value;
329 - (instancetype)initWithUnsignedInt: (
unsigned int)value;
338 - (instancetype)initWithUnsignedLong: (
unsigned long)value;
347 - (instancetype)initWithUnsignedLongLong: (
unsigned long long)value;
355 - (instancetype)initWithFloat: (
float)value;
363 - (instancetype)initWithDouble: (
double)value;
366 OF_ASSUME_NONNULL_END
368 #if !defined(NSINTEGER_DEFINED) && !__has_feature(modules)
370 @compatibility_alias NSNumber
OFNumber;
Provides a way to store a number in an object.
Definition: OFNumber.h:49
A class for handling strings.
Definition: OFString.h:132
A class for storing arbitrary values in an object.
Definition: OFValue.h:27
A protocol for comparing objects.
Definition: OFObject.h:1224
A protocol implemented by classes that support encoding to a JSON representation.
Definition: OFJSONRepresentation.h:39
A protocol implemented by classes that support encoding to a MessagePack representation.
Definition: OFMessagePackRepresentation.h:29
A protocol for serializing objects.
Definition: OFSerialization.h:29
A dimension.
Definition: OFObject.h:192
A point.
Definition: OFObject.h:145
A range.
Definition: OFObject.h:93
A rectangle.
Definition: OFObject.h:239