From bf0cc0e2b35179bad589e134461761f30fc68340 Mon Sep 17 00:00:00 2001 From: helge Date: Mon, 11 Apr 2005 18:29:53 +0000 Subject: [PATCH] renamed classes git-svn-id: http://svn.opengroupware.org/SOPE/trunk@719 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-gdl1/MySQL4/EOAttribute+SQLite.h | 16 ++-- sope-gdl1/MySQL4/EOAttribute+SQLite.m | 22 ++--- sope-gdl1/MySQL4/MySQL4Adaptor.h | 18 ++-- sope-gdl1/MySQL4/MySQL4Adaptor.m | 56 ++++++------- sope-gdl1/MySQL4/MySQL4Channel+Model.h | 12 +-- sope-gdl1/MySQL4/MySQL4Channel+Model.m | 28 +++---- sope-gdl1/MySQL4/MySQL4Channel.h | 16 ++-- sope-gdl1/MySQL4/MySQL4Channel.m | 92 ++++++++++----------- sope-gdl1/MySQL4/MySQL4Context.h | 10 +-- sope-gdl1/MySQL4/MySQL4Context.m | 18 ++-- sope-gdl1/MySQL4/MySQL4Exception.h | 18 ++-- sope-gdl1/MySQL4/MySQL4Exception.m | 18 ++-- sope-gdl1/MySQL4/MySQL4Expression.h | 14 ++-- sope-gdl1/MySQL4/MySQL4Expression.m | 20 ++--- sope-gdl1/MySQL4/MySQL4Values.h | 46 +++++------ sope-gdl1/MySQL4/MySQL4Values.m | 38 ++++----- sope-gdl1/MySQL4/NSCalendarDate+SQLiteVal.m | 26 +++--- sope-gdl1/MySQL4/NSData+SQLiteVal.m | 26 +++--- sope-gdl1/MySQL4/NSNumber+SQLiteVal.m | 20 ++--- sope-gdl1/MySQL4/NSString+SQLite.h | 12 +-- sope-gdl1/MySQL4/NSString+SQLite.m | 14 ++-- sope-gdl1/MySQL4/NSString+SQLiteVal.m | 20 ++--- sope-gdl1/MySQL4/common.h | 8 +- sope-gdl1/MySQL4/gdltest.m | 6 +- 24 files changed, 287 insertions(+), 287 deletions(-) diff --git a/sope-gdl1/MySQL4/EOAttribute+SQLite.h b/sope-gdl1/MySQL4/EOAttribute+SQLite.h index fb3f45ea..ea08505d 100644 --- a/sope-gdl1/MySQL4/EOAttribute+SQLite.h +++ b/sope-gdl1/MySQL4/EOAttribute+SQLite.h @@ -1,11 +1,11 @@ /* - EOAttribute+SQLite.h + EOAttribute+MySQL4.h Copyright (C) 2003-2004 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,23 +23,23 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_EOAttribute_H___ -#define ___SQLite_EOAttribute_H___ +#ifndef ___MySQL4_EOAttribute_H___ +#define ___MySQL4_EOAttribute_H___ #import #include @class NSString; -@interface EOAttribute(SQLiteAttributeAdditions) +@interface EOAttribute(MySQL4AttributeAdditions) -- (void)loadValueClassAndTypeUsingSQLiteType:(int)_type +- (void)loadValueClassAndTypeUsingMySQL4Type:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary; -- (void)loadValueClassForExternalSQLiteType:(NSString *)_type; +- (void)loadValueClassForExternalMySQL4Type:(NSString *)_type; @end -#endif /* ___SQLite_EOAttribute_H___ */ +#endif /* ___MySQL4_EOAttribute_H___ */ diff --git a/sope-gdl1/MySQL4/EOAttribute+SQLite.m b/sope-gdl1/MySQL4/EOAttribute+SQLite.m index ff328c5b..f51f940a 100644 --- a/sope-gdl1/MySQL4/EOAttribute+SQLite.m +++ b/sope-gdl1/MySQL4/EOAttribute+SQLite.m @@ -1,11 +1,11 @@ /* - EOAttribute+SQLite.m + EOAttribute+MySQL4.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,19 +24,19 @@ */ #include "common.h" -#import "EOAttribute+SQLite.h" +#import "EOAttribute+MySQL4.h" static NSString *SQLITE3_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; static NSString *SQLITE3_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; -@implementation EOAttribute(SQLiteAttributeAdditions) +@implementation EOAttribute(MySQL4AttributeAdditions) -- (void)loadValueClassAndTypeUsingSQLiteType:(int)_type +- (void)loadValueClassAndTypeUsingMySQL4Type:(int)_type size:(int)_size modification:(int)_modification binary:(BOOL)_isBinary { - /* This method makes no sense with SQLite? */ + /* This method makes no sense with MySQL4? */ if (_isBinary) [self setValueClassName:@"NSData"]; @@ -126,7 +126,7 @@ static NSString *SQLITE3_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; #endif } -- (void)loadValueClassForExternalSQLiteType:(NSString *)_type { +- (void)loadValueClassForExternalMySQL4Type:(NSString *)_type { if ([_type isEqualToString:@"bool"]) { [self setValueClassName:@"NSNumber"]; [self setValueType:@"i"]; @@ -192,14 +192,14 @@ static NSString *SQLITE3_TIMESTAMP_FORMAT = @"%Y-%m-%d %H:%M:%S%z"; NSLog(@"invalid argument %@", _type); [NSException raise:@"InvalidArgumentException" - format:@"invalid SQLite type %@ passed to %s", + format:@"invalid MySQL4 type %@ passed to %s", _type, __PRETTY_FUNCTION__]; } } -@end /* EOAttribute(SQLite) */ +@end /* EOAttribute(MySQL4) */ -void __link_EOAttributeSQLite() { +void __link_EOAttributeMySQL4() { // used to force linking of object file - __link_EOAttributeSQLite(); + __link_EOAttributeMySQL4(); } diff --git a/sope-gdl1/MySQL4/MySQL4Adaptor.h b/sope-gdl1/MySQL4/MySQL4Adaptor.h index 583466ca..764c11a0 100644 --- a/sope-gdl1/MySQL4/MySQL4Adaptor.h +++ b/sope-gdl1/MySQL4/MySQL4Adaptor.h @@ -1,11 +1,11 @@ /* - SQLiteAdaptor.h + MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,11 +23,11 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_Adaptor_H___ -#define ___SQLite_Adaptor_H___ +#ifndef ___MySQL4_Adaptor_H___ +#define ___MySQL4_Adaptor_H___ /* - The SQLite adaptor. + The MySQL4 adaptor. The connection dictionary of this adaptor understands these keys: databaseName @@ -41,7 +41,7 @@ @class NSString, NSMutableDictionary; -@interface SQLiteAdaptor : EOAdaptor +@interface MySQL4Adaptor : EOAdaptor { } @@ -66,9 +66,9 @@ // classes used -- (Class)adaptorContextClass; // SQLiteContext -- (Class)adaptorChannelClass; // SQLiteChannel -- (Class)expressionClass; // SQLiteExpression +- (Class)adaptorContextClass; // MySQL4Context +- (Class)adaptorChannelClass; // MySQL4Channel +- (Class)expressionClass; // MySQL4Expression @end diff --git a/sope-gdl1/MySQL4/MySQL4Adaptor.m b/sope-gdl1/MySQL4/MySQL4Adaptor.m index fee187dd..d444574f 100644 --- a/sope-gdl1/MySQL4/MySQL4Adaptor.m +++ b/sope-gdl1/MySQL4/MySQL4Adaptor.m @@ -1,11 +1,11 @@ /* - SQLiteAdaptor.m + MySQL4Adaptor.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,20 +24,20 @@ */ #import "common.h" -#import "SQLiteAdaptor.h" -#import "SQLiteContext.h" -#import "SQLiteChannel.h" -#import "SQLiteExpression.h" -#import "SQLiteValues.h" +#import "MySQL4Adaptor.h" +#import "MySQL4Context.h" +#import "MySQL4Channel.h" +#import "MySQL4Expression.h" +#import "MySQL4Values.h" -@implementation SQLiteAdaptor +@implementation MySQL4Adaptor - (NSDictionary *)connectionDictionaryForNSURL:(NSURL *)_url { /* "Database URLs" We use the schema: - SQLite3://localhost/dbpath/foldername + MySQL43://localhost/dbpath/foldername */ NSMutableDictionary *md; NSString *p; @@ -116,7 +116,7 @@ - (id)formatValue:(id)value forAttribute:(EOAttribute *)attribute { NSString *result; - result = [value stringValueForSQLite3Type:[attribute externalType] + result = [value stringValueForMySQL43Type:[attribute externalType] attribute:attribute]; //NSLog(@"formatting value %@ result %@", value, result); @@ -139,31 +139,31 @@ /* adaptor info */ - (Class)adaptorContextClass { - return [SQLiteContext class]; + return [MySQL4Context class]; } - (Class)adaptorChannelClass { - return [SQLiteChannel class]; + return [MySQL4Channel class]; } - (Class)expressionClass { - return [SQLiteExpression class]; + return [MySQL4Expression class]; } -@end /* SQLiteAdaptor */ +@end /* MySQL4Adaptor */ -void __linkSQLiteAdaptor(void) { - extern void __link_EOAttributeSQLite(); - extern void __link_NSStringSQLite(); - extern void __link_SQLiteChannelModel(); - extern void __link_SQLiteValues(); +void __linkMySQL4Adaptor(void) { + extern void __link_EOAttributeMySQL4(); + extern void __link_NSStringMySQL4(); + extern void __link_MySQL4ChannelModel(); + extern void __link_MySQL4Values(); ; - [SQLiteChannel class]; - [SQLiteContext class]; - [SQLiteException class]; - [SQLiteExpression class]; - __link_EOAttributeSQLite(); - __link_NSStringSQLite(); - //__link_SQLiteChannelModel(); - __link_SQLiteValues(); - __linkSQLiteAdaptor(); + [MySQL4Channel class]; + [MySQL4Context class]; + [MySQL4Exception class]; + [MySQL4Expression class]; + __link_EOAttributeMySQL4(); + __link_NSStringMySQL4(); + //__link_MySQL4ChannelModel(); + __link_MySQL4Values(); + __linkMySQL4Adaptor(); } diff --git a/sope-gdl1/MySQL4/MySQL4Channel+Model.h b/sope-gdl1/MySQL4/MySQL4Channel+Model.h index 6d4421ed..5e34164f 100644 --- a/sope-gdl1/MySQL4/MySQL4Channel+Model.h +++ b/sope-gdl1/MySQL4/MySQL4Channel+Model.h @@ -1,11 +1,11 @@ /* - SQLiteChannel+Model.h + MySQL4Channel+Model.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,15 +23,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_ModelFetching_H___ -#define ___SQLite_ModelFetching_H___ +#ifndef ___MySQL4_ModelFetching_H___ +#define ___MySQL4_ModelFetching_H___ -#import "SQLiteChannel.h" +#import "MySQL4Channel.h" @class NSArray; @class EOModel; -@interface SQLiteChannel(ModelFetching) +@interface MySQL4Channel(ModelFetching) - (EOModel *)describeModelWithTableNames:(NSArray *)_tableNames; - (NSArray *)describeTableNames; diff --git a/sope-gdl1/MySQL4/MySQL4Channel+Model.m b/sope-gdl1/MySQL4/MySQL4Channel+Model.m index 1932633b..4272cfc9 100644 --- a/sope-gdl1/MySQL4/MySQL4Channel+Model.m +++ b/sope-gdl1/MySQL4/MySQL4Channel+Model.m @@ -1,11 +1,11 @@ /* - SQLiteChannel+Model.m + MySQL4Channel+Model.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,16 +23,16 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SQLiteChannel.h" -#include "NSString+SQLite.h" -#include "EOAttribute+SQLite.h" +#include "MySQL4Channel.h" +#include "NSString+MySQL4.h" +#include "EOAttribute+MySQL4.h" #include "common.h" @interface EORelationship(FixMe) - (void)addJoin:(id)_join; @end -@implementation SQLiteChannel(ModelFetching) +@implementation MySQL4Channel(ModelFetching) - (NSArray *)_attributesForTableName:(NSString *)_tableName { NSMutableArray *attributes; @@ -47,7 +47,7 @@ if (attributes == nil) { #if 1 // TODO: we would need to parse the SQL field of 'sqlite_master'? - NSLog(@"ERROR(%s): operation not supported on SQLite!", + NSLog(@"ERROR(%s): operation not supported on MySQL4!", __PRETTY_FUNCTION__); return nil; #else @@ -78,7 +78,7 @@ [attribute setColumnName:columnName]; [attribute setName:attrName]; [attribute setExternalType:externalType]; - [attribute loadValueClassForExternalSQLiteType:externalType]; + [attribute loadValueClassForExternalMySQL4Type:externalType]; [attributes addObject:attribute]; [attribute release]; } @@ -94,7 +94,7 @@ if ([_tableName length] == 0) return nil; - NSLog(@"ERROR(%s): operation not supported on SQLite!", __PRETTY_FUNCTION__); + NSLog(@"ERROR(%s): operation not supported on MySQL4!", __PRETTY_FUNCTION__); return nil; } @@ -258,8 +258,8 @@ } } */ - [model setAdaptorName:@"SQLite"]; - [model setAdaptorClassName:@"SQLiteAdaptor"]; + [model setAdaptorName:@"MySQL4"]; + [model setAdaptorClassName:@"MySQL4Adaptor"]; [model setConnectionDictionary: [[adaptorContext adaptor] connectionDictionary]]; @@ -290,9 +290,9 @@ return tableNames; } -@end /* SQLiteChannel(ModelFetching) */ +@end /* MySQL4Channel(ModelFetching) */ -void __link_SQLiteChannelModel() { +void __link_MySQL4ChannelModel() { // used to force linking of object file - __link_SQLiteChannelModel(); + __link_MySQL4ChannelModel(); } diff --git a/sope-gdl1/MySQL4/MySQL4Channel.h b/sope-gdl1/MySQL4/MySQL4Channel.h index 030956fc..b4793e63 100644 --- a/sope-gdl1/MySQL4/MySQL4Channel.h +++ b/sope-gdl1/MySQL4/MySQL4Channel.h @@ -1,11 +1,11 @@ /* - SQLiteChannel.h + MySQL4Channel.h Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,15 +23,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_Channel_H___ -#define ___SQLite_Channel_H___ +#ifndef ___MySQL4_Channel_H___ +#define ___MySQL4_Channel_H___ #import #include @class NSArray, NSString, NSMutableDictionary; -@interface SQLiteChannel : EOAdaptorChannel +@interface MySQL4Channel : EOAdaptorChannel { // connection is valid after an openChannel call void *_connection; @@ -83,12 +83,12 @@ @interface NSObject(Sybase10ChannelDelegate) -- (NSArray*)sqlite3Channel:(SQLiteChannel *)channel +- (NSArray*)sqlite3Channel:(MySQL4Channel *)channel willFetchAttributes:(NSArray *)attributes; -- (BOOL)sqlite3Channel:(SQLiteChannel *)channel +- (BOOL)sqlite3Channel:(MySQL4Channel *)channel willReturnRow:(NSDictionary *)row; @end -#endif /* ___SQLite_Channel_H___ */ +#endif /* ___MySQL4_Channel_H___ */ diff --git a/sope-gdl1/MySQL4/MySQL4Channel.m b/sope-gdl1/MySQL4/MySQL4Channel.m index f380f172..fdb1ea13 100644 --- a/sope-gdl1/MySQL4/MySQL4Channel.m +++ b/sope-gdl1/MySQL4/MySQL4Channel.m @@ -1,11 +1,11 @@ /* - SQLiteChannel.m + MySQL4Channel.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -26,12 +26,12 @@ #include #include #include -#include "SQLiteChannel.h" -#include "SQLiteAdaptor.h" -#include "SQLiteException.h" -#include "NSString+SQLite.h" -#include "SQLiteValues.h" -#include "EOAttribute+SQLite.h" +#include "MySQL4Channel.h" +#include "MySQL4Adaptor.h" +#include "MySQL4Exception.h" +#include "NSString+MySQL4.h" +#include "MySQL4Values.h" +#include "EOAttribute+MySQL4.h" #include "common.h" #ifndef MIN @@ -40,7 +40,7 @@ #define MAX_CHAR_BUF 16384 -@implementation SQLiteChannel +@implementation MySQL4Channel static EONull *null = nil; @@ -51,7 +51,7 @@ static EONull *null = nil; - (id)initWithAdaptorContext:(EOAdaptorContext*)_adaptorContext { if ((self = [super initWithAdaptorContext:_adaptorContext])) { [self setDebugEnabled:[[NSUserDefaults standardUserDefaults] - boolForKey:@"SQLiteDebugEnabled"]]; + boolForKey:@"MySQL4DebugEnabled"]]; self->_attributesForTableName = [[NSMutableDictionary alloc] initWithCapacity:16]; @@ -107,7 +107,7 @@ static int openConnectionCount = 0; MaxOpenConnectionCount = [[NSUserDefaults standardUserDefaults] - integerForKey:@"SQLiteMaxOpenConnectionCount"]; + integerForKey:@"MySQL4MaxOpenConnectionCount"]; if (MaxOpenConnectionCount == 0) MaxOpenConnectionCount = 15; return MaxOpenConnectionCount; @@ -115,7 +115,7 @@ static int openConnectionCount = 0; - (BOOL)openChannel { const unsigned char *cDBName; - SQLiteAdaptor *adaptor; + MySQL4Adaptor *adaptor; int rc; if (self->_connection) { @@ -123,13 +123,13 @@ static int openConnectionCount = 0; return NO; } - adaptor = (SQLiteAdaptor *)[adaptorContext adaptor]; + adaptor = (MySQL4Adaptor *)[adaptorContext adaptor]; if (![super openChannel]) return NO; if (openConnectionCount > [self maxOpenConnectionCount]) { - [SQLiteCouldNotOpenChannelException + [MySQL4CouldNotOpenChannelException raise:@"NoMoreConnections" format:@"cannot open a additional connection !"]; return NO; @@ -141,14 +141,14 @@ static int openConnectionCount = 0; if (rc != SQLITE_OK) { // could not login .. // Note: connection *is* set! (might be required to deallocate) - NSLog(@"WARNING: could not open SQLite connection to database '%@': %s", + NSLog(@"WARNING: could not open MySQL4 connection to database '%@': %s", [adaptor databaseName], sqlite3_errmsg(self->_connection)); sqlite3_close(self->_connection); return NO; } if (isDebuggingEnabled) - NSLog(@"SQLite connection established 0x%08X", self->_connection); + NSLog(@"MySQL4 connection established 0x%08X", self->_connection); #if 0 NSLog(@"---------- %s: %@ opens channel count[%d]", __PRETTY_FUNCTION__, @@ -163,7 +163,7 @@ static int openConnectionCount = 0; #endif if (isDebuggingEnabled) { - NSLog(@"SQLite channel 0x%08X opened (connection=0x%08X,%s)", + NSLog(@"MySQL4 channel 0x%08X opened (connection=0x%08X,%s)", (unsigned)self, self->_connection, cDBName); } return YES; @@ -185,7 +185,7 @@ static int openConnectionCount = 0; if (isDebuggingEnabled) { fprintf(stderr, - "SQLite connection dropped 0x%08X (channel=0x%08X)\n", + "MySQL4 connection dropped 0x%08X (channel=0x%08X)\n", (unsigned)self->_connection, (unsigned)self); } self->_connection = NULL; @@ -199,7 +199,7 @@ static int openConnectionCount = 0; /* fetching rows */ -- (NSException *)_makeSQLiteStep { +- (NSException *)_makeMySQL4Step { NSString *r; const char *em; int rc; @@ -224,16 +224,16 @@ static int openConnectionCount = 0; if (rc == SQLITE_ERROR) r = [NSString stringWithUTF8String:sqlite3_errmsg(self->_connection)]; else if (rc == SQLITE_MISUSE) - r = @"The SQLite step function was called in an incorrect way"; + r = @"The MySQL4 step function was called in an incorrect way"; else if (rc == SQLITE_BUSY) - r = @"The SQLite is busy."; + r = @"The MySQL4 is busy."; else - r = [NSString stringWithFormat:@"Unexpected SQLite error: %i", rc]; + r = [NSString stringWithFormat:@"Unexpected MySQL4 error: %i", rc]; if ((em = sqlite3_errmsg(self->_connection)) != NULL) r = [r stringByAppendingFormat:@": %s", em]; - return [SQLiteException exceptionWithName:@"FetchFailed" + return [MySQL4Exception exceptionWithName:@"FetchFailed" reason:r userInfo:nil]; } @@ -257,7 +257,7 @@ static int openConnectionCount = 0; yesObj = [NSNumber numberWithBool:YES]; if (![self isFetchInProgress]) { - [SQLiteException raise:@"NoFetchInProgress" + [MySQL4Exception raise:@"NoFetchInProgress" format:@"No fetch in progress (channel=%@)", self]; } @@ -266,7 +266,7 @@ static int openConnectionCount = 0; if (!self->hasPendingRow) { NSException *error; - if ((error = [self _makeSQLiteStep]) != nil) { + if ((error = [self _makeMySQL4Step]) != nil) { [self cancelFetch]; [error raise]; // raise error, TODO: make exception-less method return nil; @@ -337,14 +337,14 @@ static int openConnectionCount = 0; [attribute setValueClassName:@"NSData"]; break; case SQLITE_NULL: - NSLog(@"WARNING(%s): got SQLite NULL type at column %i, can't derive " + NSLog(@"WARNING(%s): got MySQL4 NULL type at column %i, can't derive " @"type information.", __PRETTY_FUNCTION__, cnt); [attribute setExternalType:@"NULL"]; [attribute setValueClassName:@"NSNull"]; break; default: - NSLog(@"ERROR(%s): unexpected SQLite type at column %i", + NSLog(@"ERROR(%s): unexpected MySQL4 type at column %i", __PRETTY_FUNCTION__, cnt); break; } @@ -361,7 +361,7 @@ static int openConnectionCount = 0; - (BOOL)isColumnNullInCurrentRow:(int)_column { /* - Note: NULL is SQLite is represented as empty strings ..., don't know + Note: NULL is MySQL4 is represented as empty strings ..., don't know what to do about that? At least Sybase 10 doesn't support empty strings strings as well and converts them to a single space. So maybe it is reasonable to @@ -395,7 +395,7 @@ static int openConnectionCount = 0; } if (!self->hasPendingRow && !self->isDone) { - if ((error = [self _makeSQLiteStep]) != nil) { + if ((error = [self _makeMySQL4Step]) != nil) { [self cancelFetch]; [error raise]; // raise error, TODO: make exception-less method return nil; @@ -439,21 +439,21 @@ static int openConnectionCount = 0; switch (sqlite3_column_type(self->statement, cnt)) { case SQLITE_INTEGER: value = [[valueClass alloc] - initWithSQLiteInt:sqlite3_column_int(self->statement, cnt)]; + initWithMySQL4Int:sqlite3_column_int(self->statement, cnt)]; break; case SQLITE_FLOAT: value = [[valueClass alloc] - initWithSQLiteDouble: + initWithMySQL4Double: sqlite3_column_double(self->statement, cnt)]; break; case SQLITE_TEXT: value = [[valueClass alloc] - initWithSQLiteText: + initWithMySQL4Text: sqlite3_column_text(self->statement, cnt)]; break; case SQLITE_BLOB: value = [[valueClass alloc] - initWithSQLiteData: + initWithMySQL4Data: sqlite3_column_blob(self->statement, cnt) length:sqlite3_column_bytes(self->statement, cnt)]; break; @@ -461,7 +461,7 @@ static int openConnectionCount = 0; value = [null retain]; break; default: - NSLog(@"ERROR(%s): unexpected SQLite type at column %i", + NSLog(@"ERROR(%s): unexpected MySQL4 type at column %i", __PRETTY_FUNCTION__, cnt); continue; } @@ -525,12 +525,12 @@ static int openConnectionCount = 0; /* check some preconditions */ if (![self isOpen]) { - return [SQLiteException exceptionWithName:@"ChannelNotOpenException" - reason:@"SQLite connection is not open" + return [MySQL4Exception exceptionWithName:@"ChannelNotOpenException" + reason:@"MySQL4 connection is not open" userInfo:nil]; } if (self->statement != NULL) { - return [SQLiteException exceptionWithName:@"CommandInProgressException" + return [MySQL4Exception exceptionWithName:@"CommandInProgressException" reason:@"an evaluation is in progress" userInfo:nil]; return NO; @@ -562,7 +562,7 @@ static int openConnectionCount = 0; r = [NSString stringWithFormat:@"could not parse SQL statement: %s", sqlite3_errmsg(self->_connection)]; - return [SQLiteException exceptionWithName:@"ExecutionFailed" + return [MySQL4Exception exceptionWithName:@"ExecutionFailed" reason:r userInfo:nil]; } @@ -573,7 +573,7 @@ static int openConnectionCount = 0; NSAssert(self->statement, @"missing statement"); } else { - if ((error = [self _makeSQLiteStep]) != nil) { + if ((error = [self _makeMySQL4Step]) != nil) { [self cancelFetch]; return error; } @@ -623,13 +623,13 @@ static int openConnectionCount = 0; return ms; } -@end /* SQLiteChannel */ +@end /* MySQL4Channel */ -@implementation SQLiteChannel(PrimaryKeyGeneration) +@implementation MySQL4Channel(PrimaryKeyGeneration) - (NSDictionary *)primaryKeyForNewRowWithEntity:(EOEntity *)_entity { NSArray *pkeys; - SQLiteAdaptor *adaptor; + MySQL4Adaptor *adaptor; NSString *seqName, *seq; NSDictionary *pkey; @@ -647,7 +647,7 @@ static int openConnectionCount = 0; if ([self evaluateExpression:seq]) { id key = nil; - NSLog(@"ERROR: new key creation is not implemented in SQLite yet!"); + NSLog(@"ERROR: new key creation is not implemented in MySQL4 yet!"); if ([self isFetchInProgress]) { NSLog(@"Primary key eval returned results .."); } @@ -669,9 +669,9 @@ static int openConnectionCount = 0; return pkey; } -@end /* SQLiteChannel(PrimaryKeyGeneration) */ +@end /* MySQL4Channel(PrimaryKeyGeneration) */ -void __link_SQLiteChannel() { +void __link_MySQL4Channel() { // used to force linking of object file - __link_SQLiteChannel(); + __link_MySQL4Channel(); } diff --git a/sope-gdl1/MySQL4/MySQL4Context.h b/sope-gdl1/MySQL4/MySQL4Context.h index 31ec3a01..bc03c32b 100644 --- a/sope-gdl1/MySQL4/MySQL4Context.h +++ b/sope-gdl1/MySQL4/MySQL4Context.h @@ -1,11 +1,11 @@ /* - SQLiteContext.h + MySQL4Context.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,12 +23,12 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_Context_H___ -#define ___SQLite_Context_H___ +#ifndef ___MySQL4_Context_H___ +#define ___MySQL4_Context_H___ #import -@interface SQLiteContext : EOAdaptorContext +@interface MySQL4Context : EOAdaptorContext - (BOOL)primaryBeginTransaction; - (BOOL)primaryCommitTransaction; diff --git a/sope-gdl1/MySQL4/MySQL4Context.m b/sope-gdl1/MySQL4/MySQL4Context.m index 31604f3d..da3404b8 100644 --- a/sope-gdl1/MySQL4/MySQL4Context.m +++ b/sope-gdl1/MySQL4/MySQL4Context.m @@ -1,11 +1,11 @@ /* - SQLiteContext.m + MySQL4Context.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,16 +23,16 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SQLiteContext.h" -#include "SQLiteChannel.h" +#include "MySQL4Context.h" +#include "MySQL4Channel.h" #include "common.h" -@implementation SQLiteContext +@implementation MySQL4Context - (void)channelDidInit:_channel { if ([channels count] > 0) { [NSException raise:@"TooManyOpenChannelsException" - format:@"SQLite3 only supports one channel per context"]; + format:@"MySQL43 only supports one channel per context"]; } [super channelDidInit:_channel]; } @@ -76,9 +76,9 @@ return [self retain]; } -@end /* SQLiteContext */ +@end /* MySQL4Context */ -void __link_SQLiteContext() { +void __link_MySQL4Context() { // used to force linking of object file - __link_SQLiteContext(); + __link_MySQL4Context(); } diff --git a/sope-gdl1/MySQL4/MySQL4Exception.h b/sope-gdl1/MySQL4/MySQL4Exception.h index 17fbe915..b8e241de 100644 --- a/sope-gdl1/MySQL4/MySQL4Exception.h +++ b/sope-gdl1/MySQL4/MySQL4Exception.h @@ -1,11 +1,11 @@ /* - SQLiteException.h + MySQL4Exception.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,12 +23,12 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_Exception_H___ -#define ___SQLite_Exception_H___ +#ifndef ___MySQL4_Exception_H___ +#define ___MySQL4_Exception_H___ #import -@interface SQLiteException : NSException +@interface MySQL4Exception : NSException { } @@ -36,19 +36,19 @@ @end -@interface SQLiteCouldNotOpenChannelException : SQLiteException +@interface MySQL4CouldNotOpenChannelException : MySQL4Exception { } @end -@interface SQLiteCouldNotConnectException : SQLiteCouldNotOpenChannelException +@interface MySQL4CouldNotConnectException : MySQL4CouldNotOpenChannelException { } @end -@interface SQLiteCouldNotBindException : SQLiteException +@interface MySQL4CouldNotBindException : MySQL4Exception { } @end -#endif /* ___SQLite_Exception_H___ */ +#endif /* ___MySQL4_Exception_H___ */ diff --git a/sope-gdl1/MySQL4/MySQL4Exception.m b/sope-gdl1/MySQL4/MySQL4Exception.m index 14ad7368..5c910707 100644 --- a/sope-gdl1/MySQL4/MySQL4Exception.m +++ b/sope-gdl1/MySQL4/MySQL4Exception.m @@ -1,11 +1,11 @@ /* - SQLiteException.m + MySQL4Exception.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,10 +24,10 @@ */ #import -#import "SQLiteException.h" +#import "MySQL4Exception.h" #include "common.h" -@implementation SQLiteException +@implementation MySQL4Exception + (void)raiseWithFormat:(NSString *)_format, ... { NSString *tmp = nil; @@ -47,16 +47,16 @@ @end -@implementation SQLiteCouldNotOpenChannelException +@implementation MySQL4CouldNotOpenChannelException @end -@implementation SQLiteCouldNotConnectException +@implementation MySQL4CouldNotConnectException @end -@implementation SQLiteCouldNotBindException +@implementation MySQL4CouldNotBindException @end -void __link_SQLiteException() { +void __link_MySQL4Exception() { // used to force linking of object file - __link_SQLiteException(); + __link_MySQL4Exception(); } diff --git a/sope-gdl1/MySQL4/MySQL4Expression.h b/sope-gdl1/MySQL4/MySQL4Expression.h index cd00af8b..9c987c5f 100644 --- a/sope-gdl1/MySQL4/MySQL4Expression.h +++ b/sope-gdl1/MySQL4/MySQL4Expression.h @@ -1,11 +1,11 @@ /* - SQLiteExpression.h + MySQL4Expression.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,21 +23,21 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite3_SQLExpression_H___ -#define ___SQLite3_SQLExpression_H___ +#ifndef ___MySQL43_SQLExpression_H___ +#define ___MySQL43_SQLExpression_H___ #include @class NSString, NSArray; @class EOSQLQualifier, EOAdaptorChannel; -@interface SQLiteExpression : EOSQLExpression +@interface MySQL4Expression : EOSQLExpression + (Class)selectExpressionClass; @end -@interface SQLiteSelectSQLExpression : EOSelectSQLExpression +@interface MySQL4SelectSQLExpression : EOSelectSQLExpression { BOOL lock; } @@ -52,4 +52,4 @@ @end -#endif /* ___SQLite3_SQLExpression_H___ */ +#endif /* ___MySQL43_SQLExpression_H___ */ diff --git a/sope-gdl1/MySQL4/MySQL4Expression.m b/sope-gdl1/MySQL4/MySQL4Expression.m index caacb7ac..c3b3dbdd 100644 --- a/sope-gdl1/MySQL4/MySQL4Expression.m +++ b/sope-gdl1/MySQL4/MySQL4Expression.m @@ -1,11 +1,11 @@ /* - SQLiteExpression.m + MySQL4Expression.m Copyright (C) 2003-2005 Helge Hess Author: Helge Hess (helge.hess@opengroupware.org) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -25,17 +25,17 @@ #include #include -#include "SQLiteExpression.h" +#include "MySQL4Expression.h" -@implementation SQLiteExpression +@implementation MySQL4Expression + (Class)selectExpressionClass { - return [SQLiteSelectSQLExpression class]; + return [MySQL4SelectSQLExpression class]; } -@end /* SQLiteExpression */ +@end /* MySQL4Expression */ -@implementation SQLiteSelectSQLExpression +@implementation MySQL4SelectSQLExpression - (id)selectExpressionForAttributes:(NSArray *)attributes lock:(BOOL)flag @@ -84,9 +84,9 @@ return fromClause; } -@end /* SQLiteSelectSQLExpression */ +@end /* MySQL4SelectSQLExpression */ -void __link_SQLiteExpression() { +void __link_MySQL4Expression() { // used to force linking of object file - __link_SQLiteExpression(); + __link_MySQL4Expression(); } diff --git a/sope-gdl1/MySQL4/MySQL4Values.h b/sope-gdl1/MySQL4/MySQL4Values.h index 1372816b..e6d82667 100644 --- a/sope-gdl1/MySQL4/MySQL4Values.h +++ b/sope-gdl1/MySQL4/MySQL4Values.h @@ -1,11 +1,11 @@ /* - SQLiteValues.h + MySQL4Values.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,61 +23,61 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_Values_H___ -#define ___SQLite_Values_H___ +#ifndef ___MySQL4_Values_H___ +#define ___MySQL4_Values_H___ #import #import #import #import #import -#import "SQLiteException.h" +#import "MySQL4Exception.h" @class EOAttribute; -@class SQLiteChannel; +@class MySQL4Channel; -@interface SQLiteDataTypeMappingException : SQLiteException +@interface MySQL4DataTypeMappingException : MySQL4Exception - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr - andSQLite3Type:(NSString *)_dt - inChannel:(SQLiteChannel *)_channel; + andMySQL43Type:(NSString *)_dt + inChannel:(MySQL4Channel *)_channel; @end -@protocol SQLiteValues +@protocol MySQL4Values -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end -@interface NSObject(SQLiteValues) +@interface NSObject(MySQL4Values) -- (id)initWithSQLiteInt:(int)_value; -- (id)initWithSQLiteText:(const unsigned char *)_value; -- (id)initWithSQLiteDouble:(double)_value; -- (id)initWithSQLiteData:(const void *)_data length:(int)_length; +- (id)initWithMySQL4Int:(int)_value; +- (id)initWithMySQL4Text:(const unsigned char *)_value; +- (id)initWithMySQL4Double:(double)_value; +- (id)initWithMySQL4Data:(const void *)_data length:(int)_length; @end -@interface NSString(SQLiteValues) < SQLiteValues > +@interface NSString(MySQL4Values) < MySQL4Values > @end -@interface NSNumber(SQLiteValues) < SQLiteValues > +@interface NSNumber(MySQL4Values) < MySQL4Values > @end -@interface NSData(SQLiteValues) < SQLiteValues > +@interface NSData(MySQL4Values) < MySQL4Values > @end -@interface NSCalendarDate(SQLiteValues) < SQLiteValues > +@interface NSCalendarDate(MySQL4Values) < MySQL4Values > @end -@interface EONull(SQLiteValues) +@interface EONull(MySQL4Values) -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute; @end -#endif /* ___SQLite_Values_H___ */ +#endif /* ___MySQL4_Values_H___ */ diff --git a/sope-gdl1/MySQL4/MySQL4Values.m b/sope-gdl1/MySQL4/MySQL4Values.m index e02bf04c..b988d581 100644 --- a/sope-gdl1/MySQL4/MySQL4Values.m +++ b/sope-gdl1/MySQL4/MySQL4Values.m @@ -1,11 +1,11 @@ /* - SQLiteValues.m + MySQL4Values.m Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,15 +23,15 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#import "SQLiteValues.h" +#import "MySQL4Values.h" #import "common.h" -@implementation SQLiteDataTypeMappingException +@implementation MySQL4DataTypeMappingException - (id)initWithObject:(id)_obj forAttribute:(EOAttribute *)_attr - andSQLite3Type:(NSString *)_dt - inChannel:(SQLiteChannel *)_channel; + andMySQL43Type:(NSString *)_dt + inChannel:(MySQL4Channel *)_channel; { NSDictionary *ui; NSString *typeName = nil; @@ -44,7 +44,7 @@ r = [NSString stringWithFormat: @"mapping between %@ and " - @"SQLite type %@ is not supported", + @"MySQL4 type %@ is not supported", [_obj description], NSStringFromClass([_obj class]), typeName]; @@ -58,21 +58,21 @@ userInfo:ui]; } -@end /* SQLiteDataTypeMappingException */ +@end /* MySQL4DataTypeMappingException */ -@implementation NSNull(SQLiteValues) +@implementation NSNull(MySQL4Values) -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute { return @"null"; } -@end /* NSNull(SQLiteValues) */ +@end /* NSNull(MySQL4Values) */ -@implementation NSObject(SQLiteValues) +@implementation NSObject(MySQL4Values) -- (id)initWithSQLiteInt:(int)_value { +- (id)initWithMySQL4Int:(int)_value { if ([self respondsToSelector:@selector(initWithInt:)]) return [(NSNumber *)self initWithInt:_value]; @@ -94,7 +94,7 @@ return nil; } -- (id)initWithSQLiteDouble:(double)_value { +- (id)initWithMySQL4Double:(double)_value { if ([self respondsToSelector:@selector(initWithDouble:)]) return [(NSNumber *)self initWithDouble:_value]; @@ -102,7 +102,7 @@ return nil; } -- (id)initWithSQLiteText:(const unsigned char *)_value { +- (id)initWithMySQL4Text:(const unsigned char *)_value { if ([self respondsToSelector:@selector(initWithString:)]) { NSString *s; @@ -116,7 +116,7 @@ return nil; } -- (id)initWithSQLiteData:(const void *)_data length:(int)_length { +- (id)initWithMySQL4Data:(const void *)_data length:(int)_length { if ([self respondsToSelector:@selector(initWithBytes:length:)]) return [(NSData *)self initWithBytes:_data length:_length]; @@ -133,9 +133,9 @@ return nil; } -@end /* NSObject(SQLiteValues) */ +@end /* NSObject(MySQL4Values) */ -void __link_SQLiteValues() { +void __link_MySQL4Values() { // used to force linking of object file - __link_SQLiteValues(); + __link_MySQL4Values(); } diff --git a/sope-gdl1/MySQL4/NSCalendarDate+SQLiteVal.m b/sope-gdl1/MySQL4/NSCalendarDate+SQLiteVal.m index b1b8c1a0..f488ec8d 100644 --- a/sope-gdl1/MySQL4/NSCalendarDate+SQLiteVal.m +++ b/sope-gdl1/MySQL4/NSCalendarDate+SQLiteVal.m @@ -1,11 +1,11 @@ /* - NSCalendarDate+SQLiteVal.m + NSCalendarDate+MySQL4Val.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -25,7 +25,7 @@ #import -#include "SQLiteChannel.h" +#include "MySQL4Channel.h" #include "common.h" #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY @@ -36,7 +36,7 @@ static NSString *SQLITE3_DATETIME_FORMAT = @"%b %d %Y %I:%M:%S:000%p"; -@implementation NSCalendarDate(SQLiteValues) +@implementation NSCalendarDate(MySQL4Values) /* Format: '2001-07-26 14:00:00+02' @@ -52,7 +52,7 @@ static NSTimeZone *gmt = nil; static NSTimeZone *gmt01 = nil; static NSTimeZone *gmt02 = nil; -- (id)initWithSQLiteData:(const void *)_value length:(int)_length { +- (id)initWithMySQL4Data:(const void *)_value length:(int)_length { static unsigned char buf[28]; // reused buffer, THREAD const char *_cstr = _value; unsigned char *p; @@ -148,20 +148,20 @@ static NSTimeZone *gmt02 = nil; return date; } -- (id)initWithSQLiteDouble:(double)_value { +- (id)initWithMySQL4Double:(double)_value { return [self initWithTimeIntervalSince1970:_value]; } -- (id)initWithSQLiteInt:(int)_value { - return [self initWithSQLiteDouble:_value]; +- (id)initWithMySQL4Int:(int)_value { + return [self initWithMySQL4Double:_value]; } -- (id)initWithSQLiteText:(const unsigned char *)_value { - return [self initWithSQLiteData:_value length:strlen(_value)]; +- (id)initWithMySQL4Text:(const unsigned char *)_value { + return [self initWithMySQL4Data:_value length:strlen(_value)]; } /* generating value */ -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute { #if 0 @@ -193,7 +193,7 @@ static NSTimeZone *gmt02 = nil; if ((serverTimeZone = [_attribute serverTimeZone]) == nil ) { if (DefServerTimezone == nil) { DefServerTimezone = [[NSTimeZone localTimeZone] retain]; - NSLog(@"Note: SQLite adaptor using timezone '%@' as default", + NSLog(@"Note: MySQL4 adaptor using timezone '%@' as default", DefServerTimezone); } serverTimeZone = DefServerTimezone; @@ -218,4 +218,4 @@ static NSTimeZone *gmt02 = nil; return [val autorelease]; } -@end /* NSCalendarDate(SQLiteValues) */ +@end /* NSCalendarDate(MySQL4Values) */ diff --git a/sope-gdl1/MySQL4/NSData+SQLiteVal.m b/sope-gdl1/MySQL4/NSData+SQLiteVal.m index c1f871c7..ab944efc 100644 --- a/sope-gdl1/MySQL4/NSData+SQLiteVal.m +++ b/sope-gdl1/MySQL4/NSData+SQLiteVal.m @@ -1,11 +1,11 @@ /* - NSData+SQLiteVal.m + NSData+MySQL4Val.m Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,27 +23,27 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SQLiteValues.h" -#include "SQLiteChannel.h" +#include "MySQL4Values.h" +#include "MySQL4Channel.h" #import #include "common.h" -@implementation NSData(SQLiteValues) +@implementation NSData(MySQL4Values) -- (id)initWithSQLiteInt:(int)_value { +- (id)initWithMySQL4Int:(int)_value { return [self initWithBytes:&_value length:sizeof(int)]; } -- (id)initWithSQLiteDouble:(double)_value { +- (id)initWithMySQL4Double:(double)_value { return [self initWithBytes:&_value length:sizeof(double)]; } -- (id)initWithSQLiteText:(const unsigned char *)_value { +- (id)initWithMySQL4Text:(const unsigned char *)_value { return [self initWithBytes:_value length:strlen(_value)]; } -- (id)initWithSQLiteData:(const void *)_value length:(int)_length { +- (id)initWithMySQL4Data:(const void *)_value length:(int)_length { return [self initWithBytes:_value length:_length]; } -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: UNICODE @@ -58,7 +58,7 @@ if (enc == 0) { enc = [NSString defaultCStringEncoding]; - NSLog(@"Note: SQLite adaptor using '%@' encoding for data=>string " + NSLog(@"Note: MySQL4 adaptor using '%@' encoding for data=>string " @"conversion.", [NSString localizedNameOfStringEncoding:enc]); } @@ -79,7 +79,7 @@ [t hasPrefix:@"varchar"] || [t hasPrefix:@"money"] || [t hasPrefix:@"text"]) { - t = [[str stringValueForSQLite3Type:_type + t = [[str stringValueForMySQL43Type:_type attribute:_attribute] retain]; [str release]; return [t autorelease]; @@ -89,4 +89,4 @@ return [str autorelease];; } -@end /* NSData(SQLiteValues) */ +@end /* NSData(MySQL4Values) */ diff --git a/sope-gdl1/MySQL4/NSNumber+SQLiteVal.m b/sope-gdl1/MySQL4/NSNumber+SQLiteVal.m index 92118b23..44178592 100644 --- a/sope-gdl1/MySQL4/NSNumber+SQLiteVal.m +++ b/sope-gdl1/MySQL4/NSNumber+SQLiteVal.m @@ -1,11 +1,11 @@ /* - SQLiteAdaptor.h + MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -24,24 +24,24 @@ */ #import -#include "SQLiteChannel.h" +#include "MySQL4Channel.h" #include "common.h" -@implementation NSNumber(SQLiteValues) +@implementation NSNumber(MySQL4Values) -- (id)initWithSQLiteInt:(int)_value { +- (id)initWithMySQL4Int:(int)_value { return [self initWithInt:_value]; } -- (id)initWithSQLiteDouble:(double)_value { +- (id)initWithMySQL4Double:(double)_value { return [self initWithDouble:_value]; } -- (id)initWithSQLiteText:(const unsigned char *)_value { +- (id)initWithMySQL4Text:(const unsigned char *)_value { return index(_value, '.') != NULL ? [self initWithDouble:atof(_value)] : [self initWithInt:atoi(_value)]; } -- (id)initWithSQLiteData:(const void *)_value length:(int)_length { +- (id)initWithMySQL4Data:(const void *)_value length:(int)_length { switch (_length) { case 1: return [self initWithUnsignedChar:*(char *)_value]; case 2: return [self initWithShort:*(short *)_value]; @@ -53,7 +53,7 @@ return nil; } -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: can we avoid the lowercaseString? @@ -100,4 +100,4 @@ return [self stringValue]; } -@end /* NSNumber(SQLiteValues) */ +@end /* NSNumber(MySQL4Values) */ diff --git a/sope-gdl1/MySQL4/NSString+SQLite.h b/sope-gdl1/MySQL4/NSString+SQLite.h index 4de73577..10d6e49e 100644 --- a/sope-gdl1/MySQL4/NSString+SQLite.h +++ b/sope-gdl1/MySQL4/NSString+SQLite.h @@ -1,11 +1,11 @@ /* - NSString+SQLite.h + NSString+MySQL4.h Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,12 +23,12 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite_NSString_H___ -#define ___SQLite_NSString_H___ +#ifndef ___MySQL4_NSString_H___ +#define ___MySQL4_NSString_H___ #import -@interface NSString(SQLiteMiscStrings) +@interface NSString(MySQL4MiscStrings) - (NSString *)_sqlite3ModelMakeInstanceVarName; - (NSString *)_sqlite3ModelMakeClassName; @@ -37,4 +37,4 @@ @end -#endif /* ___SQLite_NSString_H___ */ +#endif /* ___MySQL4_NSString_H___ */ diff --git a/sope-gdl1/MySQL4/NSString+SQLite.m b/sope-gdl1/MySQL4/NSString+SQLite.m index 3d729b38..584d9a38 100644 --- a/sope-gdl1/MySQL4/NSString+SQLite.m +++ b/sope-gdl1/MySQL4/NSString+SQLite.m @@ -1,11 +1,11 @@ /* - NSString+SQLite.m + NSString+MySQL4.m Copyright (C) 1999 MDlink online service center GmbH and Helge Hess Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -22,7 +22,7 @@ If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: NSString+SQLite.m,v 1.1 2004/06/14 14:27:44 helge Exp $ +// $Id: NSString+MySQL4.m,v 1.1 2004/06/14 14:27:44 helge Exp $ #if LIB_FOUNDATION_BOEHM_GC # include @@ -30,9 +30,9 @@ #import #include "common.h" -#import "NSString+SQLite.h" +#import "NSString+MySQL4.h" -@implementation NSString(SQLiteMiscStrings) +@implementation NSString(MySQL4MiscStrings) - (NSString *)_sqlite3ModelMakeInstanceVarName { if ([self length] == 0) @@ -156,7 +156,7 @@ @end -void __link_NSStringSQLite() { +void __link_NSStringMySQL4() { // used to force linking of object file - __link_NSStringSQLite(); + __link_NSStringMySQL4(); } diff --git a/sope-gdl1/MySQL4/NSString+SQLiteVal.m b/sope-gdl1/MySQL4/NSString+SQLiteVal.m index 8a407f06..5ee6b089 100644 --- a/sope-gdl1/MySQL4/NSString+SQLiteVal.m +++ b/sope-gdl1/MySQL4/NSString+SQLiteVal.m @@ -1,11 +1,11 @@ /* - SQLiteAdaptor.h + MySQL4Adaptor.h Copyright (C) 2003-2005 SKYRIX Software AG Author: Helge Hess (helge.hess@skyrix.com) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,31 +23,31 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "SQLiteChannel.h" +#include "MySQL4Channel.h" #include #import #include "common.h" -@implementation NSString(SQLiteValues) +@implementation NSString(MySQL4Values) static Class EOExprClass = Nil; -- (id)initWithSQLiteInt:(int)_value { +- (id)initWithMySQL4Int:(int)_value { char buf[256]; sprintf(buf, "%i", _value); return [self initWithCString:buf]; } -- (id)initWithSQLiteDouble:(double)_value { +- (id)initWithMySQL4Double:(double)_value { char buf[256]; sprintf(buf, "%g", _value); return [self initWithCString:buf]; } -- (id)initWithSQLiteText:(const unsigned char *)_value { +- (id)initWithMySQL4Text:(const unsigned char *)_value { return [self initWithUTF8String:_value]; } -- (id)initWithSQLiteData:(const void *)_value length:(int)_length { +- (id)initWithMySQL4Data:(const void *)_value length:(int)_length { NSData *d; d = [[NSData alloc] initWithBytes:_value length:_length]; @@ -58,7 +58,7 @@ static Class EOExprClass = Nil; /* generate SQL value */ -- (NSString *)stringValueForSQLite3Type:(NSString *)_type +- (NSString *)stringValueForMySQL43Type:(NSString *)_type attribute:(EOAttribute *)_attribute { // TODO: all this looks slow ... @@ -110,4 +110,4 @@ static Class EOExprClass = Nil; return self; } -@end /* NSString(SQLiteValues) */ +@end /* NSString(MySQL4Values) */ diff --git a/sope-gdl1/MySQL4/common.h b/sope-gdl1/MySQL4/common.h index 7a99e005..93c6a5cd 100644 --- a/sope-gdl1/MySQL4/common.h +++ b/sope-gdl1/MySQL4/common.h @@ -5,7 +5,7 @@ Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite3 Adaptor Library + This file is part of the MySQL43 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -23,8 +23,8 @@ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef ___SQLite3_common_H___ -#define ___SQLite3_common_H___ +#ifndef ___MySQL43_common_H___ +#define ___MySQL43_common_H___ #import @@ -37,4 +37,4 @@ #include #include -#endif /* ___SQLite3_common_H___ */ +#endif /* ___MySQL43_common_H___ */ diff --git a/sope-gdl1/MySQL4/gdltest.m b/sope-gdl1/MySQL4/gdltest.m index 35534e1f..d38ef33e 100644 --- a/sope-gdl1/MySQL4/gdltest.m +++ b/sope-gdl1/MySQL4/gdltest.m @@ -5,7 +5,7 @@ Author: Helge Hess (helge@mdlink.de) - This file is part of the SQLite Adaptor Library + This file is part of the MySQL4 Adaptor Library This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -170,8 +170,8 @@ static void runtest(void) { conDict = [NSDictionary dictionaryWithContentsOfFile:@"condict.plist"]; NSLog(@"condict is %@", conDict); - if ((a = [EOAdaptor adaptorWithName:@"SQLite3"]) == nil) { - NSLog(@"found no SQLite3 adaptor .."); + if ((a = [EOAdaptor adaptorWithName:@"MySQL43"]) == nil) { + NSLog(@"found no MySQL43 adaptor .."); exit(1); } -- 2.39.5