NSString **_name, NSString **_class,
id self);
-static NSString *_makeStringForBuffer(const unichar *_buf, unsigned _l) {
- if (_l == 0)
- return @"";
-
- return [[StrClass alloc] initWithCharacters:_buf length:_l];
-}
-
- (NSException *)parseDefinitionsFromBuffer:(const unichar *)_buffer
length:(unsigned)_len
mappings:(NSMutableDictionary *)_mappings
if (startPos < endPos) {
NSString *ll;
-
- ll = _makeStringForBuffer(startPos, endPos - startPos);
+
+ ll = [[StrClass alloc] initWithCharacters:startPos
+ length:endPos - startPos];
[ui setObject:ll forKey:@"lastLine"];
[ll release];
}
}
else {
*_idx = pos;
- return _makeStringForBuffer(&(_buffer[startPos]), len);
+ return [[StrClass alloc] initWithCharacters:&(_buffer[startPos])
+ length:len];
}
}
static NSString *_parseKeyPath(NSZone *_zone,
str[pos2] = 0;
NSCAssert(pos2 == len, @"invalid unescape ..");
- ostr = _makeStringForBuffer(str, pos2);
+ ostr = [[StrClass alloc] initWithCharacters:str length:pos2];
if (str != NULL) free(str); str = NULL;
return ostr;
}
else {
NSCAssert(len > 0, @"invalid length ..");
- return _makeStringForBuffer(&(_buffer[startPos]), len);
+ return [[StrClass alloc] initWithCharacters:&(_buffer[startPos])
+ length:len];
}
}
}
if ((_buffer[*_idx] == 'Y') || (_buffer[*_idx] == 'N')) {
// parse YES and NO
if ((*_idx + 4) < _len) {
- if (_ucIsEqual(&(_buffer[*_idx]), "YES", 3) == 0 &&
+ if (_ucIsEqual(&(_buffer[*_idx]), "YES", 3) &&
_isBreakChar(_buffer[*_idx + 3])) {
result = [yesNum retain];
valueProperty = YES;
}
}
if (((*_idx + 3) < _len) && !valueProperty) {
- if (_ucIsEqual(&(_buffer[*_idx]), "NO", 2) == 0 &&
+ if (_ucIsEqual(&(_buffer[*_idx]), "NO", 2) &&
_isBreakChar(_buffer[*_idx + 2])) {
result = [noNum retain];
valueProperty = YES;
else if ((_buffer[*_idx] == 't') || (_buffer[*_idx] == 'f')) {
// parse true and false
if ((*_idx + 5) < _len) {
- if (_ucIsEqual(&(_buffer[*_idx]), "true", 4) == 0 &&
+ if (_ucIsEqual(&(_buffer[*_idx]), "true", 4) &&
_isBreakChar(_buffer[*_idx + 4])) {
result = [yesNum retain];
valueProperty = YES;
}
}
if (((*_idx + 6) < _len) && !valueProperty) {
- if (_ucIsEqual(&(_buffer[*_idx]), "false", 5) == 0 &&
+ if (_ucIsEqual(&(_buffer[*_idx]), "false", 5) &&
_isBreakChar(_buffer[*_idx + 5])) {
result = [noNum retain];
valueProperty = YES;
}
NSCAssert(result, @"missing property value ..");
-
+
if (_allowAssoc) {
id old = result;