comparison dmdscript_tango/dglobal.d @ 5:4adfb4e05382 default tip

(no commit message)
author saaadel
date Wed, 17 Mar 2010 01:01:05 +0200
parents 8363a4bf6a8f
children
comparison
equal deleted inserted replaced
4:6d905019f7bf 5:4adfb4e05382
19 */ 19 */
20 20
21 21
22 module dmdscript_tango.dglobal; 22 module dmdscript_tango.dglobal;
23 23
24 import std.uri; 24 //import std.uri;
25 import std.c.stdlib; 25 //import std.c.stdlib;
26 import std.c.string; 26 //import std.c.string;
27 import std.stdio; 27 //import std.stdio;
28 import std.math; 28 //import std.math;
29 import tango.stdc.stdlib;
30 import tango.stdc.stdio;
31 import tango.stdc.stringz;
32 import tango.stdc.math;
33 import tango.text.convert.Utf;
34
29 35
30 import dmdscript_tango.script; 36 import dmdscript_tango.script;
31 import dmdscript_tango.protoerror; 37 import dmdscript_tango.protoerror;
32 import dmdscript_tango.parse; 38 import dmdscript_tango.parse;
33 import dmdscript_tango.text; 39 import dmdscript_tango.text;
190 196
191 //writefln("Dglobal_parseInt('%s')", string); 197 //writefln("Dglobal_parseInt('%s')", string);
192 198
193 while (i < string.length) 199 while (i < string.length)
194 { uint idx = i; 200 { uint idx = i;
195 dchar c = std.utf.decode(string, idx); 201 //dchar c = std.utf.decode(string, idx);
202 dchar c = tango.text.convert.Utf.decode(string, idx);
196 if (!isStrWhiteSpaceChar(c)) 203 if (!isStrWhiteSpaceChar(c))
197 break; 204 break;
198 i = idx; 205 i = idx;
199 } 206 }
200 s = string.ptr + i; 207 s = string.ptr + i;
665 { 672 {
666 // Our own extension 673 // Our own extension
667 ret.putVundefined(); 674 ret.putVundefined();
668 if (arglist.length) 675 if (arglist.length)
669 { 676 {
670 d_string s = arglist[0].toString(); 677 d_string s = arglist[0].toString();
671 tchar* p = getenv(std.string.toStringz(s)); 678 tchar* p = getenv(std.string.toStringz(s));
672 if (p) 679 if (p)
673 ret.putVstring(p[0 .. strlen(p)].dup); 680 ret.putVstring(p[0 .. strlen(p)].dup);
674 else 681 else
675 ret.putVnull(); 682 ret.putVnull();