ObjFW  Check-in [57ef5e22ab]

Overview
Comment:Make OFDataArray's cArray a property.

This makes sense as the returned array is not a copy and may even be
changed directly.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 57ef5e22ab7ad31955ca3bfe0e082bdb72fffe8d99d74a6224346ed4fb20e1f5
User & Date: js on 2011-11-14 18:33:16
Other Links: manifest | tags
Context
2011-11-20
18:41
Make OFString a class cluster. check-in: 301ee63212 user: js tags: trunk
2011-11-14
18:33
Make OFDataArray's cArray a property. check-in: 57ef5e22ab user: js tags: trunk
2011-11-02
11:20
Fix parsing of struct tm. check-in: 5d102d382e user: js tags: trunk
Changes

Modified src/OFDataArray.h from [a9d438e321] to [beb53a5545].

33
34
35
36
37
38
39

40
41
42
43
44
45
46
{
	char   *data;
	size_t count;
	size_t itemSize;
}

#ifdef OF_HAVE_PROPERTIES

@property (readonly) size_t count;
@property (readonly) size_t itemSize;
#endif

/**
 * \brief Creates a new OFDataArray with an item size of 1.
 *







>







33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
	char   *data;
	size_t count;
	size_t itemSize;
}

#ifdef OF_HAVE_PROPERTIES
@property (readonly, getter=cArray) void *data;
@property (readonly) size_t count;
@property (readonly) size_t itemSize;
#endif

/**
 * \brief Creates a new OFDataArray with an item size of 1.
 *
138
139
140
141
142
143
144


145
146
147
148
149
150
151
 *
 * \return The size of each item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/**
 * \brief Returns all elements of the OFDataArray as a C array.


 *
 * Modifying the returned array directly is allowed and will change the contents
 * of the data array.
 *
 * \return All elements of the OFDataArray as a C array
 */
- (void*)cArray;







>
>







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
 *
 * \return The size of each item in the OFDataArray in bytes
 */
- (size_t)itemSize;

/**
 * \brief Returns all elements 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.
 *
 * \return All elements of the OFDataArray as a C array
 */
- (void*)cArray;