 |
Changeset 2913
- 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
| r2465 |
r2913 |
|
| 247 | 247 | { |
|---|
| 248 | 248 | t0++; |
|---|
| 249 | | printf("%.*s\n", ex.toUtf8); |
|---|
| | 249 | printf("%.*s\n", ex.toString); |
|---|
| 250 | 250 | } |
|---|
| 251 | 251 | |
|---|
| … | … | |
| 307 | 307 | catch(Exception e) |
|---|
| 308 | 308 | { |
|---|
| 309 | | printf("%.*s\n", e.toUtf8); |
|---|
| | 309 | printf("%.*s\n", e.toString); |
|---|
| 310 | 310 | } |
|---|
| 311 | 311 | |
|---|
| … | … | |
| 325 | 325 | catch(Exception e) |
|---|
| 326 | 326 | { |
|---|
| 327 | | printf("%.*s\n", e.toUtf8); |
|---|
| | 327 | printf("%.*s\n", e.toString); |
|---|
| 328 | 328 | } |
|---|
| 329 | 329 | |
|---|
| … | … | |
| 361 | 361 | q1++; |
|---|
| 362 | 362 | printf("!!!!!!!!GOT EXCEPTION!!!!!!!!\n"); |
|---|
| 363 | | printf("%.*s\n", ex.toUtf8); |
|---|
| | 363 | printf("%.*s\n", ex.toString); |
|---|
| 364 | 364 | } |
|---|
| 365 | 365 | }); |
|---|
| … | … | |
| 395 | 395 | catch(Exception ex) |
|---|
| 396 | 396 | { |
|---|
| 397 | | printf("%.*s\n", ex.toUtf8); |
|---|
| | 397 | printf("%.*s\n", ex.toString); |
|---|
| 398 | 398 | } |
|---|
| 399 | 399 | }); |
|---|
| … | … | |
| 457 | 457 | catch(Exception e) |
|---|
| 458 | 458 | { |
|---|
| 459 | | printf("%.*s\n", e.toUtf8); |
|---|
| | 459 | printf("%.*s\n", e.toString); |
|---|
| 460 | 460 | } |
|---|
| 461 | 461 | |
|---|
| … | … | |
| 740 | 740 | catch(Exception e) |
|---|
| 741 | 741 | { |
|---|
| 742 | | printf("%.*s\n", e.toUtf8); |
|---|
| | 742 | printf("%.*s\n", e.toString); |
|---|
| 743 | 743 | } |
|---|
| 744 | 744 | |
|---|
| r2525 |
r2913 |
|
| 250 | 250 | private static void eof (FileBucket bucket) |
|---|
| 251 | 251 | { |
|---|
| 252 | | throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path.toUtf8()~"'"); |
|---|
| | 252 | throw new IOException ("Unexpected EOF in FileBucket '"~bucket.path.toString()~"'"); |
|---|
| 253 | 253 | } |
|---|
| 254 | 254 | |
|---|
| r2465 |
r2913 |
|
| 22 | 22 | foreach (proxy; (new FileScan).sweep(args[1], ".html").files) |
|---|
| 23 | 23 | { |
|---|
| 24 | | auto other = new FilePath (proxy.toUtf8); |
|---|
| | 24 | auto other = new FilePath (proxy.toString); |
|---|
| 25 | 25 | proxy.rename (other.replace (FileConst.PathSeparatorChar, '.')); |
|---|
| 26 | 26 | } |
|---|
| r2523 |
r2913 |
|
| 25 | 25 | scan(args[1], delegate bool (FilePath fp, bool isDir) { |
|---|
| 26 | 26 | ++total; |
|---|
| 27 | | return isDir || regex.test(fp.toUtf8); |
|---|
| | 27 | return isDir || regex.test(fp.toString); |
|---|
| 28 | 28 | }); |
|---|
| 29 | 29 | |
|---|
| r2596 |
r2913 |
|
| 98 | 98 | { |
|---|
| 99 | 99 | // log the exception as an error |
|---|
| 100 | | log.error ("Exception: " ~ x.toUtf8); |
|---|
| | 100 | log.error ("Exception: " ~ x.toString); |
|---|
| 101 | 101 | } |
|---|
| 102 | 102 | } |
|---|
| r2900 |
r2913 |
|
| 282 | 282 | catch (SelectorException e) |
|---|
| 283 | 283 | { |
|---|
| 284 | | log.error(sprint("Selector exception caught:\n{0}", e.toUtf8())); |
|---|
| | 284 | log.error(sprint("Selector exception caught:\n{0}", e.toString())); |
|---|
| 285 | 285 | } |
|---|
| 286 | 286 | catch (Exception e) |
|---|
| 287 | 287 | { |
|---|
| 288 | | log.error(sprint("Exception caught:\n{0}", e.toUtf8())); |
|---|
| | 288 | log.error(sprint("Exception caught:\n{0}", e.toString())); |
|---|
| 289 | 289 | } |
|---|
| 290 | 290 | |
|---|
| … | … | |
| 391 | 391 | catch (Exception e) |
|---|
| 392 | 392 | { |
|---|
| 393 | | log.error(sprint("Exception caught:\n{0}", e.toUtf8())); |
|---|
| | 393 | log.error(sprint("Exception caught:\n{0}", e.toString())); |
|---|
| 394 | 394 | } |
|---|
| 395 | 395 | debug (selector) |
|---|
| r2465 |
r2913 |
|
| 91 | 91 | { |
|---|
| 92 | 92 | 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()); |
|---|
| 94 | 94 | } |
|---|
| 95 | 95 | catch (Exception e) |
|---|
| 96 | 96 | { |
|---|
| 97 | 97 | 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()); |
|---|
| 99 | 99 | } |
|---|
| 100 | 100 | } |
|---|
| r2465 |
r2913 |
|
| 88 | 88 | { |
|---|
| 89 | 89 | Stderr.formatln("Sync exception caught in Condition test thread {0}:\n{1}", |
|---|
| 90 | | Thread.getThis().name(), e.toUtf8()); |
|---|
| | 90 | Thread.getThis().name(), e.toString()); |
|---|
| 91 | 91 | } |
|---|
| 92 | 92 | catch (Exception e) |
|---|
| 93 | 93 | { |
|---|
| 94 | 94 | Stderr.formatln("Unexpected exception caught in Condition test thread {0}:\n{1}", |
|---|
| 95 | | Thread.getThis().name(), e.toUtf8()); |
|---|
| | 95 | Thread.getThis().name(), e.toString()); |
|---|
| 96 | 96 | } |
|---|
| 97 | 97 | debug (condition) |
|---|
| … | … | |
| 161 | 161 | catch (SyncException e) |
|---|
| 162 | 162 | { |
|---|
| 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()); |
|---|
| 164 | 164 | } |
|---|
| 165 | 165 | } |
|---|
| … | … | |
| 220 | 220 | { |
|---|
| 221 | 221 | Stderr.formatln("Sync exception caught in Condition test thread {0}:\n{1}", |
|---|
| 222 | | Thread.getThis().name(), e.toUtf8()); |
|---|
| | 222 | Thread.getThis().name(), e.toString()); |
|---|
| 223 | 223 | } |
|---|
| 224 | 224 | catch (Exception e) |
|---|
| 225 | 225 | { |
|---|
| 226 | 226 | Stderr.formatln("Unexpected exception caught in Condition test thread {0}:\n{1}", |
|---|
| 227 | | Thread.getThis().name(), e.toUtf8()); |
|---|
| | 227 | Thread.getThis().name(), e.toString()); |
|---|
| 228 | 228 | } |
|---|
| 229 | 229 | debug (condition) |
|---|
| … | … | |
| 303 | 303 | catch (SyncException e) |
|---|
| 304 | 304 | { |
|---|
| 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()); |
|---|
| 306 | 306 | } |
|---|
| 307 | 307 | } |
|---|
| r2465 |
r2913 |
|
| 82 | 82 | catch (SyncException e) |
|---|
| 83 | 83 | { |
|---|
| 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()); |
|---|
| 85 | 85 | } |
|---|
| 86 | 86 | catch (Exception e) |
|---|
| 87 | 87 | { |
|---|
| 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()); |
|---|
| 89 | 89 | } |
|---|
| 90 | 90 | |
|---|
| … | … | |
| 141 | 141 | catch (SyncException e) |
|---|
| 142 | 142 | { |
|---|
| 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()); |
|---|
| 144 | 144 | } |
|---|
| 145 | 145 | catch (Exception e) |
|---|
| 146 | 146 | { |
|---|
| 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()); |
|---|
| 148 | 148 | } |
|---|
| 149 | 149 | } |
|---|
| … | … | |
| 215 | 215 | catch (SyncException e) |
|---|
| 216 | 216 | { |
|---|
| 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()); |
|---|
| 218 | 218 | } |
|---|
| 219 | 219 | catch (Exception e) |
|---|
| 220 | 220 | { |
|---|
| 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()); |
|---|
| 222 | 222 | } |
|---|
| 223 | 223 | |
|---|
| r2465 |
r2913 |
|
| 140 | 140 | { |
|---|
| 141 | 141 | Cerr("Sync exception caught in Semaphore test thread " ~ Thread.getThis().name ~ |
|---|
| 142 | | ":\n" ~ e.toUtf8()).newline; |
|---|
| | 142 | ":\n" ~ e.toString()).newline; |
|---|
| 143 | 143 | } |
|---|
| 144 | 144 | catch (Exception e) |
|---|
| 145 | 145 | { |
|---|
| 146 | 146 | Cerr("Unexpected exception caught in Semaphore test thread " ~ Thread.getThis().name ~ |
|---|
| 147 | | ":\n" ~ e.toUtf8()).newline; |
|---|
| | 147 | ":\n" ~ e.toString()).newline; |
|---|
| 148 | 148 | } |
|---|
| 149 | 149 | } |
|---|
| … | … | |
| 226 | 226 | |
|---|
| 227 | 227 | debug (semaphore) |
|---|
| 228 | | log.trace("Executing child test process: " ~ proc.toUtf8()); |
|---|
| | 228 | log.trace("Executing child test process: " ~ proc.toString()); |
|---|
| 229 | 229 | proc.execute(); |
|---|
| 230 | 230 | |
|---|
| … | … | |
| 253 | 253 | catch (SyncException e) |
|---|
| 254 | 254 | { |
|---|
| 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; |
|---|
| 256 | 256 | } |
|---|
| 257 | 257 | catch (ProcessException e) |
|---|
| 258 | 258 | { |
|---|
| 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; |
|---|
| 260 | 260 | } |
|---|
| 261 | 261 | catch (Exception e) |
|---|
| 262 | 262 | { |
|---|
| 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; |
|---|
| 264 | 264 | } |
|---|
| 265 | 265 | |
|---|
| … | … | |
| 322 | 322 | catch (SyncException e) |
|---|
| 323 | 323 | { |
|---|
| 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; |
|---|
| 325 | 325 | } |
|---|
| 326 | 326 | catch (ProcessException e) |
|---|
| 327 | 327 | { |
|---|
| 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; |
|---|
| 329 | 329 | } |
|---|
| 330 | 330 | catch (Exception e) |
|---|
| 331 | 331 | { |
|---|
| 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; |
|---|
| 333 | 333 | } |
|---|
| 334 | 334 | |
|---|
| r2465 |
r2913 |
|
| 28 | 28 | auto p = new Process(command, null); |
|---|
| 29 | 29 | |
|---|
| 30 | | Stdout.formatln("Executing {0}", p.toUtf8()); |
|---|
| | 30 | Stdout.formatln("Executing {0}", p.toString()); |
|---|
| 31 | 31 | p.execute(); |
|---|
| 32 | 32 | |
|---|
| … | … | |
| 44 | 44 | |
|---|
| 45 | 45 | Stdout.formatln("Process '{0}' ({1}) finished: {2}", |
|---|
| 46 | | p.programName, p.pid, result.toUtf8()); |
|---|
| | 46 | p.programName, p.pid, result.toString()); |
|---|
| 47 | 47 | } |
|---|
| 48 | 48 | catch (ProcessException e) |
|---|
| 49 | 49 | { |
|---|
| 50 | | Stdout.formatln("Process execution failed: {0}", e.toUtf8()); |
|---|
| | 50 | Stdout.formatln("Process execution failed: {0}", e.toString()); |
|---|
| 51 | 51 | } |
|---|
| 52 | 52 | catch (IOException e) |
|---|
| 53 | 53 | { |
|---|
| 54 | | Stdout.formatln("Input/output exception caught: {0}", e.toUtf8()); |
|---|
| | 54 | Stdout.formatln("Input/output exception caught: {0}", e.toString()); |
|---|
| 55 | 55 | } |
|---|
| 56 | 56 | catch (Exception e) |
|---|
| 57 | 57 | { |
|---|
| 58 | | Stdout.formatln("Unexpected exception caught: {0}", e.toUtf8()); |
|---|
| | 58 | Stdout.formatln("Unexpected exception caught: {0}", e.toString()); |
|---|
| 59 | 59 | } |
|---|
| 60 | 60 | } |
|---|
| r2605 |
r2913 |
|
| 190 | 190 | |
|---|
| 191 | 191 | 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); |
|---|
| 193 | 193 | datetgz.rename(dltgz); |
|---|
| 194 | 194 | |
|---|
| 195 | 195 | 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); |
|---|
| 197 | 197 | datezip.rename(dlzip); |
|---|
| 198 | 198 | |
|---|
| 199 | 199 | auto currenttgz = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".tar.gz"); |
|---|
| 200 | | currenttgz.copy(datetgz.toUtf8); |
|---|
| | 200 | currenttgz.copy(datetgz.toString); |
|---|
| 201 | 201 | |
|---|
| 202 | 202 | auto currentzip = new FilePath(dlpath ~ FileConst.PathSeparatorString ~ packdircurrent ~ ".zip"); |
|---|
| 203 | | currentzip.copy(datezip.toUtf8); |
|---|
| | 203 | currentzip.copy(datezip.toString); |
|---|
| 204 | 204 | |
|---|
| 205 | 205 | return 0; |
|---|
| r2866 |
r2913 |
|
| 27 | 27 | exec( "dmd -c -inline -release -O " ~ |
|---|
| 28 | 28 | "-of" ~ objname( file ) ~ " " ~ |
|---|
| 29 | | file.toUtf8 ); |
|---|
| | 29 | file.toString ); |
|---|
| 30 | 30 | outf.write(temp), outf.write("\n"); |
|---|
| 31 | 31 | list ~= " " ~ temp; |
|---|
| … | … | |
| 95 | 95 | auto result = proc.wait(); |
|---|
| 96 | 96 | if( result.reason != Process.Result.Exit ) |
|---|
| 97 | | throw new Exception( result.toUtf8() ); |
|---|
| | 97 | throw new Exception( result.toString() ); |
|---|
| 98 | 98 | } |
|---|
| r2866 |
r2913 |
|
| 38 | 38 | usePath.set( prefix ? prefix : usePath.set( binPath.parent ).parent ); |
|---|
| 39 | 39 | require( usePath.exists, "Path specified by prefix does not exist." ); |
|---|
| 40 | | usePath.path( usePath.toUtf8 ); |
|---|
| | 40 | usePath.path( usePath.toString ); |
|---|
| 41 | 41 | |
|---|
| 42 | 42 | impPath.set( usePath.path ~ "import" ); |
|---|
| 43 | 43 | if( !impPath.exists ) |
|---|
| 44 | 44 | impPath.create(); |
|---|
| 45 | | impPath.path = impPath.toUtf8; |
|---|
| | 45 | impPath.path = impPath.toString; |
|---|
| 46 | 46 | |
|---|
| 47 | 47 | libPath.set( usePath.path ~ "lib" ); |
|---|
| 48 | 48 | if( !libPath.exists ) |
|---|
| 49 | 49 | libPath.create(); |
|---|
| 50 | | libPath.path = libPath.toUtf8; |
|---|
| | 50 | libPath.path = libPath.toString; |
|---|
| 51 | 51 | |
|---|
| 52 | 52 | if( uninst ) |
|---|
| … | … | |
| 129 | 129 | void writeFile( FilePath fp, lazy char[] buf ) |
|---|
| 130 | 130 | { |
|---|
| 131 | | scope fc = new FileConduit( fp.toUtf8, FileConduit.WriteCreate ); |
|---|
| | 131 | scope fc = new FileConduit( fp.toString, FileConduit.WriteCreate ); |
|---|
| 132 | 132 | scope(exit) fc.close(); |
|---|
| 133 | 133 | fc.output.write( buf ); |
|---|
| … | … | |
| 140 | 140 | FileConduit.ReadExisting ); |
|---|
| 141 | 141 | scope(exit) srcFc.close(); |
|---|
| 142 | | scope dstFc = new FileConduit( dstFile.toUtf8, FileConduit.WriteCreate ); |
|---|
| | 142 | scope dstFc = new FileConduit( dstFile.toString, FileConduit.WriteCreate ); |
|---|
| 143 | 143 | scope(exit) dstFc.close(); |
|---|
| 144 | 144 | dstFc.copy( srcFc ); |
|---|
| … | … | |
| 158 | 158 | srcPath = FilePath.padded( srcPath ) ~ dstPath.file; |
|---|
| 159 | 159 | scan.sweep( srcPath, &matchAll ); |
|---|
| 160 | | dstFile.path = dstPath.toUtf8; |
|---|
| | 160 | dstFile.path = dstPath.toString; |
|---|
| 161 | 161 | |
|---|
| 162 | 162 | foreach( f; scan.folders ) |
|---|
| 163 | 163 | { |
|---|
| 164 | | dstFile.set( dstPath.toUtf8 ~ f.toUtf8[srcPath.length .. $] ); |
|---|
| | 164 | dstFile.set( dstPath.toString ~ f.toString[srcPath.length .. $] ); |
|---|
| 165 | 165 | if( !dstFile.exists ) |
|---|
| 166 | 166 | dstFile.create(); |
|---|
| … | … | |
| 169 | 169 | foreach( f; scan.files ) |
|---|
| 170 | 170 | { |
|---|
| 171 | | dstFile.set( dstPath.toUtf8 ~ f.toUtf8[srcPath.length .. $] ); |
|---|
| | 171 | dstFile.set( dstPath.toString ~ f.toString[srcPath.length .. $] ); |
|---|
| 172 | 172 | copyFile( dstFile, f.path ); |
|---|
| 173 | 173 | } |
|---|
| … | … | |
| 187 | 187 | scope scan = new FileScan; |
|---|
| 188 | 188 | |
|---|
| 189 | | scan.sweep( root.toUtf8, &matchAll ); |
|---|
| | 189 | scan.sweep( root.toString, &matchAll ); |
|---|
| 190 | 190 | |
|---|
| 191 | 191 | foreach( f; scan.files ) |
|---|
| r2465 |
r2913 |
|
| 13 | 13 | if ( args.length == 1 ) |
|---|
| 14 | 14 | { |
|---|
| 15 | | printf(toUtf8z("Tango switch utility v1.1 |
|---|
| | 15 | printf(toStringz("Tango switch utility v1.1 |
|---|
| 16 | 16 | Usage: switch.exe 'phobos|tango' |
|---|
| 17 | 17 | Example: switch.exe phobos |
|---|
| … | … | |
| 26 | 26 | { |
|---|
| 27 | 27 | if(useMessageBoxes) |
|---|
| 28 | | MessageBoxA(null, toUtf8z(msg), "Tango Switch utility\0", 0); |
|---|
| | 28 | MessageBoxA(null, toStringz(msg), "Tango Switch utility\0", 0); |
|---|
| 29 | 29 | else |
|---|
| 30 | | printf("%s\n", toUtf8z(msg)); |
|---|
| | 30 | printf("%s\n", toStringz(msg)); |
|---|
| 31 | 31 | } |
|---|
| 32 | 32 | |
|---|
| … | … | |
| 84 | 84 | if ( target == "phobos" ) // switch to Phobos |
|---|
| 85 | 85 | { |
|---|
| 86 | | // CyberShadow 2007.02.18: FIXME: toUtf8z is used incorrectly here. |
|---|
| | 86 | // CyberShadow 2007.02.18: FIXME: toStringz is used incorrectly here. |
|---|
| 87 | 87 | // ANSI Windows APIs take Multi-byte character strings as parameters |
|---|
| 88 | 88 | // (see WideCharToMultiByte). |
|---|
| … | … | |
| 94 | 94 | } |
|---|
| 95 | 95 | |
|---|
| 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 |
|---|
| 98 | 98 | |
|---|
| 99 | | if (!CopyFileA(toUtf8z(phobosLib), toUtf8z(targetLib), false)) |
|---|
| | 99 | if (!CopyFileA(toStringz(phobosLib), toStringz(targetLib), false)) |
|---|
| 100 | 100 | showMessage("Error: Could not find " ~ phobosLib); |
|---|
| 101 | 101 | else |
|---|
| … | … | |
| 111 | 111 | } |
|---|
| 112 | 112 | |
|---|
| 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 |
|---|
| 115 | 115 | |
|---|
| 116 | | if (!CopyFileA(toUtf8z(tangoLib), toUtf8z(targetLib), false)) |
|---|
| | 116 | if (!CopyFileA(toStringz(tangoLib), toStringz(targetLib), false)) |
|---|
| 117 | 117 | showMessage("Error: Could not find " ~ tangoLib); |
|---|
| 118 | 118 | else |
|---|
| r2878 |
r2913 |
|
| 76 | 76 | } |
|---|
| 77 | 77 | |
|---|
| 78 | | char[] toUtf8() |
|---|
| 79 | | { |
|---|
| 80 | | return msg ? super.toUtf8() : "Memory allocation failed"; |
|---|
| | 78 | char[] toString() |
|---|
| | 79 | { |
|---|
| | 80 | return msg ? super.toString() : "Memory allocation failed"; |
|---|
| 81 | 81 | } |
|---|
| 82 | 82 | } |
|---|
| … | … | |
| 106 | 106 | } |
|---|
| 107 | 107 | |
|---|
| 108 | | char[] toUtf8() |
|---|
| | 108 | char[] toString() |
|---|
| 109 | 109 | { |
|---|
| 110 | 110 | if( m_info is null ) |
|---|
| 111 | | return super.toUtf8(); |
|---|
| 112 | | char[] buf = super.toUtf8(); |
|---|
| | 111 | return super.toString(); |
|---|
| | 112 | char[] buf = super.toString(); |
|---|
| 113 | 113 | buf ~= "\n----------------"; |
|---|
| 114 | 114 | foreach( line; m_info ) |
|---|
| … | … | |
| 182 | 182 | } |
|---|
| 183 | 183 | |
|---|
| 184 | | char[] toUtf8() |
|---|
| | 184 | char[] toString() |
|---|
| 185 | 185 | { |
|---|
| 186 | 186 | return "An exception was thrown while finalizing an instance of class " ~ info.name; |
|---|
| r2866 |
r2913 |
|
| 236 | 236 | else |
|---|
| 237 | 237 | { |
|---|
| 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"); |
|---|
| 240 | 240 | } |
|---|
| 241 | 241 | e = e.next; |
|---|
| … | … | |
| 245 | 245 | catch (Object o) |
|---|
| 246 | 246 | { |
|---|
| 247 | | // fprintf(stderr, "%.*s\n", o.toUtf8()); |
|---|
| 248 | | console (o.toUtf8)("\n"); |
|---|
| | 247 | // fprintf(stderr, "%.*s\n", o.toString()); |
|---|
| | 248 | console (o.toString)("\n"); |
|---|
| 249 | 249 | result = EXIT_FAILURE; |
|---|
| 250 | 250 | } |
|---|
|