Changeset 218

Show
Ignore:
Timestamp:
07/25/08 19:39:13 (6 months ago)
Author:
yidabu
Message:

addedd dwt and dwtx package

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dsss.conf

    r191 r218  
    66    exclude+=dwin\sys\win32\* 
    77} 
     8version (!DWT) { 
     9    exclude+=dwin\dwt\* 
     10} 
     11version (!DWTX) { 
     12    exclude+=dwin\dwtx\* 
     13} 
     14 
  • trunk/sys/win32/CodePage.d

    r205 r218  
    11/******************************************************************************* 
    2          
     2 
    33        copyright:      Copyright (c) 2007  (yidabu  gmail at com) All rights reserved 
    44 
     
    1212 
    1313 
    14   
     14 
    1515module dwin.sys.win32.CodePage; 
    1616 
     
    1818private import tango.stdc.stringz : toUTF16z = toString16z; 
    1919public import tango.sys.win32.CodePage; 
    20      
     20 
    2121 
    2222//////////////////////////////////////////////////////////////////////////////// 
     
    4747// 
    4848 
     49char[] toMbs(Buf) (Buf buf) 
     50{ 
     51    static if( is(Buf == char[]) || is(Buf == wchar[]) || is(Buf == dchar[]) || is(Buf == wchar*) ) 
     52        return CodePage.into( toString(buf), new char[buf.length*3] ); 
     53    else static assert( false, "Code.Page.toMbs, wrong parameter" ); 
     54} 
     55// 
     56 
    4957 
    5058 
     
    6876} 
    6977 
    70 wchar* toString16z(char[] input)  
    71 {   
     78wchar* toString16z(char[] input) 
     79{ 
    7280  return toString16z( toString16(input) ); 
    7381} 
    7482// 
    7583 
    76 wchar* toString16z(char[] input, int start, int count)  
     84wchar* toString16z(char[] input, int start, int count) 
    7785{ 
    7886  if (input is null) 
     
    8290  if (count == -1) 
    8391    count = input.length; 
    84    
     92 
    8593  return toString16z( toString16(input[start .. count]) ); 
    8694} 
     
    102110            if ( !(input.length > 1 && input[$-1] is 0 && input[$-2] is 0) ) 
    103111                   input = input ~ "\0\0"w; 
    104         return input.ptr;     
     112        return input.ptr; 
    105113} 
    106114 
     
    110118} 
    111119 
    112 wchar* toString16zz(char[] input)  
    113 {   
     120wchar* toString16zz(char[] input) 
     121{ 
    114122  return toString16zz( toString16(input) ); 
    115123} 
     
    119127/+ 
    120128//////////////////////////////////////////////////////////////////////////////// 
    121 // MBSz to UTF  
     129// MBSz to UTF 
    122130//////////////////////////////////////////////////////////////////////////////// 
    123131 
     
    158166 
    159167            if (!readLen || readLen != result.length) 
    160                 throw new IllegalArgumentException ("Stringz.toString16 :: "~SysError.lastMsg);                 
     168                throw new IllegalArgumentException ("Stringz.toString16 :: "~SysError.lastMsg); 
    161169 
    162170            return result[0 .. result.length-1]; // omit trailing null