Oolite 1.91.0.7644-241112-7f5034b
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]
 
- Instance Methods inherited from <OldSchoolPropertyListWriting>

Detailed Description

Definition at line 46 of file OldSchoolPropertyListWriting.h.

Method Documentation

◆ oldSchoolPListFormatWithIndentation:errorDescription:

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

Reimplemented from <OldSchoolPropertyListWriting>.

Definition at line 325 of file OldSchoolPropertyListWriting.m.

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

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