Overview
Context
Changes
Modified src/OFData.h
from [bda35b67de]
to [507fa08959].
︙ | | |
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
-
+
-
+
|
*
* @param items The items to store in the OFData
* @param count The number of items
* @param freeWhenDone Whether to free the pointer when it is no longer needed
* by the OFData
* @return A new autoreleased OFData
*/
+ (instancetype)dataWithItemsNoCopy: (const void *)items
+ (instancetype)dataWithItemsNoCopy: (void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone;
/*!
* @brief Creates a new OFData with the specified `count` items of the
* specified size by taking ownership of the specified items pointer.
*
* @param items The items to store in the OFData
* @param itemSize The item size of a single item in bytes
* @param count The number of items
* @param freeWhenDone Whether to free the pointer when it is no longer needed
* by the OFData
* @return A new autoreleased OFData
*/
+ (instancetype)dataWithItemsNoCopy: (const void *)items
+ (instancetype)dataWithItemsNoCopy: (void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone;
#ifdef OF_HAVE_FILES
/*!
* @brief Creates a new OFData with an item size of 1, containing the data of
|
︙ | | |
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
-
+
-
+
|
*
* @param items The items to store in the OFData
* @param count The number of items
* @param freeWhenDone Whether to free the pointer when it is no longer needed
* by the OFData
* @return An initialized OFData
*/
- (instancetype)initWithItemsNoCopy: (const void *)items
- (instancetype)initWithItemsNoCopy: (void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone;
/*!
* @brief Initializes an already allocated OFData with the specified `count`
* items of the specified size by taking ownership of the specified
* items pointer.
*
* @param items The items to store in the OFData
* @param itemSize The item size of a single item in bytes
* @param count The number of items
* @param freeWhenDone Whether to free the pointer when it is no longer needed
* by the OFData
* @return An initialized OFData
*/
- (instancetype)initWithItemsNoCopy: (const void *)items
- (instancetype)initWithItemsNoCopy: (void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone;
#ifdef OF_HAVE_FILES
/*!
* @brief Initializes an already allocated OFData with an item size of 1,
|
︙ | | |
Modified src/OFData.m
from [744ee14c6a]
to [d98f273881].
︙ | | |
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
-
+
-
+
|
count: (size_t)count
{
return [[[self alloc] initWithItems: items
itemSize: itemSize
count: count] autorelease];
}
+ (instancetype)dataWithItemsNoCopy: (const void *)items
+ (instancetype)dataWithItemsNoCopy: (void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
return [[[self alloc] initWithItemsNoCopy: items
count: count
freeWhenDone: freeWhenDone] autorelease];
}
+ (instancetype)dataWithItemsNoCopy: (const void *)items
+ (instancetype)dataWithItemsNoCopy: (void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
return [[[self alloc] initWithItemsNoCopy: items
itemSize: itemSize
count: count
|
︙ | | |
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
-
+
-
+
|
[self release];
@throw e;
}
return self;
}
- (instancetype)initWithItemsNoCopy: (const void *)items
- (instancetype)initWithItemsNoCopy: (void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
return [self initWithItemsNoCopy: items
itemSize: 1
count: count
freeWhenDone: freeWhenDone];
}
- (instancetype)initWithItemsNoCopy: (const void *)items
- (instancetype)initWithItemsNoCopy: (void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
self = [super init];
@try {
|
︙ | | |
Modified src/OFMutableData.h
from [68a8c877d6]
to [8d5b632b3f].
︙ | | |
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
-
-
-
-
-
-
-
-
|
* @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
capacity: (size_t)capacity;
+ (instancetype)dataWithItemsNoCopy: (const void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone OF_UNAVAILABLE;
+ (instancetype)dataWithItemsNoCopy: (const void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone OF_UNAVAILABLE;
/*!
* @brief Initializes an already allocated OFMutableData with an item size of 1.
*
* @return An initialized OFMutableData
*/
- (instancetype)init;
|
︙ | | |
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
-
-
-
-
-
-
-
-
|
* @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
capacity: (size_t)capacity;
- (instancetype)initWithItemsNoCopy: (const void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone OF_UNAVAILABLE;
- (instancetype)initWithItemsNoCopy: (const void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone OF_UNAVAILABLE;
/*!
* @brief Adds an item to the OFMutableData.
*
* @param item A pointer to an arbitrary item
*/
- (void)addItem: (const void *)item;
|
︙ | | |
Modified src/OFMutableData.m
from [c971350bab]
to [d12ca7c473].
︙ | | |
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
+ (instancetype)dataWithItemSize: (size_t)itemSize
capacity: (size_t)capacity
{
return [[[self alloc] initWithItemSize: itemSize
capacity: capacity] autorelease];
}
+ (instancetype)dataWithItemsNoCopy: (const void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
OF_UNRECOGNIZED_SELECTOR
}
+ (instancetype)dataWithItemsNoCopy: (const void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
OF_UNRECOGNIZED_SELECTOR
}
- (instancetype)init
{
self = [super of_init];
_itemSize = 1;
return self;
|
︙ | | |
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
-
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
|
count: count];
_capacity = _count;
return self;
}
- (instancetype)initWithItemsNoCopy: (const void *)items
- (instancetype)initWithItemsNoCopy: (void *)items
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
self = [self initWithItems: items
count: count];
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithItemsNoCopy: (const void *)items
if (freeWhenDone)
free(items);
return self;
}
- (instancetype)initWithItemsNoCopy: (void *)items
itemSize: (size_t)itemSize
count: (size_t)count
freeWhenDone: (bool)freeWhenDone
{
self = [self initWithItems: items
itemSize: itemSize
count: count];
OF_INVALID_INIT_METHOD
if (freeWhenDone)
free(items);
return self;
}
- (instancetype)initWithStringRepresentation: (OFString *)string
{
self = [super initWithStringRepresentation: string];
_capacity = _count;
|
︙ | | |