Oolite
Loading...
Searching...
No Matches
NSNumber(OldSchoolPropertyListWriting) Category Reference

#include <OldSchoolPropertyListWriting.h>

Inheritance diagram for NSNumber(OldSchoolPropertyListWriting):
Collaboration diagram for NSNumber(OldSchoolPropertyListWriting):

Instance Methods

(NSString *) - oldSchoolPListFormatWithIndentation:errorDescription: [implementation]

Detailed Description

Definition at line 42 of file OldSchoolPropertyListWriting.h.

Method Documentation

◆ oldSchoolPListFormatWithIndentation:errorDescription:

- (NSString *) oldSchoolPListFormatWithIndentation: (unsigned) inIndentation
errorDescription: (NSString**) outErrorDescription 
implementation

Reimplemented from <OldSchoolPropertyListWriting>.

Definition at line 89 of file OldSchoolPropertyListWriting.m.

89 :(unsigned)inIndentation errorDescription:(NSString**)outErrorDescription
90{
91 NSString* result;
92 double dVal;
93
94 if ([self oo_isBoolean]) {
95 if ([self boolValue])
96 result = @"true";
97 else
98 result = @"false";
99 } else if ([self oo_isFloatingPointNumber]) {
100 dVal = [self doubleValue];
101 result = [NSString stringWithFormat:@"%.8g", dVal];
102 } else
103 result = [NSString stringWithFormat:@"%@", self];
104
105 // Allow infinities, but remember that they’ll be read in as strings
106#if 0
107 if ([result isEqual:@"inf"] || [result isEqual:@"-inf"])
108 {
109 *outErrorDescription = @"infinities cannot be represented in old-school property lists";
110 return nil;
111 }
112#endif
113
114 return result;
115}
return nil

References nil.


The documentation for this category was generated from the following files: