ObjFW  Check-in [2447ceff6e]

Overview
Comment:Add -[{decimal,hexadecimal,float,double}Value] to OFXMLElement.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2447ceff6ebf635a998a91efdb6b5f4a010d0ce005fb9b6e2e76a1bc14a63c3f
User & Date: js on 2011-06-06 00:22:49
Other Links: manifest | tags
Context
2011-06-06
00:35
Don't add unwanted whitespaces to character data on indentation. check-in: a36135d018 user: js tags: trunk
00:22
Add -[{decimal,hexadecimal,float,double}Value] to OFXMLElement. check-in: 2447ceff6e user: js tags: trunk
00:02
Add serialization.xml to Xcode project. check-in: 26da62682d user: js tags: trunk
Changes

Modified src/OFXMLElement.h from [6238b06167] to [b843614560].

250
251
252
253
254
255
256




















257
258
259
260
261
262
263
- (void)setStringValue: (OFString*)stringValue;

/**
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;





















/**
 * \return A new autoreleased OFString representing the OFXMLElement as an
 *	   XML string
 */
- (OFString*)XMLString;

/**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
- (void)setStringValue: (OFString*)stringValue;

/**
 * \return A string with the string value of all children concatenated
 */
- (OFString*)stringValue;

/**
 * \return An integer with the decimal value of all children concatenated
 */
- (intmax_t)decimalValue;

/**
 * \return An integer with the hexadecimal value of all children concatenated
 */
- (uintmax_t)hexadecimalValue;

/**
 * \return A float with the float value of all children concatenated
 */
- (float)floatValue;

/**
 * \return A double with the double value of all children concatenated
 */
- (double)doubleValue;

/**
 * \return A new autoreleased OFString representing the OFXMLElement as an
 *	   XML string
 */
- (OFString*)XMLString;

/**

Modified src/OFXMLElement.m from [c30a5b5e0c] to [c82b6a1f56].

431
432
433
434
435
436
437




















438
439
440
441
442
443
444
	 * Class swizzle the string to be immutable. We declared the return type
	 * to be OFString*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFString class];
	return ret;
}





















- (OFString*)_XMLStringWithParent: (OFXMLElement*)parent
		      indentation: (unsigned int)indentation
			    level: (size_t)level
{
	OFAutoreleasePool *pool, *pool2;
	char *cString;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
	 * Class swizzle the string to be immutable. We declared the return type
	 * to be OFString*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFString class];
	return ret;
}

- (intmax_t)decimalValue
{
	return [[self stringValue] decimalValue];
}

- (uintmax_t)hexadecimalValue
{
	return [[self stringValue] hexadecimalValue];
}

- (float)floatValue
{
	return [[self stringValue] floatValue];
}

- (double)doubleValue
{
	return [[self stringValue] doubleValue];
}

- (OFString*)_XMLStringWithParent: (OFXMLElement*)parent
		      indentation: (unsigned int)indentation
			    level: (size_t)level
{
	OFAutoreleasePool *pool, *pool2;
	char *cString;