+2008-02-09 Helge Hess <helge.hess@opengroupware.org>
+
+ * v4.7.52
+
+ * NSString+PostgreSQL72.m: properly use -length, not -cStringLength
+
+ * PostgreSQL72Channel+Model.m, PGResultSet.m: use -UTF8String instead
+ of -cString
+
2007-09-27 Helge Hess <helge.hess@opengroupware.org>
* PostgreSQL72Context.m: changed to use -evaluateExpressionX: for
}
- (int)indexOfFieldNamed:(NSString *)_name {
+#if LIB_FOUNDATION_LIBRARY
+ // TBD: might be wrong even in this case?
return PQfnumber(self->results, [_name cString]);
+#else
+ return PQfnumber(self->results, [_name UTF8String]);
+#endif
}
- (int)fieldSizeAtIndex:(unsigned int)_idx {
PostgreSQL72Channel+Model.m
Copyright (C) 1999 MDlink online service center GmbH and Helge Hess
- Copyright (C) 2000-2004 SKYRIX Software AG and Helge Hess
+ Copyright (C) 2000-2008 SKYRIX Software AG and Helge Hess
Author: Helge Hess (helge.hess@opengroupware.org)
if (![self evaluateExpression:sqlExpr]) {
fprintf(stderr,
"Could not evaluate column-describe '%s' on table '%s'\n",
- [sqlExpr cString], [_tableName cString]);
+ [sqlExpr UTF8String], [_tableName UTF8String]);
return nil;
}
relName = [@"to" stringByAppendingString:
[[sa _pgModelMakeInstanceVarName]
_pgStringWithCapitalizedFirstChar]];
- if ([relName hasSuffix:@"Id"]) {
- int cLength = [relName cStringLength];
-
- relName = [relName substringToIndex:cLength - 2];
- }
+ if ([relName hasSuffix:@"Id"])
+ relName = [relName substringToIndex:([relName length] - 2)];
}
if ([relNamesUsed objectForKey:relName] != nil) {
int useCount = [[relNamesUsed objectForKey:relName] intValue];
[relNamesUsed setObject:[NSNumber numberWithInt:(useCount++)]
forKey:relName];
- relName = [NSString stringWithFormat:@"%s%d",
- [relName cString], useCount];
+ relName = [NSString stringWithFormat:@"%@%d", relName, useCount];
}
else
[relNamesUsed setObject:[NSNumber numberWithInt:0] forKey:relName];
NSDictionary *row;
if (![self evaluateExpression:_query]) {
- fprintf(stderr, "Could not evaluate expression: '%s'\n", [_query cString]);
+ fprintf(stderr, "Could not evaluate expression: '%s'\n",
+#if LIB_FOUNDATION_LIBRARY
+ [_query cString]
+#else
+ [_query UTF8String]
+#endif
+ );
return nil;
}