 |
Changeset 3726
- Timestamp:
- 07/08/08 13:41:39
(5 months ago)
- Author:
- keinfarbton
- Message:
fix compile errors
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3724 |
r3726 |
|
| 740 | 740 | return ret; |
|---|
| 741 | 741 | } |
|---|
| 742 | | |
|---|
| | 742 | |
|---|
| 743 | 743 | /*********************************************************************** |
|---|
| 744 | 744 | |
|---|
| … | … | |
| 1256 | 1256 | Returns an array representing the content, and throws |
|---|
| 1257 | 1257 | IOException on error |
|---|
| 1258 | | |
|---|
| | 1258 | |
|---|
| 1259 | 1259 | ***********************************************************************/ |
|---|
| 1260 | 1260 | |
|---|
| … | … | |
| 1263 | 1263 | return slice(); |
|---|
| 1264 | 1264 | } |
|---|
| 1265 | | |
|---|
| | 1265 | |
|---|
| 1266 | 1266 | /*********************************************************************** |
|---|
| 1267 | 1267 | |
|---|
| … | … | |
| 1470 | 1470 | |
|---|
| 1471 | 1471 | alias Buffer.slice slice; |
|---|
| 1472 | | alias Buffer.append append; |
|---|
| 1473 | | |
|---|
| 1474 | | /*********************************************************************** |
|---|
| 1475 | | |
|---|
| | 1472 | alias Buffer.append append; |
|---|
| | 1473 | |
|---|
| | 1474 | /*********************************************************************** |
|---|
| | 1475 | |
|---|
| 1476 | 1476 | Create a GrowBuffer with the specified initial size. |
|---|
| 1477 | 1477 | |
|---|
| … | … | |
| 1487 | 1487 | |
|---|
| 1488 | 1488 | /*********************************************************************** |
|---|
| 1489 | | |
|---|
| | 1489 | |
|---|
| 1490 | 1490 | Create a GrowBuffer with the specified initial size. |
|---|
| 1491 | 1491 | |
|---|
| … | … | |
| 1499 | 1499 | |
|---|
| 1500 | 1500 | /*********************************************************************** |
|---|
| 1501 | | |
|---|
| | 1501 | |
|---|
| 1502 | 1502 | Read a chunk of data from the buffer, loading from the |
|---|
| 1503 | 1503 | conduit as necessary. The specified number of bytes is |
|---|
| 1504 | | loaded into the buffer, and marked as having been read |
|---|
| | 1504 | loaded into the buffer, and marked as having been read |
|---|
| 1505 | 1505 | when the 'eat' parameter is set true. When 'eat' is set |
|---|
| 1506 | 1506 | false, the read position is not adjusted. |
|---|
| … | … | |
| 1511 | 1511 | |
|---|
| 1512 | 1512 | override void[] slice (uint size, bool eat = true) |
|---|
| 1513 | | { |
|---|
| | 1513 | { |
|---|
| 1514 | 1514 | if (size > readable) |
|---|
| 1515 | 1515 | { |
|---|
| … | … | |
| 1530 | 1530 | if (eat) |
|---|
| 1531 | 1531 | index += size; |
|---|
| 1532 | | return data [i .. i + size]; |
|---|
| 1533 | | } |
|---|
| 1534 | | |
|---|
| 1535 | | /*********************************************************************** |
|---|
| 1536 | | |
|---|
| 1537 | | Append an array of data to this buffer. This is often used |
|---|
| | 1532 | return data [i .. i + size]; |
|---|
| | 1533 | } |
|---|
| | 1534 | |
|---|
| | 1535 | /*********************************************************************** |
|---|
| | 1536 | |
|---|
| | 1537 | Append an array of data to this buffer. This is often used |
|---|
| 1538 | 1538 | in lieu of a Writer. |
|---|
| 1539 | 1539 | |
|---|
| 1540 | 1540 | ***********************************************************************/ |
|---|
| 1541 | 1541 | |
|---|
| 1542 | | override IBuffer append (void *src, uint length) |
|---|
| 1543 | | { |
|---|
| | 1542 | override IBuffer append (const(void) *src, uint length) |
|---|
| | 1543 | { |
|---|
| 1544 | 1544 | if (length > writable) |
|---|
| 1545 | 1545 | makeRoom (length); |
|---|
| … | … | |
| 1551 | 1551 | /*********************************************************************** |
|---|
| 1552 | 1552 | |
|---|
| 1553 | | Try to fill the available buffer with content from the |
|---|
| 1554 | | specified conduit. |
|---|
| | 1553 | Try to fill the available buffer with content from the |
|---|
| | 1554 | specified conduit. |
|---|
| 1555 | 1555 | |
|---|
| 1556 | 1556 | Returns the number of bytes read, or IConduit.Eof |
|---|
| 1557 | | |
|---|
| | 1557 | |
|---|
| 1558 | 1558 | ***********************************************************************/ |
|---|
| 1559 | 1559 | |
|---|
| … | … | |
| 1564 | 1564 | |
|---|
| 1565 | 1565 | return write (&src.read); |
|---|
| 1566 | | } |
|---|
| 1567 | | |
|---|
| 1568 | | /*********************************************************************** |
|---|
| 1569 | | |
|---|
| 1570 | | Expand and consume the conduit content, up to the maximum |
|---|
| | 1566 | } |
|---|
| | 1567 | |
|---|
| | 1568 | /*********************************************************************** |
|---|
| | 1569 | |
|---|
| | 1570 | Expand and consume the conduit content, up to the maximum |
|---|
| 1571 | 1571 | size indicated by the argument or until conduit.Eof |
|---|
| 1572 | 1572 | |
|---|
| … | … | |
| 1576 | 1576 | |
|---|
| 1577 | 1577 | uint fill (uint size = uint.max) |
|---|
| 1578 | | { |
|---|
| | 1578 | { |
|---|
| 1579 | 1579 | while (readable < size) |
|---|
| 1580 | 1580 | if (fill(source) is IConduit.Eof) |
|---|
| … | … | |
| 1586 | 1586 | |
|---|
| 1587 | 1587 | make some room in the buffer |
|---|
| 1588 | | |
|---|
| | 1588 | |
|---|
| 1589 | 1589 | ***********************************************************************/ |
|---|
| 1590 | 1590 | |
|---|
| … | … | |
| 1595 | 1595 | |
|---|
| 1596 | 1596 | dimension += size; |
|---|
| 1597 | | data.length = dimension; |
|---|
| | 1597 | data.length = dimension; |
|---|
| 1598 | 1598 | return writable(); |
|---|
| 1599 | 1599 | } |
|---|
| r3724 |
r3726 |
|
| 47 | 47 | ***********************************************************************/ |
|---|
| 48 | 48 | |
|---|
| 49 | | abstract Cutf8 toUtf8 (); |
|---|
| | 49 | abstract Cutf8 toString (); |
|---|
| 50 | 50 | |
|---|
| 51 | 51 | /*********************************************************************** |
|---|
| … | … | |
| 74 | 74 | |
|---|
| 75 | 75 | Returns the number of bytes read, which may be less than |
|---|
| 76 | | requested in dst. Eof is returned whenever an end-of-flow |
|---|
| | 76 | requested in dst. Eof is returned whenever an end-of-flow |
|---|
| 77 | 77 | condition arises. |
|---|
| 78 | 78 | |
|---|
| … | … | |
| 87 | 87 | |
|---|
| 88 | 88 | Returns the number of bytes written from src, which may |
|---|
| 89 | | be less than the quantity provided. Eof is returned when |
|---|
| | 89 | be less than the quantity provided. Eof is returned when |
|---|
| 90 | 90 | an end-of-flow condition arises. |
|---|
| 91 | 91 | |
|---|
| … | … | |
| 209 | 209 | Returns an array representing the content, and throws |
|---|
| 210 | 210 | IOException on error |
|---|
| 211 | | |
|---|
| | 211 | |
|---|
| 212 | 212 | ***********************************************************************/ |
|---|
| 213 | 213 | |
|---|
| … | … | |
| 226 | 226 | Returns an array representing the content, and throws |
|---|
| 227 | 227 | IOException on error |
|---|
| 228 | | |
|---|
| | 228 | |
|---|
| 229 | 229 | ***********************************************************************/ |
|---|
| 230 | 230 | |
|---|
| … | … | |
| 233 | 233 | auto index = 0; |
|---|
| 234 | 234 | auto chunk = 256; |
|---|
| 235 | | |
|---|
| | 235 | |
|---|
| 236 | 236 | do { |
|---|
| 237 | 237 | if (dst.length - index < chunk) |
|---|
| … | … | |
| 246 | 246 | |
|---|
| 247 | 247 | /*********************************************************************** |
|---|
| 248 | | |
|---|
| | 248 | |
|---|
| 249 | 249 | Low-level data transfer, where max represents the maximum |
|---|
| 250 | 250 | number of bytes to transfer, and tmp represents space for |
|---|
| … | … | |
| 321 | 321 | |
|---|
| 322 | 322 | Returns the number of bytes read, which may be less than |
|---|
| 323 | | requested in dst. Eof is returned whenever an end-of-flow |
|---|
| | 323 | requested in dst. Eof is returned whenever an end-of-flow |
|---|
| 324 | 324 | condition arises. |
|---|
| 325 | 325 | |
|---|
| … | … | |
| 351 | 351 | Returns an array representing the content, and throws |
|---|
| 352 | 352 | IOException on error |
|---|
| 353 | | |
|---|
| | 353 | |
|---|
| 354 | 354 | ***********************************************************************/ |
|---|
| 355 | 355 | |
|---|
| … | … | |
| 411 | 411 | |
|---|
| 412 | 412 | Returns the number of bytes written from src, which may |
|---|
| 413 | | be less than the quantity provided. Eof is returned when |
|---|
| | 413 | be less than the quantity provided. Eof is returned when |
|---|
| 414 | 414 | an end-of-flow condition arises. |
|---|
| 415 | 415 | |
|---|
| r3724 |
r3726 |
|
| 21 | 21 | const(char)* toStringz (Cutf8 s, char[] tmp=null) |
|---|
| 22 | 22 | { |
|---|
| 23 | | static char[] empty = "\0"; |
|---|
| | 23 | static auto empty = "\0"; |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | auto len = s.length; |
|---|
| … | … | |
| 40 | 40 | |
|---|
| 41 | 41 | /********************************* |
|---|
| 42 | | * Convert a series of char[] to C-style 0 terminated strings, using |
|---|
| | 42 | * Convert a series of char[] to C-style 0 terminated strings, using |
|---|
| 43 | 43 | * tmp as a workspace and dst as a place to put the resulting char*'s. |
|---|
| 44 | 44 | * This is handy for efficiently converting multiple strings at once. |
|---|
| … | … | |
| 49 | 49 | */ |
|---|
| 50 | 50 | |
|---|
| 51 | | char*[] toStringz (char[] tmp, char*[] dst, char[][] strings...) |
|---|
| | 51 | const(char)*[] toStringz (char[] tmp, const(char)*[] dst, char[][] strings...) |
|---|
| 52 | 52 | { |
|---|
| 53 | 53 | assert (dst.length >= strings.length); |
|---|
| r3724 |
r3726 |
|
| 387 | 387 | { |
|---|
| 388 | 388 | command ~= '"'; |
|---|
| 389 | | command ~= _args[i].substitute("\\", "\\\\").substitute(`"`, `\"`); |
|---|
| | 389 | command ~= _args[i].substitute(cast(Cutf8)"\\", cast(Cutf8)"\\\\").substitute(cast(Cutf8)`"`, cast(Cutf8)`\"`); |
|---|
| 390 | 390 | command ~= '"'; |
|---|
| 391 | 391 | } |
|---|
| … | … | |
| 658 | 658 | memset(_info, '\0', PROCESS_INFORMATION.sizeof); |
|---|
| 659 | 659 | |
|---|
| 660 | | /* |
|---|
| | 660 | /* |
|---|
| 661 | 661 | * quotes and backslashes in the command line are handled very |
|---|
| 662 | 662 | * strangely by Windows. Through trial and error, I believe that |
|---|
| … | … | |
| 727 | 727 | // rule 1 and be halved. |
|---|
| 728 | 728 | // |
|---|
| 729 | | |
|---|
| | 729 | |
|---|
| 730 | 730 | if(nextarg[$-1] == '\\') |
|---|
| 731 | 731 | { |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic