ObjFW  Check-in [acd8e03f58]

Overview
Comment:Return mutable collections in -[JSONValue].

This allows modifying data and getting the JSON representation again.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: acd8e03f58db91a17fc7ebcfdc59aa7404bddc6bf40d5f04c2b44d14d0e8e9ab
User & Date: js on 2012-02-06 11:31:19
Other Links: manifest | tags
Context
2012-02-17
16:25
Fix a very bad typo in OFStreamObserver_poll. check-in: e9b0575094 user: js tags: trunk
2012-02-06
11:31
Return mutable collections in -[JSONValue]. check-in: acd8e03f58 user: js tags: trunk
2012-02-05
14:29
It seems signing is not required anymore on iOS. check-in: 5d732af342 user: js tags: trunk
Changes

Modified src/OFString+JSONValue.m from [b960291ebc] to [887f63d0ca].

255
256
257
258
259
260
261
262

263
264
265
266
267
268
269
255
256
257
258
259
260
261

262
263
264
265
266
267
268
269







-
+







		}
	}

	free(buffer);
	return nil;
}

static OF_INLINE OFArray*
static OF_INLINE OFMutableArray*
parseArray(const char *restrict *pointer, const char *stop)
{
	OFMutableArray *array = [OFMutableArray array];

	if (++(*pointer) >= stop)
		return nil;

292
293
294
295
296
297
298
299
300
301
302
303
304
305
306

307
308
309
310
311
312
313
292
293
294
295
296
297
298


299
300
301
302
303

304
305
306
307
308
309
310
311







-
-





-
+








			if (*pointer >= stop)
				return nil;
		} else if (**pointer != ']')
			return nil;
	}

	[array makeImmutable];

	(*pointer)++;

	return array;
}

static OF_INLINE OFDictionary*
static OF_INLINE OFMutableDictionary*
parseDictionary(const char *restrict *pointer, const char *stop)
{
	OFMutableDictionary *dictionary = [OFMutableDictionary dictionary];

	if (++(*pointer) >= stop)
		return nil;

346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
344
345
346
347
348
349
350


351
352
353
354
355
356
357







-
-








			if (*pointer >= stop)
				return nil;
		} else if (**pointer != '}')
			return nil;
	}

	[dictionary makeImmutable];

	(*pointer)++;

	return dictionary;
}

static OF_INLINE OFNumber*
parseNumber(const char *restrict *pointer, const char *stop)