Inheritance diagram for DisplayWriter:
Public Member Functions | |
this (IBuffer buffer, char[] workspace=null, Format.DblFormat df=&Double.format) | |
this (IConduit conduit) | |
IWriter | write (void *src, uint bytes, int type) |
int | print (char[] s, TypeInfo[] ti, void *args) |
DisplayWriter | print (char[] s,...) |
DisplayWriter | println (char[] s,...) |
Private Types | |
typedef put | opShl |
typedef put | opCall |
Private Member Functions | |
final int | utf8 (char[] x) |
this (IBuffer buffer) | |
void | error (char[] msg) |
IBuffer | getBuffer () |
void | setEncoder (IEncoder e) |
IWriter | flush () |
IWriter | cr () |
void | enableArrayPrefix (bool on) |
IWriter | put () |
IWriter | put (IWritable x) |
IWriter | put (bool x) |
IWriter | put (ubyte x) |
IWriter | put (byte x) |
IWriter | put (ushort x) |
IWriter | put (short x) |
IWriter | put (uint x) |
IWriter | put (int x) |
IWriter | put (ulong x) |
IWriter | put (long x) |
IWriter | put (float x) |
IWriter | put (double x) |
IWriter | put (real x) |
IWriter | put (char x) |
IWriter | put (wchar x) |
IWriter | put (dchar x) |
IWriter | put (byte[] x) |
IWriter | put (ubyte[] x) |
IWriter | put (short[] x) |
IWriter | put (ushort[] x) |
IWriter | put (int[] x) |
IWriter | put (uint[] x) |
IWriter | put (long[] x) |
IWriter | put (ulong[] x) |
IWriter | put (float[] x) |
IWriter | put (double[] x) |
IWriter | put (real[] x) |
IWriter | put (char[] x) |
IWriter | putw (wchar[] x) |
IWriter | putd (dchar[] x) |
Private Attributes | |
Format Style | style |
char[80] | workspace |
IBuffer | buffer |
Encoder | encode |
DisplayWriter supports the usual printf() format specifiers & flags, and extends the notion to operate with one dimensional arrays. For instance, this code
static int x = [1, 2, 3, 4, 5, 6, 7, 8]; Stdout.print ("%@04b, ", x);
results in the following output:
0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000,
Note that DisplayWriter itself is a wrapper around the mango.format package, which can be used directly as desired (Int, Long, Double, DGDouble, etc). The latter classes are home to a set of static formatting-methods, making them convenient for ad-hoc application.
Note also that Mango provides both a printf() and writef() wrapper for compatability purposes ~ see module TextFormat.
Definition at line 80 of file DisplayWriter.d.
|
Reimplemented from IWriter. |
|
Reimplemented from IWriter. |
|
Construct a DisplayWriter upon the specified IBuffer. One can override the default floating-point formatting by providing an appropriate handler to this constructor. For example, one might configure the DGDouble.format() function instead. Definition at line 95 of file DisplayWriter.d. References Writer::enableArrayPrefix(), style, utf8(), and workspace. |
|
Construct a DisplayWriter upon the specified IConduit Reimplemented from Writer. Reimplemented in FlushWriter. Definition at line 115 of file DisplayWriter.d. |
|
Intercept discrete output and convert it to printable form Reimplemented from Writer. Definition at line 126 of file DisplayWriter.d. References style. |
|
Format a set of arguments a la printf(). Please see module mango.format.Format for details Definition at line 139 of file DisplayWriter.d. References Format::print(), and style. |
|
Format a set of arguments a la printf(). Please see module mango.format.Format for details Definition at line 152 of file DisplayWriter.d. References print(). |
|
Format a set of arguments a la printf(). Please see module mango.format.Format for details Definition at line 165 of file DisplayWriter.d. References print(), and Writer::put(). |
|
Utf8 handler provided to the formatting package, which redirects the output via the normal char[] processing. Definition at line 179 of file DisplayWriter.d. References Writer::put(). Referenced by this(). |
|
Construct a Writer upon the provided IBuffer. All formatted output will be directed to this buffer. Reimplemented in HttpWriter, EndianWriter, and FlushWriter. Definition at line 158 of file Writer.d. References Writer::buffer, Writer::Encoder::char16, Writer::Encoder::char32, Writer::Encoder::char8, Writer::encode, and Writer::encoder(). |
|
Definition at line 183 of file Writer.d. Referenced by EndianWriter::write(). |
|
Return the associated buffer Reimplemented from IWriter. Definition at line 194 of file Writer.d. References Writer::buffer. |
|
Bind an IEncoder to the writer. Encoders are intended to be used as a conversion mechanism between various character representations (encodings). Each type may be configured with a distinct encoder. An appropriate encoder set should be attached to each IWriter, and thus be available for subsequent use. A raw binary implementation is attached by default (no encoding). See module mango.icu.UMango for an example of encoder implementation -- those classes bind the ICU converters to this IO package. Reimplemented from IWriter. Definition at line 216 of file Writer.d. References IEncoder::bind(), Writer::encode, Writer::Encoder::encoders, and IEncoder::type(). |
|
Flush the output of this writer. Returns false if the operation failed, true otherwise. Reimplemented from IWriter. Definition at line 228 of file Writer.d. References Writer::buffer, and IBuffer::flush(). Referenced by Writer::put(), and FlushWriter::put(). |
|
Output a newline. Do this indirectly so that it can be intercepted by subclasses. Reimplemented from IWriter. Definition at line 241 of file Writer.d. References CR, and Writer::put(). |
|
Enable array prefixing. These prefixes represent the number of elements in the array, and are used when reading arrays back in again. Definition at line 254 of file Writer.d. References Writer::prefixArray. Referenced by this(). |
|
Flush this writer. This is a convenience method used by the "whisper" syntax. Reimplemented from IWriter. Definition at line 299 of file Writer.d. References Writer::flush(). Referenced by Writer::cr(), Writer::length(), println(), testBuffer(), and utf8(). |
|
Write a class to the current buffer-position Reimplemented from IWriter. Reimplemented in ColumnWriter, FlushWriter, and TextWriter. Definition at line 310 of file Writer.d. References assert(), and IWritable::write(). |
|
Write a boolean value to the current buffer-position Reimplemented from IWriter. Definition at line 323 of file Writer.d. References Writer::write(). |
|
Write an unsigned byte value to the current buffer-position Reimplemented from IWriter. Definition at line 334 of file Writer.d. References Writer::write(). |
|
Write a byte value to the current buffer-position Reimplemented from IWriter. Definition at line 345 of file Writer.d. References Writer::write(). |
|
Write an unsigned short value to the current buffer-position Reimplemented from IWriter. Definition at line 356 of file Writer.d. References Writer::write(). |
|
Write a short value to the current buffer-position Reimplemented from IWriter. Definition at line 367 of file Writer.d. References Writer::write(). |
|
Write a unsigned int value to the current buffer-position Reimplemented from IWriter. Definition at line 378 of file Writer.d. References Writer::write(). |
|
Write an int value to the current buffer-position Reimplemented from IWriter. Definition at line 389 of file Writer.d. References Writer::write(). |
|
Write an unsigned long value to the current buffer-position Reimplemented from IWriter. Definition at line 400 of file Writer.d. References Writer::write(). |
|
Write a long value to the current buffer-position Reimplemented from IWriter. Definition at line 411 of file Writer.d. References Writer::write(). |
|
Write a float value to the current buffer-position Reimplemented from IWriter. Definition at line 422 of file Writer.d. References Writer::write(). |
|
Write a double value to the current buffer-position Reimplemented from IWriter. Definition at line 433 of file Writer.d. References Writer::write(). |
|
Write a real value to the current buffer-position Reimplemented from IWriter. Definition at line 444 of file Writer.d. References Writer::write(). |
|
Write a char value to the current buffer-position Reimplemented from IWriter. Definition at line 455 of file Writer.d. References Writer::Encoder::char8, and Writer::encode. |
|
Write a wchar value to the current buffer-position Reimplemented from IWriter. Definition at line 467 of file Writer.d. References Writer::Encoder::char16, and Writer::encode. |
|
Write a dchar value to the current buffer-position Reimplemented from IWriter. Definition at line 479 of file Writer.d. References Writer::Encoder::char32, and Writer::encode. |
|
Write a byte array to the current buffer-position Reimplemented from IWriter. Definition at line 491 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write an unsigned byte array to the current buffer-position Reimplemented from IWriter. Definition at line 502 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a short array to the current buffer-position Reimplemented from IWriter. Definition at line 513 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write an unsigned short array to the current buffer-position Reimplemented from IWriter. Definition at line 524 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write an int array to the current buffer-position Reimplemented from IWriter. Definition at line 535 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write an unsigned int array to the current buffer-position Reimplemented from IWriter. Definition at line 546 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a long array to the current buffer-position Reimplemented from IWriter. Definition at line 557 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write an unsigned long array to the current buffer-position Reimplemented from IWriter. Definition at line 568 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a float array to the current buffer-position Reimplemented from IWriter. Definition at line 579 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a double array to the current buffer-position Reimplemented from IWriter. Definition at line 590 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a real array to the current buffer-position Reimplemented from IWriter. Definition at line 601 of file Writer.d. References Writer::length(), and Writer::write(). |
|
Write a char array to the current buffer-position Reimplemented from IWriter. Reimplemented in ColumnWriter, FlushWriter, and TextWriter. Definition at line 612 of file Writer.d. References Writer::Encoder::char8, Writer::encode, and Writer::length(). |
|
Write a wchar array to the current buffer-position Reimplemented from IWriter. Reimplemented in TextWriter. Definition at line 624 of file Writer.d. References Writer::Encoder::char16, Writer::encode, and Writer::length(). |
|
Write a dchar array to the current buffer-position Reimplemented from IWriter. Reimplemented in TextWriter. Definition at line 636 of file Writer.d. References Writer::Encoder::char32, Writer::encode, and Writer::length(). |
|
Definition at line 82 of file DisplayWriter.d. |
|
Definition at line 83 of file DisplayWriter.d. Referenced by this(). |
|
Definition at line 145 of file Writer.d. Referenced by Writer::encoder(), Writer::flush(), Writer::getBuffer(), Writer::this(), and Writer::write(). |
|
Definition at line 147 of file Writer.d. Referenced by Writer::put(), Writer::putd(), Writer::putw(), Writer::setEncoder(), and Writer::this(). |