Changeset 226

Show
Ignore:
Timestamp:
02/13/07 23:48:36 (2 years ago)
Author:
aldacron
Message:

[DerelictUtil?]
* previously committed the wrong version of wrapper.d to the trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictUtil/derelict/util/wrapper.d

    r224 r226  
    3838        import tango.stdc.string; 
    3939        import tango.text.Util; 
     40        import tango.stdc.stringz; 
    4041    } 
    4142} 
     
    5354    version(Tango)  
    5455    { 
    55         return (str ~ "\0").ptr
     56        toUtf8z(str)
    5657    } 
    5758    else 
    5859    { 
    59         return str.toStringz(); 
     60        return toStringz(str); 
    6061    }    
    6162} 
     
    6364char[] toDString(char* cstr) 
    6465{ 
    65     return (cstr is null) ? null : cstr[0 .. strlen(cstr)]; 
     66    version(Tango) 
     67    { 
     68        return fromUtf8z(cstr); 
     69    } 
     70    else 
     71    { 
     72        return toString(cstr); 
     73    } 
    6674} 
    6775 
     
    7583    else 
    7684    { 
    77         return str.find(match); 
     85        return find(str, match); 
    7886    } 
    7987} 
     
    8189char[][] splitStr(char[] str, char[] delim) 
    8290{ 
    83     return split(str, delim); 
     91    version(Tango) 
     92    { 
     93        return demarcate(str, delim); 
     94    } 
     95    else 
     96    { 
     97        return split(str, delim); 
     98    } 
    8499} 
    85100 
     
    92107    else 
    93108    { 
    94         return str.strip(); 
     109        return strip(str); 
    95110    } 
    96111}