 |
Changeset 2744
- Timestamp:
- 11/03/07 00:05:41
(10 months ago)
- Author:
- kris
- Message:
fixes #679 :: Stdout cannot print large numbers of objects using varargs
(thanks to dhasenan)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r2720 |
r2744 |
|
| 80 | 80 | auto print = new Print!(char) (locale, ...); |
|---|
| 81 | 81 | --- |
|---|
| | 82 | |
|---|
| | 83 | Note that Print is *not* intended to be thread-safe. Use either |
|---|
| | 84 | tango.util.log.Trace or the standard logging facilities in order |
|---|
| | 85 | to enable atomic console I/O |
|---|
| 82 | 86 | |
|---|
| 83 | 87 | *******************************************************************************/ |
|---|
| … | … | |
| 140 | 144 | /********************************************************************** |
|---|
| 141 | 145 | |
|---|
| 142 | | Unformatted layout, with commas inserted between args |
|---|
| | 146 | Unformatted layout, with commas inserted between args. |
|---|
| | 147 | Currently supports a maximum of 24 arguments |
|---|
| 143 | 148 | |
|---|
| 144 | 149 | **********************************************************************/ |
|---|
| … | … | |
| 146 | 151 | final Print print (...) |
|---|
| 147 | 152 | { |
|---|
| 148 | | static T[][] fmt = |
|---|
| 149 | | [ |
|---|
| 150 | | "{}", |
|---|
| 151 | | "{}, {}", |
|---|
| 152 | | "{}, {}, {}", |
|---|
| 153 | | "{}, {}, {}, {}", |
|---|
| 154 | | "{}, {}, {}, {}, {}", |
|---|
| 155 | | "{}, {}, {}, {}, {}, {}", |
|---|
| 156 | | "{}, {}, {}, {}, {}, {}, {}", |
|---|
| 157 | | "{}, {}, {}, {}, {}, {}, {}, {}", |
|---|
| 158 | | "{}, {}, {}, {}, {}, {}, {}, {}, {}", |
|---|
| 159 | | "{}, {}, {}, {}, {}, {}, {}, {}, {}, {}", |
|---|
| 160 | | "{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}", |
|---|
| 161 | | "{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}", |
|---|
| 162 | | ]; |
|---|
| 163 | | |
|---|
| 164 | | assert (_arguments.length <= fmt.length); |
|---|
| | 153 | static T[] slice = "{}, {}, {}, {}, {}, {}, {}, {}, " |
|---|
| | 154 | "{}, {}, {}, {}, {}, {}, {}, {}, " |
|---|
| | 155 | "{}, {}, {}, {}, {}, {}, {}, {}, "; |
|---|
| | 156 | |
|---|
| | 157 | assert (_arguments.length <= slice.length/4, "Print :: too many arguments"); |
|---|
| 165 | 158 | |
|---|
| 166 | 159 | if (_arguments.length is 0) |
|---|
| 167 | 160 | output.flush; |
|---|
| 168 | 161 | else |
|---|
| 169 | | convert (&sink, _arguments, _argptr, fmt[_arguments.length - 1]); |
|---|
| | 162 | convert (&sink, _arguments, _argptr, slice[0 .. _arguments.length * 4 - 2]); |
|---|
| 170 | 163 | |
|---|
| 171 | 164 | return this; |
|---|
Download in other formats:
|
 |