Differences From Artifact [05bf2af151]:
- File
src/OFDataArray+BinaryPackValue.m
— part of check-in
[12f091ddd6]
at
2013-02-21 16:15:16
on branch trunk
— Add support for parsing BinaryPack.
Support for generating BinaryPack will follow. (user: js, size: 8148) [annotate] [blame] [check-ins using]
To Artifact [2abd788e61]:
- File src/OFDataArray+BinaryPackValue.m — part of check-in [19f5a60438] at 2013-02-23 10:03:02 on branch trunk — Update to BinaryPack1pre1. (user: js, size: 8364) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
152 153 154 155 156 157 158 | } if ((buffer[0] & 0xE0) == 0xE0) { *object = [OFNumber numberWithInt8: ((int8_t)(buffer[0] & 0x1F)) - 32]; return 1; } | < < < < < < < < < < < < < < < | | | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | } if ((buffer[0] & 0xE0) == 0xE0) { *object = [OFNumber numberWithInt8: ((int8_t)(buffer[0] & 0x1F)) - 32]; return 1; } /* String */ if ((buffer[0] & 0xE0) == 0xA0) { count = buffer[0] & 0x1F; if (length < count + 1) goto error; *object = [OFString stringWithUTF8String: (const char*)buffer + 1 length: count]; |
︙ | ︙ | |||
286 287 288 289 290 291 292 293 294 295 296 297 298 299 | *object = [OFNumber numberWithBool: NO]; return 1; /* true */ case 0xC3: *object = [OFNumber numberWithBool: YES]; return 1; /* Data */ case 0xDA: if (length < 3) goto error; count = read_uint16(buffer + 1); if (length < count + 3) | > > > > > > > > > > > > > > > | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | *object = [OFNumber numberWithBool: NO]; return 1; /* true */ case 0xC3: *object = [OFNumber numberWithBool: YES]; return 1; /* Data */ case 0xD9: if (length < 2) goto error; count = buffer[1]; if (length < count + 2) goto error; *object = [OFDataArray dataArrayWithItemSize: 1 capacity: count]; [*object addItems: buffer + 2 count: count]; return count + 2; case 0xDA: if (length < 3) goto error; count = read_uint16(buffer + 1); if (length < count + 3) |
︙ | ︙ | |||
317 318 319 320 321 322 323 | *object = [OFDataArray dataArrayWithItemSize: 1 capacity: count]; [*object addItems: buffer + 5 count: count]; return count + 5; /* Strings */ | | > > > > > > > > > > > > > | | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | *object = [OFDataArray dataArrayWithItemSize: 1 capacity: count]; [*object addItems: buffer + 5 count: count]; return count + 5; /* Strings */ case 0xD6: if (length < 2) goto error; count = buffer[1]; if (length < count + 2) goto error; *object = [OFString stringWithUTF8String: (const char*)buffer + 2 length: count]; return count + 2; case 0xD7: if (length < 3) goto error; count = read_uint16(buffer + 1); if (length < count + 3) goto error; *object = [OFString stringWithUTF8String: (const char*)buffer + 3 length: count]; return count + 3; case 0xD8: if (length < 5) goto error; count = read_uint32(buffer + 1); if (length < count + 5) goto error; |
︙ | ︙ |