ObjFW  Diff

Differences From Artifact [dbaf155683]:

To Artifact [f2fca692ea]:

  • File src/OFDataArray.h — part of check-in [48980f2297] at 2015-11-29 11:43:05 on branch trunk — Make properties a requirement and clean up code

    This increases the required GCC version from 4.0 to 4.6 (exception:
    Apple GCC, which already supports this with >= 4.0 starting with OS X
    10.5). Since even GCC 4.6 is really old by now, there is no point in
    still supporting something even older and making the code ugly because
    of that. While some hardware and OS support was dropped from GCC 4.6
    compared to GCC 4.0, there is nothing in there that would be an
    interesting target with the exception of BeOS maybe - but a port to BeOS
    can also be achieved using the Haiku support. The other dropped OSes are
    mostly old versions of OSes while newer ones are still being supported
    (and those newer versions of those OSes still support the same
    hardware). (user: js, size: 9091) [annotate] [blame] [check-ins using]


37
38
39
40
41
42
43
44

45
46

47
48
49
50
51
52
53
54
55
@interface OFDataArray: OFObject <OFCopying, OFComparing, OFSerialization,
    OFMessagePackRepresentation>
{
	uint8_t *_items;
	size_t _count, _itemSize, _capacity;
}

#ifdef OF_HAVE_PROPERTIES

@property (readonly) void *items;
@property (readonly) size_t count;

@property (readonly) size_t itemSize;
#endif

/*!
 * @brief Creates a new OFDataArray with an item size of 1.
 *
 * @return A new autoreleased OFDataArray
 */
+ (instancetype)dataArray;







<
>
|
<
>

<







37
38
39
40
41
42
43

44
45

46
47

48
49
50
51
52
53
54
@interface OFDataArray: OFObject <OFCopying, OFComparing, OFSerialization,
    OFMessagePackRepresentation>
{
	uint8_t *_items;
	size_t _count, _itemSize, _capacity;
}


/*!
 * The size of a single item in the OFDataArray in bytes.

 */
@property (readonly) size_t itemSize;


/*!
 * @brief Creates a new OFDataArray with an item size of 1.
 *
 * @return A new autoreleased OFDataArray
 */
+ (instancetype)dataArray;
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*!
 * @brief Returns the number of items in the OFDataArray.
 *
 * @return The number of items in the OFDataArray
 */
- (size_t)count;

/*!
 * @brief Returns the size of a single item in the OFDataArray in bytes.
 *
 * @return The size of a single item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/*!
 * @brief Returns all items of the OFDataArray as a C array.
 *
 * @warning The pointer is only valid until the OFDataArray is changed!
 *
 * Modifying the returned array directly is allowed and will change the contents
 * of the data array.







<
<
<
<
<
<
<







195
196
197
198
199
200
201







202
203
204
205
206
207
208
/*!
 * @brief Returns the number of items in the OFDataArray.
 *
 * @return The number of items in the OFDataArray
 */
- (size_t)count;








/*!
 * @brief Returns all items of the OFDataArray as a C array.
 *
 * @warning The pointer is only valid until the OFDataArray is changed!
 *
 * Modifying the returned array directly is allowed and will change the contents
 * of the data array.