Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 2913

Show
Ignore:
Timestamp:
11/23/07 15:39:03 (1 year ago)
Author:
kris
Message:

the big toString change

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/example/concurrency/fiber_test.d

    r2465 r2913  
    247247    { 
    248248        t0++; 
    249         printf("%.*s\n", ex.toUtf8); 
     249        printf("%.*s\n", ex.toString); 
    250250    } 
    251251 
     
    307307    catch(Exception e) 
    308308    { 
    309         printf("%.*s\n", e.toUtf8); 
     309        printf("%.*s\n", e.toString); 
    310310    } 
    311311     
     
    325325    catch(Exception e) 
    326326    { 
    327         printf("%.*s\n", e.toUtf8); 
     327        printf("%.*s\n", e.toString); 
    328328    } 
    329329     
     
    361361            q1++; 
    362362            printf("!!!!!!!!GOT EXCEPTION!!!!!!!!\n"); 
    363             printf("%.*s\n", ex.toUtf8); 
     363            printf("%.*s\n", ex.toString); 
    364364        } 
    365365    }); 
     
    395395        catch(Exception ex) 
    396396        { 
    397             printf("%.*s\n", ex.toUtf8); 
     397            printf("%.*s\n", ex.toString); 
    398398        } 
    399399    }); 
     
    457457    catch(Exception e) 
    458458    { 
    459         printf("%.*s\n", e.toUtf8); 
     459        printf("%.*s\n", e.toString); 
    460460    } 
    461461     
     
    740740    catch(Exception e) 
    741741    { 
    742         printf("%.*s\n", e.toUtf8); 
     742        printf("%.*s\n", e.toString); 
    743743    } 
    744744     
  • trunk/example/conduits/FileBucket.d

    r2525 r2913  
    250250                private static void eof (FileBucket bucket) 
    251251                { 
    252                         throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path.toUtf8()~"'"); 
     252                        throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path.toString()~"'"); 
    253253                } 
    254254 
  • trunk/example/conduits/filebubbler.d

    r2465 r2913  
    2222            foreach (proxy; (new FileScan).sweep(args[1], ".html").files) 
    2323                    { 
    24                     auto other = new FilePath (proxy.toUtf8); 
     24                    auto other = new FilePath (proxy.toString); 
    2525                    proxy.rename (other.replace (FileConst.PathSeparatorChar, '.')); 
    2626                    } 
  • trunk/example/conduits/filescanregex.d

    r2523 r2913  
    2525    scan(args[1], delegate bool (FilePath fp, bool isDir) { 
    2626         ++total; 
    27          return isDir || regex.test(fp.toUtf8); 
     27         return isDir || regex.test(fp.toString); 
    2828    }); 
    2929 
  • trunk/example/logging/logging.d

    r2596 r2913  
    9898                    { 
    9999                    // log the exception as an error 
    100                     log.error ("Exception: " ~ x.toUtf8); 
     100                    log.error ("Exception: " ~ x.toString); 
    101101                    } 
    102102} 
  • trunk/example/networking/selector.d

    r2900 r2913  
    282282    catch (SelectorException e) 
    283283    { 
    284         log.error(sprint("Selector exception caught:\n{0}", e.toUtf8())); 
     284        log.error(sprint("Selector exception caught:\n{0}", e.toString())); 
    285285    } 
    286286    catch (Exception e) 
    287287    { 
    288         log.error(sprint("Exception caught:\n{0}", e.toUtf8())); 
     288        log.error(sprint("Exception caught:\n{0}", e.toString())); 
    289289    } 
    290290 
     
    391391    catch (Exception e) 
    392392    { 
    393         log.error(sprint("Exception caught:\n{0}", e.toUtf8())); 
     393        log.error(sprint("Exception caught:\n{0}", e.toString())); 
    394394    } 
    395395    debug (selector) 
  • trunk/example/synchronization/barrier.d

    r2465 r2913  
    9191        { 
    9292            Stderr.formatln("Sync exception caught in Barrier test thread {0}:\n{1}\n", 
    93                             Thread.getThis().name, e.toUtf8()); 
     93                            Thread.getThis().name, e.toString()); 
    9494        } 
    9595        catch (Exception e) 
    9696        { 
    9797            Stderr.formatln("Unexpected exception caught in Barrier test thread {0}:\n{1}\n", 
    98                             Thread.getThis().name, e.toUtf8()); 
     98                            Thread.getThis().name, e.toString()); 
    9999        } 
    100100    } 
  • trunk/example/synchronization/condition.d

    r2465 r2913  
    8888        { 
    8989            Stderr.formatln("Sync exception caught in Condition test thread {0}:\n{1}", 
    90                             Thread.getThis().name(), e.toUtf8()); 
     90                            Thread.getThis().name(), e.toString()); 
    9191        } 
    9292        catch (Exception e) 
    9393        { 
    9494            Stderr.formatln("Unexpected exception caught in Condition test thread {0}:\n{1}", 
    95                             Thread.getThis().name(), e.toUtf8()); 
     95                            Thread.getThis().name(), e.toString()); 
    9696        } 
    9797        debug (condition) 
     
    161161    catch (SyncException e) 
    162162    { 
    163         Stderr.formatln("Sync exception caught in main thread:\n{0}", e.toUtf8()); 
     163        Stderr.formatln("Sync exception caught in main thread:\n{0}", e.toString()); 
    164164    } 
    165165} 
     
    220220        { 
    221221            Stderr.formatln("Sync exception caught in Condition test thread {0}:\n{1}", 
    222                             Thread.getThis().name(), e.toUtf8()); 
     222                            Thread.getThis().name(), e.toString()); 
    223223        } 
    224224        catch (Exception e) 
    225225        { 
    226226            Stderr.formatln("Unexpected exception caught in Condition test thread {0}:\n{1}", 
    227                             Thread.getThis().name(), e.toUtf8()); 
     227                            Thread.getThis().name(), e.toString()); 
    228228        } 
    229229        debug (condition) 
     
    303303    catch (SyncException e) 
    304304    { 
    305         Stderr.formatln("Sync exception caught in main thread:\n{0}", e.toUtf8()); 
     305        Stderr.formatln("Sync exception caught in main thread:\n{0}", e.toString()); 
    306306    } 
    307307} 
  • trunk/example/synchronization/mutex.d

    r2465 r2913  
    8282        catch (SyncException e) 
    8383        { 
    84             Stderr.formatln("Sync exception caught when testing non-recursive mutexes:\n{0}\n", e.toUtf8()); 
     84            Stderr.formatln("Sync exception caught when testing non-recursive mutexes:\n{0}\n", e.toString()); 
    8585        } 
    8686        catch (Exception e) 
    8787        { 
    88             Stderr.formatln("Unexpected exception caught when testing non-recursive mutexes:\n{0}\n", e.toUtf8()); 
     88            Stderr.formatln("Unexpected exception caught when testing non-recursive mutexes:\n{0}\n", e.toString()); 
    8989        } 
    9090 
     
    141141        catch (SyncException e) 
    142142        { 
    143             Stderr.formatln("Sync exception caught inside mutex testing thread:\n{0}\n", e.toUtf8()); 
     143            Stderr.formatln("Sync exception caught inside mutex testing thread:\n{0}\n", e.toString()); 
    144144        } 
    145145        catch (Exception e) 
    146146        { 
    147             Stderr.formatln("Unexpected exception caught inside mutex testing thread:\n{0}\n", e.toUtf8()); 
     147            Stderr.formatln("Unexpected exception caught inside mutex testing thread:\n{0}\n", e.toString()); 
    148148        } 
    149149    } 
     
    215215    catch (SyncException e) 
    216216    { 
    217         Stderr.formatln("Sync exception caught in recursive mutex test:\n{0}\n", e.toUtf8()); 
     217        Stderr.formatln("Sync exception caught in recursive mutex test:\n{0}\n", e.toString()); 
    218218    } 
    219219    catch (Exception e) 
    220220    { 
    221         Stderr.formatln("Unexpected exception caught in recursive mutex test:\n{0}\n", e.toUtf8()); 
     221        Stderr.formatln("Unexpected exception caught in recursive mutex test:\n{0}\n", e.toString()); 
    222222    } 
    223223 
  • trunk/example/synchronization/semaphore.d

    r2465 r2913  
    140140        { 
    141141            Cerr("Sync exception caught in Semaphore test thread " ~ Thread.getThis().name ~ 
    142                  ":\n" ~ e.toUtf8()).newline; 
     142                 ":\n" ~ e.toString()).newline; 
    143143        } 
    144144        catch (Exception e) 
    145145        { 
    146146            Cerr("Unexpected exception caught in Semaphore test thread " ~ Thread.getThis().name ~ 
    147                  ":\n" ~ e.toUtf8()).newline; 
     147                 ":\n" ~ e.toString()).newline; 
    148148        } 
    149149    } 
     
    226226 
    227227        debug (semaphore) 
    228             log.trace("Executing child test process: " ~ proc.toUtf8()); 
     228            log.trace("Executing child test process: " ~ proc.toString()); 
    229229        proc.execute(); 
    230230 
     
    253253    catch (SyncException e) 
    254254    { 
    255         Cerr("Sync exception caught in ProcessSemaphore main test process:\n" ~ e.toUtf8()).newline; 
     255        Cerr("Sync exception caught in ProcessSemaphore main test process:\n" ~ e.toString()).newline; 
    256256    } 
    257257    catch (ProcessException e) 
    258258    { 
    259         Cerr("Process exception caught in ProcessSemaphore main test process:\n" ~ e.toUtf8()).newline; 
     259        Cerr("Process exception caught in ProcessSemaphore main test process:\n" ~ e.toString()).newline; 
    260260    } 
    261261    catch (Exception e) 
    262262    { 
    263         Cerr("Unexpected exception caught in ProcessSemaphore main test process:\n" ~ e.toUtf8()).newline; 
     263        Cerr("Unexpected exception caught in ProcessSemaphore main test process:\n" ~ e.toString()).newline; 
    264264    } 
    265265 
     
    322322    catch (SyncException e) 
    323323    { 
    324         Cerr("Sync exception caught in ProcessSemaphore child test process:\n" ~ e.toUtf8()).newline; 
     324        Cerr("Sync exception caught in ProcessSemaphore child test process:\n" ~ e.toString()).newline; 
    325325    } 
    326326    catch (ProcessException e) 
    327327    { 
    328         Cerr("Process exception caught in ProcessSemaphore child test process:\n" ~ e.toUtf8()).newline; 
     328        Cerr("Process exception caught in ProcessSemaphore child test process:\n" ~ e.toString()).newline; 
    329329    } 
    330330    catch (Exception e) 
    331331    { 
    332         Cerr("Unexpected exception caught in ProcessSemaphore child test process:\n" ~ e.toUtf8()).newline; 
     332        Cerr("Unexpected exception caught in ProcessSemaphore child test process:\n" ~ e.toString()).newline; 
    333333    } 
    334334 
  • trunk/example/system/process.d

    r2465 r2913  
    2828        auto p = new Process(command, null); 
    2929 
    30         Stdout.formatln("Executing {0}", p.toUtf8()); 
     30        Stdout.formatln("Executing {0}", p.toString()); 
    3131        p.execute(); 
    3232 
     
    4444 
    4545        Stdout.formatln("Process '{0}' ({1}) finished: {2}", 
    46                         p.programName, p.pid, result.toUtf8()); 
     46                        p.programName, p.pid, result.toString()); 
    4747    } 
    4848    catch (ProcessException e) 
    4949    { 
    50         Stdout.formatln("Process execution failed: {0}", e.toUtf8()); 
     50        Stdout.formatln("Process execution failed: {0}", e.toString()); 
    5151    } 
    5252    catch (IOException e) 
    5353    { 
    54         Stdout.formatln("Input/output exception caught: {0}", e.toUtf8()); 
     54        Stdout.formatln("Input/output exception caught: {0}", e.toString()); 
    5555    } 
    5656    catch (Exception e) 
    5757    { 
    58         Stdout.formatln("Unexpected exception caught: {0}", e.toUtf8()); 
     58        Stdout.formatln("Unexpected exception caught: {0}", e.toString()); 
    5959    } 
    6060} 
  • trunk/install/snapshot/srcsnapshot.d

    r2605 r2913  
    190190 
    191191    auto datetgz = new FilePath(packdirdate ~ ".tar.gz"); 
    192     auto dltgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datetgz.toUtf8); 
     192    auto dltgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datetgz.toString); 
    193193    datetgz.rename(dltgz); 
    194194     
    195195    auto datezip = new FilePath(packdirdate ~ ".zip"); 
    196     auto dlzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datezip.toUtf8); 
     196    auto dlzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ datezip.toString); 
    197197    datezip.rename(dlzip); 
    198198  
    199199    auto currenttgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".tar.gz"); 
    200     currenttgz.copy(datetgz.toUtf8); 
     200    currenttgz.copy(datetgz.toString); 
    201201  
    202202    auto currentzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".zip"); 
    203     currentzip.copy(datezip.toUtf8); 
     203    currentzip.copy(datezip.toString); 
    204204 
    205205    return 0; 
  • trunk/install/windows/build_tango.d

    r2866 r2913  
    2727        exec( "dmd -c -inline -release -O " ~ 
    2828              "-of" ~ objname( file ) ~ " " ~ 
    29               file.toUtf8 ); 
     29              file.toString ); 
    3030        outf.write(temp), outf.write("\n"); 
    3131        list ~= " " ~ temp; 
     
    9595    auto result = proc.wait(); 
    9696    if( result.reason != Process.Result.Exit ) 
    97         throw new Exception( result.toUtf8() ); 
     97        throw new Exception( result.toString() ); 
    9898} 
  • trunk/install/windows/install_dmd.d

    r2866 r2913  
    3838    usePath.set( prefix ? prefix : usePath.set( binPath.parent ).parent ); 
    3939    require( usePath.exists, "Path specified by prefix does not exist." ); 
    40     usePath.path( usePath.toUtf8 ); 
     40    usePath.path( usePath.toString ); 
    4141 
    4242    impPath.set( usePath.path ~ "import" ); 
    4343    if( !impPath.exists ) 
    4444        impPath.create(); 
    45     impPath.path = impPath.toUtf8
     45    impPath.path = impPath.toString
    4646 
    4747    libPath.set( usePath.path ~ "lib" ); 
    4848    if( !libPath.exists ) 
    4949        libPath.create(); 
    50     libPath.path = libPath.toUtf8
     50    libPath.path = libPath.toString
    5151 
    5252    if( uninst ) 
     
    129129void writeFile( FilePath fp, lazy char[] buf ) 
    130130{ 
    131     scope fc = new FileConduit( fp.toUtf8, FileConduit.WriteCreate ); 
     131    scope fc = new FileConduit( fp.toString, FileConduit.WriteCreate ); 
    132132    scope(exit) fc.close(); 
    133133    fc.output.write( buf ); 
     
    140140                                   FileConduit.ReadExisting ); 
    141141    scope(exit) srcFc.close(); 
    142     scope dstFc = new FileConduit( dstFile.toUtf8, FileConduit.WriteCreate ); 
     142    scope dstFc = new FileConduit( dstFile.toString, FileConduit.WriteCreate ); 
    143143    scope(exit) dstFc.close(); 
    144144    dstFc.copy( srcFc ); 
     
    158158    srcPath = FilePath.padded( srcPath ) ~ dstPath.file; 
    159159    scan.sweep( srcPath, &matchAll ); 
    160     dstFile.path = dstPath.toUtf8
     160    dstFile.path = dstPath.toString
    161161 
    162162    foreach( f; scan.folders ) 
    163163    { 
    164         dstFile.set( dstPath.toUtf8 ~ f.toUtf8[srcPath.length .. $] ); 
     164        dstFile.set( dstPath.toString ~ f.toString[srcPath.length .. $] ); 
    165165        if( !dstFile.exists ) 
    166166            dstFile.create(); 
     
    169169    foreach( f; scan.files ) 
    170170    { 
    171         dstFile.set( dstPath.toUtf8 ~ f.toUtf8[srcPath.length .. $] ); 
     171        dstFile.set( dstPath.toString ~ f.toString[srcPath.length .. $] ); 
    172172        copyFile( dstFile, f.path ); 
    173173    } 
     
    187187    scope scan = new FileScan; 
    188188 
    189     scan.sweep( root.toUtf8, &matchAll ); 
     189    scan.sweep( root.toString, &matchAll ); 
    190190 
    191191    foreach( f; scan.files ) 
  • trunk/install/windows/switch.d

    r2465 r2913  
    1313    if ( args.length == 1 ) 
    1414    { 
    15         printf(toUtf8z("Tango switch utility v1.1 
     15        printf(toStringz("Tango switch utility v1.1 
    1616Usage:   switch.exe 'phobos|tango' 
    1717Example: switch.exe phobos 
     
    2626    { 
    2727        if(useMessageBoxes) 
    28             MessageBoxA(null, toUtf8z(msg), "Tango Switch utility\0", 0); 
     28            MessageBoxA(null, toStringz(msg), "Tango Switch utility\0", 0); 
    2929        else 
    30             printf("%s\n", toUtf8z(msg)); 
     30            printf("%s\n", toStringz(msg)); 
    3131    } 
    3232     
     
    8484    if ( target == "phobos" ) // switch to Phobos 
    8585    { 
    86         // CyberShadow 2007.02.18: FIXME: toUtf8z is used incorrectly here.  
     86        // CyberShadow 2007.02.18: FIXME: toStringz is used incorrectly here.  
    8787        // ANSI Windows APIs take Multi-byte character strings as parameters  
    8888        // (see WideCharToMultiByte). 
     
    9494        } 
    9595         
    96         MoveFileA(toUtf8z(targetConf), toUtf8z(tangoConf));   // backup the Tango Build config 
    97         MoveFileA(toUtf8z(phobosConf), toUtf8z(targetConf));  // put Phobos's Build config in place 
     96        MoveFileA(toStringz(targetConf), toStringz(tangoConf));   // backup the Tango Build config 
     97        MoveFileA(toStringz(phobosConf), toStringz(targetConf));  // put Phobos's Build config in place 
    9898         
    99         if (!CopyFileA(toUtf8z(phobosLib), toUtf8z(targetLib), false)) 
     99        if (!CopyFileA(toStringz(phobosLib), toStringz(targetLib), false)) 
    100100            showMessage("Error: Could not find " ~ phobosLib); 
    101101        else 
     
    111111        } 
    112112         
    113         MoveFileA(toUtf8z(targetConf), toUtf8z(phobosConf));  // backup the Phobos Build config 
    114         MoveFileA(toUtf8z(tangoConf), toUtf8z(targetConf));   // put Tango's Build config in place 
     113        MoveFileA(toStringz(targetConf), toStringz(phobosConf));  // backup the Phobos Build config 
     114        MoveFileA(toStringz(tangoConf), toStringz(targetConf));   // put Tango's Build config in place 
    115115         
    116         if (!CopyFileA(toUtf8z(tangoLib), toUtf8z(targetLib), false)) 
     116        if (!CopyFileA(toStringz(tangoLib), toStringz(targetLib), false)) 
    117117            showMessage("Error: Could not find " ~ tangoLib); 
    118118        else 
  • trunk/lib/common/tango/core/Exception.d

    r2878 r2913  
    7676    } 
    7777 
    78     char[] toUtf8() 
    79     { 
    80         return msg ? super.toUtf8() : "Memory allocation failed"; 
     78    char[] toString() 
     79    { 
     80        return msg ? super.toString() : "Memory allocation failed"; 
    8181    } 
    8282} 
     
    106106    } 
    107107 
    108     char[] toUtf8() 
     108    char[] toString() 
    109109    { 
    110110        if( m_info is null ) 
    111             return super.toUtf8(); 
    112         char[] buf = super.toUtf8(); 
     111            return super.toString(); 
     112        char[] buf = super.toString(); 
    113113        buf ~= "\n----------------"; 
    114114        foreach( line; m_info ) 
     
    182182    } 
    183183 
    184     char[] toUtf8() 
     184    char[] toString() 
    185185    { 
    186186        return "An exception was thrown while finalizing an instance of class " ~ info.name; 
  • trunk/lib/compiler/dmd/dmain2.d

    r2866 r2913  
    236236                    else 
    237237                    { 
    238                        // fprintf(stderr, "%.*s\n", e.toUtf8()); 
    239                        console (e.classinfo.name)(": ")(e.toUtf8)("\n"); 
     238                       // fprintf(stderr, "%.*s\n", e.toString()); 
     239                       console (e.classinfo.name)(": ")(e.toString)("\n"); 
    240240                    } 
    241241                    e = e.next; 
     
    245245            catch (Object o) 
    246246            { 
    247                 // fprintf(stderr, "%.*s\n", o.toUtf8()); 
    248                 console (o.toUtf8)("\n"); 
     247                // fprintf(stderr, "%.*s\n", o.toString()); 
     248                console (o.toString)("\n"); 
    249249                result = EXIT_FAILURE; 
    250250            } 
  • trunk/lib/compiler/dmd/genobj.d