@@ -31,21 +31,28 @@ @property (readonly, nonatomic) const char *objCType; /*! * @brief The value as a pointer to void. * - * If the value is not pointer-sized, @ref OFInvalidFormatException is thrown. + * If the value is not pointer-sized, @ref OFOutOfRangeException is thrown. */ @property (readonly, nonatomic) void *pointerValue; /*! * @brief The value as a non-retained object. * - * If the value is not pointer-sized, @ref OFInvalidFormatException is thrown. + * If the value is not pointer-sized, @ref OFOutOfRangeException is thrown. */ @property (readonly, nonatomic) id nonretainedObjectValue; +/*! + * @brief The value as a range. + * + * If the value is not range-sized, @ref OFOutOfRangeException is thrown. + */ +@property (readonly, nonatomic) of_range_t rangeValue; + /*! * @brief Creates a new, autorelease OFValue with the specified bytes of the * specified type. * * @param bytes The bytes containing the value @@ -75,10 +82,18 @@ * @param object The object the OFValue should contain without retaining it * @return A new, autoreleased OFValue */ + (instancetype)valueWithNonretainedObject: (id)object; +/*! + * @brief Creates a new, autoreleased OFValue containing the specified range. + * + * @param range The range the OFValue should contain + * @return A new, autoreleased OFValue + */ ++ (instancetype)valueWithRange: (of_range_t)range; + /*! * @brief Initializes an already allocated OFValue with the specified bytes of * the specified type. * * @param bytes The bytes containing the value @@ -109,10 +124,19 @@ * @param object The object the OFValue should contain without retaining it * @return An initialized OFValue */ - (instancetype)initWithNonretainedObject: (id)object; +/*! + * @brief Initializes an already allocated OFValue containing the specified + * range. + * + * @param range The range the OFValue should contain + * @return An initialized OFValue + */ +- (instancetype)initWithRange: (of_range_t)range; + /*! * @brief Gets the value. * * If the specified size does not match, this raises an * @ref OFOutOfRangeException.