+2007-02-08 Wolfgang Sourdeau <WSourdeau@Inverse.CA>
+
+ * GCSFolder.m: added a gnustep-base hack to properly format bool
+ numbers for SQL. Base returns YES or NO in -stringValue while
+ libFoundation/NGExt returns 0 or 1 (v4.5.39)
+
2007-01-15 Wolfgang Sourdeau <WSourdeau@Inverse.CA>
* GCSFolder.[hm], GCSFolderManager.m: added support for content table
if ([_value isKindOfClass:NSStringClass])
return [stringFormatter stringByFormattingString:_value];
- if ([_value isKindOfClass:NSNumberClass])
+ if ([_value isKindOfClass:NSNumberClass]) {
+#if GNUSTEP_BASE_LIBRARY
+ _value = [_value stringValue];
+ return ([_value hasPrefix:@"Y"] || [_value hasPrefix:@"N"])
+ ? ([_value boolValue] ? @"1" : @"0")
+ : _value;
+#endif
return [_value stringValue];
-
+ }
+
if ([_value isKindOfClass:NSCalendarDateClass]) {
- /* be smart ... convert to timestamp */
- return [NSString stringWithFormat:@"%i", [_value timeIntervalSince1970]];
+ /* be smart ... convert to timestamp. Note: we loose precision. */
+ char buf[256];
+ snprintf(buf, sizeof(buf), "%i", (int)[_value timeIntervalSince1970]);
+ return [NSString stringWithCString:buf];
}
- [self logWithFormat:@"cannot handle value class: %@", [_value class]];
+ [self errorWithFormat:@"cannot handle value class: %@", [_value class]];
return nil;
}