ObjFW  Diff

Differences From Artifact [0d48d79112]:

To Artifact [7e3b1e1f63]:


82
83
84
85
86
87
88
89

90
91
92
93
94
95
96
97
82
83
84
85
86
87
88

89

90
91
92
93
94
95
96







-
+
-







 * @brief Creates a new OFMutableData with enough memory to hold the specified
 *	  number of items which all have the same specified size.
 *
 * @param itemSize The size of a single element in the OFMutableData
 * @param capacity The initial capacity for the OFMutableData
 * @return A new autoreleased OFMutableData
 */
+ (instancetype)dataWithItemSize: (size_t)itemSize
+ (instancetype)dataWithItemSize: (size_t)itemSize capacity: (size_t)capacity;
			capacity: (size_t)capacity;

/**
 * @brief Initializes an already allocated OFMutableData with an item size of 1.
 *
 * @return An initialized OFMutableData
 */
- (instancetype)init;
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
119
120
121
122
123
124
125

126

127
128
129
130
131
132
133







-
+
-







 *	  hold the the specified number of items which all have the same
 *	  specified size.
 *
 * @param itemSize The size of a single element in the OFMutableData
 * @param capacity The initial capacity for the OFMutableData
 * @return An initialized OFMutableData
 */
- (instancetype)initWithItemSize: (size_t)itemSize
- (instancetype)initWithItemSize: (size_t)itemSize capacity: (size_t)capacity;
			capacity: (size_t)capacity;

/**
 * @brief Returns a specific item of the OFMutableData.
 *
 * Modifying the returned item directly is allowed and will change the contents
 * of the data.
 *
147
148
149
150
151
152
153
154

155
156
157
158
159
160
161
162
163

164
165
166
167
168
169
170
171
145
146
147
148
149
150
151

152

153
154
155
156
157
158
159

160

161
162
163
164
165
166
167







-
+
-







-
+
-








/**
 * @brief Adds an item to the OFMutableData at the specified index.
 *
 * @param item A pointer to an arbitrary item
 * @param index The index where the item should be added
 */
- (void)insertItem: (const void *)item
- (void)insertItem: (const void *)item atIndex: (size_t)index;
	   atIndex: (size_t)index;

/**
 * @brief Adds items from a C array to the OFMutableData.
 *
 * @param items A C array containing the items to add
 * @param count The number of items to add
 */
- (void)addItems: (const void *)items
- (void)addItems: (const void *)items count: (size_t)count;
	   count: (size_t)count;

/**
 * @brief Adds items from a C array to the OFMutableData at the specified index.
 *
 * @param items A C array containing the items to add
 * @param index The index where the items should be added
 * @param count The number of items to add