506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
|
if ([line isKindOfClass: [OFINICategory_Comment class]]) {
OFINICategory_Comment *comment = line;
[stream writeFormat: @"%@\r\n", comment->_comment];
} else if ([line isKindOfClass: [OFINICategory_Pair class]]) {
OFINICategory_Pair *pair = line;
OFString *key = escapeString(pair->_key);
OFString *value = escapeString(pair->_value);
OFString *line = [OFString
stringWithFormat: @"%@=%@\r\n", key, value];
[stream writeString: line
encoding: encoding];
} else
@throw [OFInvalidArgumentException exception];
}
return true;
}
@end
|
|
|
|
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
|
if ([line isKindOfClass: [OFINICategory_Comment class]]) {
OFINICategory_Comment *comment = line;
[stream writeFormat: @"%@\r\n", comment->_comment];
} else if ([line isKindOfClass: [OFINICategory_Pair class]]) {
OFINICategory_Pair *pair = line;
OFString *key = escapeString(pair->_key);
OFString *value = escapeString(pair->_value);
OFString *tmp = [OFString
stringWithFormat: @"%@=%@\r\n", key, value];
[stream writeString: tmp
encoding: encoding];
} else
@throw [OFInvalidArgumentException exception];
}
return true;
}
@end
|