Mercurial > projects > dwt2
comparison base/src/java/lang/util.d @ 121:dc6fc593e8d7
Update for dmd-2.054 and small fixes in java.lang.Character
author | Denis Shelomovskij <verylonglogin.reg@gmail.com> |
---|---|
date | Tue, 12 Jul 2011 11:59:58 +0300 |
parents | 536e43f63c81 |
children |
comparison
equal
deleted
inserted
replaced
120:536e43f63c81 | 121:dc6fc593e8d7 |
---|---|
14 alias tango.stdc.stdlib.exit exit; | 14 alias tango.stdc.stdlib.exit exit; |
15 } else { // Phobos | 15 } else { // Phobos |
16 static import core.exception; | 16 static import core.exception; |
17 static import std.c.stdlib; | 17 static import std.c.stdlib; |
18 static import std.stdio; | 18 static import std.stdio; |
19 static import std.ascii; | |
19 static import std.array; | 20 static import std.array; |
20 static import std.format; | 21 static import std.format; |
21 static import std.typetuple; | 22 static import std.typetuple; |
22 static import std.traits; | 23 static import std.traits; |
23 static import std.exception; | 24 static import std.exception; |
24 alias std.c.stdlib.exit exit; | 25 alias std.c.stdlib.exit exit; |
25 } | |
26 | |
27 version(Tango){ | |
28 } else { // Phobos | |
29 } | |
30 version(Tango){ | |
31 } else { // Phobos | |
32 } | |
33 version(Tango){ | |
34 } else { // Phobos | |
35 } | 26 } |
36 | 27 |
37 interface IDwtLogger { | 28 interface IDwtLogger { |
38 void trace( String file, ulong line, String fmt, ... ); | 29 void trace( String file, ulong line, String fmt, ... ); |
39 void info( String file, ulong line, String fmt, ... ); | 30 void info( String file, ulong line, String fmt, ... ); |
166 string f = tangoFmt[i + 1 .. j]; | 157 string f = tangoFmt[i + 1 .. j]; |
167 i = j; | 158 i = j; |
168 if(f.length) { | 159 if(f.length) { |
169 string fres = "%"; | 160 string fres = "%"; |
170 try { | 161 try { |
171 if(std.ctype.isdigit(f[0])) { | 162 if(std.ascii.isDigit(f[0])) { |
172 int n = std.conv.parse!(int)(f); | 163 int n = std.conv.parse!(int)(f); |
173 fres ~= std.conv.to!(string)(n + 1) ~ '$'; | 164 fres ~= std.conv.to!(string)(n + 1) ~ '$'; |
174 } | 165 } |
175 if(f.length) { | 166 if(f.length) { |
176 std.exception.enforce(f[0] == ':' && f.length > 1); | 167 std.exception.enforce(f[0] == ':' && f.length > 1); |
574 // else | 565 // else |
575 return arr[0..n] ~ arr[n+1..$]; | 566 return arr[0..n] ~ arr[n+1..$]; |
576 } | 567 } |
577 | 568 |
578 struct ImportData{ | 569 struct ImportData{ |
579 void[] data; | 570 TryImmutable!(void)[] data; |
580 String name; | 571 String name; |
581 | 572 |
582 public static ImportData opCall( void[] data, String name ){ | 573 public static ImportData opCall( TryImmutable!(void)[] data, String name ){ |
583 ImportData res; | 574 ImportData res; |
584 res.data = data; | 575 res.data = data; |
585 res.name = name; | 576 res.name = name; |
586 return res; | 577 return res; |
587 } | 578 } |
588 } | 579 } |
589 | 580 |
590 template getImportData(String name) { | 581 template getImportData(String name) { |
591 const ImportData getImportData = ImportData( cast(void[]) import(name), name ); | 582 const ImportData getImportData = ImportData( cast(TryImmutable!(void)[]) import(name), name ); |
592 } | 583 } |