Changeset 76
- Timestamp:
- 12/27/07 18:27:07 (1 year ago)
- Files:
-
- trunk/dbi/DBIException.d (modified) (3 diffs)
- trunk/dbi/Database.d (modified) (3 diffs)
- trunk/dbi/Registry.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dbi/DBIException.d
r70 r76 1 /**1 /** 2 2 * Authors: The D DBI project 3 3 * Copyright: BSD license … … 5 5 module dbi.DBIException; 6 6 7 version (Phobos) { 8 private import std.stdarg : va_arg; 9 } else { 10 private import tango.core.Vararg : va_arg; 11 } 7 private import tango.core.Vararg : va_arg; 12 8 private import dbi.ErrorCode; 13 9 … … 59 55 dbiCode = va_arg!(ErrorCode)(_argptr); 60 56 } else { 61 version (Phobos) { 62 throw new DBIException("Invalid argument of type \"" ~ _arguments[i].toString() ~ "\" passed to the DBIException constructor."); 63 } else { 64 throw new DBIException("Invalid argument of type \"" ~ _arguments[i].toUtf8() ~ "\" passed to the DBIException constructor."); 65 } 57 throw new DBIException("Invalid argument of type \"" ~ _arguments[i].toString() ~ "\" passed to the DBIException constructor."); 66 58 } 67 59 } trunk/dbi/Database.d
r70 r76 5 5 module dbi.Database; 6 6 7 version (Phobos) { 8 private static import std.string; 9 debug (UnitTest) private static import std.stdio; 10 } else { 11 private static import tango.text.Util; 12 debug (UnitTest) private static import tango.io.Stdout; 13 } 7 private static import tango.text.Util; 8 private static import tango.io.Stdout; 14 9 private import dbi.DBIException, dbi.Result, dbi.Row, dbi.Statement; 15 10 … … 201 196 final protected char[][char[]] getKeywords (char[] string) { 202 197 char[][char[]] keywords; 203 version (Phobos) { 204 foreach (char[] group; std.string.split(string, ";")) { 205 if (group == "") { 206 continue; 207 } 208 char[][] vals = std.string.split(group, "="); 209 keywords[vals[0]] = vals[1]; 198 foreach (char[] group; tango.text.Util.delimit(string, ";")) { 199 if (group == "") { 200 continue; 210 201 } 211 } else { 212 foreach (char[] group; tango.text.Util.delimit(string, ";")) { 213 if (group == "") { 214 continue; 215 } 216 char[][] vals = tango.text.Util.delimit(group, "="); 217 keywords[vals[0]] = vals[1]; 218 } 219 202 char[][] vals = tango.text.Util.delimit(group, "="); 203 keywords[vals[0]] = vals[1]; 220 204 } 221 205 return keywords; … … 233 217 234 218 unittest { 235 version (Phobos) { 236 void s1 (char[] s) { 237 std.stdio.writefln("%s", s); 238 } 239 240 void s2 (char[] s) { 241 std.stdio.writefln(" ...%s", s); 242 } 243 } else { 244 void s1 (char[] s) { 245 tango.io.Stdout.Stdout(s).newline(); 246 } 247 248 void s2 (char[] s) { 249 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 250 } 219 void s1 (char[] s) { 220 tango.io.Stdout.Stdout(s).newline(); 221 } 222 223 void s2 (char[] s) { 224 tango.io.Stdout.Stdout(" ..." ~ s).newline(); 251 225 } 252 226 trunk/dbi/Registry.d
r70 r76 36 36 */ 37 37 public static void registerDatabase(Registerable newDB) { 38 logger.trace("registering database: " ~ newDB.getPrefix());38 //logger.trace("registering provider: " ~ newDB.getPrefix()); 39 39 dbs[newDB.getPrefix()] = newDB; 40 40 }
