]> err.no Git - sope/blob - sope-gdl1/SQLite3/SQLiteValues.m
fixed gdltest
[sope] / sope-gdl1 / SQLite3 / SQLiteValues.m
1 /* 
2    SQLiteValues.m
3
4    Copyright (C) 1999-2005 MDlink online service center GmbH and Helge Hess
5
6    Author: Helge Hess (helge@mdlink.de)
7
8    This file is part of the SQLite Adaptor Library
9
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Library General Public
12    License as published by the Free Software Foundation; either
13    version 2 of the License, or (at your option) any later version.
14
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Library General Public License for more details.
19
20    You should have received a copy of the GNU Library General Public
21    License along with this library; see the file COPYING.LIB.
22    If not, write to the Free Software Foundation,
23    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25
26 #import "SQLiteValues.h"
27 #import "common.h"
28
29 @implementation SQLiteDataTypeMappingException
30
31 - (id)initWithObject:(id)_obj
32   forAttribute:(EOAttribute *)_attr
33   andSQLite3Type:(NSString *)_dt
34   inChannel:(SQLiteChannel *)_channel;
35 {  
36   NSDictionary *ui;
37   NSString *typeName = nil;
38   NSString *r;
39
40   typeName = _dt;
41
42   if (typeName == nil)
43     typeName = [NSString stringWithFormat:@"Oid[%i]", _dt];
44
45   r = [NSString stringWithFormat:
46                               @"mapping between %@<Class:%@> and "
47                               @"SQLite type %@ is not supported",
48                               [_obj description],
49                               NSStringFromClass([_obj class]),
50                 typeName];
51   ui = [NSDictionary dictionaryWithObjectsAndKeys:
52                                     _attr,    @"attribute",
53                                     _channel, @"channel",
54                                     _obj,     @"object",
55                      nil];
56   
57   [self setName:@"DataTypeMappingNotSupported"];
58   [self setReason:r];
59
60   [self setUserInfo:ui];
61   return self;
62 }
63
64 @end /* SQLiteDataTypeMappingException */
65
66 @implementation NSNull(SQLiteValues)
67
68 - (NSString *)stringValueForSQLite3Type:(NSString *)_type
69   attribute:(EOAttribute *)_attribute
70 {
71   return @"null";
72 }
73
74 @end /* NSNull(SQLiteValues) */
75
76
77 void __link_SQLiteValues() {
78   // used to force linking of object file
79   __link_SQLiteValues();
80 }