@@ -26,14 +26,14 @@ #ifdef OF_HAVE_SYS_TYPES_H # include #endif -#import "OFObject.h" -#import "OFSerialization.h" #import "OFJSONRepresentation.h" #import "OFMessagePackRepresentation.h" +#import "OFSerialization.h" +#import "OFValue.h" OF_ASSUME_NONNULL_BEGIN /*! @file */ @@ -114,11 +114,11 @@ /*! * @class OFNumber OFNumber.h ObjFW/OFNumber.h * * @brief Provides a way to store a number in an object. */ -@interface OFNumber: OFObject { union of_number_value { bool bool_; signed char sChar; @@ -294,10 +294,21 @@ /*! * @brief The OFNumber as a `double`. */ @property (readonly, nonatomic) double doubleValue; + +#ifdef OF_HAVE_UNAVAILABLE ++ (instancetype)valueWithBytes: (const void *)bytes + objCType: (const char *)objCType OF_UNAVAILABLE; ++ (instancetype)valueWithPointer: (const void *)pointer OF_UNAVAILABLE; ++ (instancetype)valueWithNonretainedObject: (id)object OF_UNAVAILABLE; ++ (instancetype)valueWithRange: (of_range_t)range OF_UNAVAILABLE; ++ (instancetype)valueWithPoint: (of_point_t)point OF_UNAVAILABLE; ++ (instancetype)valueWithDimension: (of_dimension_t)dimension OF_UNAVAILABLE; ++ (instancetype)valueWithRectangle: (of_rectangle_t)rectangle OF_UNAVAILABLE; +#endif /*! * @brief Creates a new OFNumber with the specified `bool`. * * @param bool_ A `bool` which the OFNumber should contain @@ -520,10 +531,20 @@ * @return A new autoreleased OFNumber */ + (instancetype)numberWithDouble: (double)double_; - (instancetype)init OF_UNAVAILABLE; +#ifdef OF_HAVE_UNAVAILABLE +- (instancetype)initWithBytes: (const void *)bytes + objCType: (const char *)objCType OF_UNAVAILABLE; +- (instancetype)initWithPointer: (const void *)pointer OF_UNAVAILABLE; +- (instancetype)initWithNonretainedObject: (id)object OF_UNAVAILABLE; +- (instancetype)initWithRange: (of_range_t)range OF_UNAVAILABLE; +- (instancetype)initWithPoint: (of_point_t)point OF_UNAVAILABLE; +- (instancetype)initWithDimension: (of_dimension_t)dimension OF_UNAVAILABLE; +- (instancetype)initWithRectangle: (of_rectangle_t)rectangle OF_UNAVAILABLE; +#endif /*! * @brief Initializes an already allocated OFNumber with the specified `bool`. * * @param bool_ A `bool` which the OFNumber should contain