Inheritance diagram for AbstractWriter:
Public Types | |
typedef opShl | put |
Public Member Functions | |
this (IBuffer buffer) | |
IBuffer | getBuffer () |
void | setEncoder (IEncoder e) |
IWriter | flush () |
IWriter | cr () |
void | enableArrayPrefix (bool on) |
IWriter | opShl (IWritable x) |
IWriter | opShl (bool x) |
IWriter | opShl (ubyte x) |
IWriter | opShl (byte x) |
IWriter | opShl (ushort x) |
IWriter | opShl (short x) |
IWriter | opShl (uint x) |
IWriter | opShl (int x) |
IWriter | opShl (ulong x) |
IWriter | opShl (long x) |
IWriter | opShl (float x) |
IWriter | opShl (double x) |
IWriter | opShl (real x) |
IWriter | opShl (char x) |
IWriter | opShl (wchar x) |
IWriter | opShl (dchar x) |
IWriter | opShl (byte[] x) |
IWriter | opShl (ubyte[] x) |
IWriter | opShl (short[] x) |
IWriter | opShl (ushort[] x) |
IWriter | opShl (int[] x) |
IWriter | opShl (uint[] x) |
IWriter | opShl (long[] x) |
IWriter | opShl (ulong[] x) |
IWriter | opShl (float[] x) |
IWriter | opShl (double[] x) |
IWriter | opShl (real[] x) |
IWriter | opShl (char[] x) |
IWriter | opShlw (wchar[] x) |
IWriter | opShld (dchar[] x) |
Static Public Member Functions | |
this () | |
Static Public Attributes | |
INewlineWriter | newline |
Protected Attributes | |
IBuffer | buffer |
Encoder | encode |
Static Protected Attributes | |
IOException | ovf |
Private Member Functions | |
final uint | length (uint len) |
Private Attributes | |
bool | prefixArray = true |
Writers support both a C++ iostream type syntax, along with a put() syntax. Operations may be chained back-to-back.
All writers support the full set of native data types, plus a full selection of array types.
The code below illustrates basic operation upon a memory buffer:
Buffer buf = new Buffer (256); // map same buffer into both reader and writer IReader r = new Reader(buf); IWriter w = new Writer(buf); int i = 10; long j = 20; double d = 3.14159; char[] c = "fred"; // write data types out w << c << i << j << d; // read them back again r >> c >> i >> j >> d; // reset buf.clear(); // same thing again, but using put() syntax instead w.put(c).put(i).put(j).put(d); r.get(c).get(i).get(j).get(d);
Writers may also be used with any class implementing the IWritable interface. See PickleReader for an example of how this can be put to good use.
Definition at line 96 of file AbstractWriter.d.
|
Reimplemented from IWriter. Reimplemented in ColumnWriter, FlushWriter, and TextWriter. Definition at line 98 of file AbstractWriter.d. Referenced by cr(), DisplayWriter::fformat(), DisplayWriter::format(), length(), testBuffer(), testConduitFilters(), and testRandomAccess(). |
|
Construct some static exception instances, and create the public 'newline' instance. Reimplemented in ColumnWriter. Definition at line 145 of file AbstractWriter.d. |
|
Construct a Writer upon the provided IBuffer. All formatted output will be appended to this buffer. Reimplemented in HttpWriter, DisplayWriter, FlushWriter, EndianWriter, and Writer. Definition at line 159 of file AbstractWriter.d. |
|
Return the associated buffer Reimplemented from IWriter. Definition at line 170 of file AbstractWriter.d. |
|
Bind an IEncoder to the writer. Encoders are intended to be used as a conversion mechanism between various character representations (encodings), or the translation of any data type from one representation to another. Each data type may be configured with a distinct encoder, covering all native types (15 in total). 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 194 of file AbstractWriter.d. References IEncoder::bind(), encode, AbstractWriter::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 206 of file AbstractWriter.d. References IBuffer::flush(). Referenced by FlushWriter::opShl(), and testRandomAccess(). |
|
Output a newline. Do this indirectly so that it can be intercepted by subclasses. Reimplemented from IWriter. Definition at line 219 of file AbstractWriter.d. |
|
Definition at line 228 of file AbstractWriter.d. References prefixArray. Referenced by DisplayWriter::this(). |
|
Write a class to the current buffer-position Definition at line 239 of file AbstractWriter.d. References prefixArray, and put. |
|
Write a class to the current buffer-position Reimplemented from IWriter. Reimplemented in ColumnWriter, FlushWriter, and TextWriter. Definition at line 252 of file AbstractWriter.d. References IWritable::write(). |
|
Write a boolean value to the current buffer-position Reimplemented from IWriter. Definition at line 265 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int1. |
|
Write an unsigned byte value to the current buffer-position Reimplemented from IWriter. Definition at line 277 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int8u. |
|
Write a byte value to the current buffer-position Reimplemented from IWriter. Definition at line 289 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int8. |
|
Write an unsigned short value to the current buffer-position Reimplemented from IWriter. Definition at line 301 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int16u. |
|
Write a short value to the current buffer-position Reimplemented from IWriter. Definition at line 313 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int16. |
|
Write a unsigned int value to the current buffer-position Reimplemented from IWriter. Definition at line 325 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int32u. |
|
Write an int value to the current buffer-position Reimplemented from IWriter. Definition at line 337 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int32. |
|
Write an unsigned long value to the current buffer-position Reimplemented from IWriter. Definition at line 349 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int64u. |
|
Write a long value to the current buffer-position Reimplemented from IWriter. Definition at line 361 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int64. |
|
Write a float value to the current buffer-position Reimplemented from IWriter. Definition at line 373 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float32. |
|
Write a double value to the current buffer-position Reimplemented from IWriter. Definition at line 385 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float64. |
|
Write a real value to the current buffer-position Reimplemented from IWriter. Definition at line 397 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float80. |
|
Write a char value to the current buffer-position Reimplemented from IWriter. Definition at line 409 of file AbstractWriter.d. References AbstractWriter::Encoder::char8, and encode. |
|
Write a wide char value to the current buffer-position Reimplemented from IWriter. Definition at line 421 of file AbstractWriter.d. References AbstractWriter::Encoder::char16, and encode. |
|
Write a double char value to the current buffer-position Reimplemented from IWriter. Definition at line 433 of file AbstractWriter.d. References AbstractWriter::Encoder::char32, and encode. |
|
Write a byte array to the current buffer-position Reimplemented from IWriter. Definition at line 445 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int8. |
|
Write an unsigned byte array to the current buffer-position Reimplemented from IWriter. Definition at line 457 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int8u. |
|
Write a short array to the current buffer-position Reimplemented from IWriter. Definition at line 469 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int16. |
|
Write an unsigned short array to the current buffer-position Reimplemented from IWriter. Definition at line 481 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int16u. |
|
Write an int array to the current buffer-position Reimplemented from IWriter. Definition at line 493 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int32. |
|
Write an unsigned int array to the current buffer-position Reimplemented from IWriter. Definition at line 505 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int32u. |
|
Write a long array to the current buffer-position Reimplemented from IWriter. Definition at line 517 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int64. |
|
Write an unsigned long array to the current buffer-position Reimplemented from IWriter. Definition at line 529 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::int64u. |
|
Write a float array to the current buffer-position Reimplemented from IWriter. Definition at line 541 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float32. |
|
Write a double array to the current buffer-position Reimplemented from IWriter. Definition at line 553 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float64. |
|
Write a real array to the current buffer-position Reimplemented from IWriter. Definition at line 565 of file AbstractWriter.d. References encode, and AbstractWriter::Encoder::float80. |
|
Write a char array to the current buffer-position Reimplemented from IWriter. Reimplemented in ColumnWriter, and TextWriter. Definition at line 577 of file AbstractWriter.d. References AbstractWriter::Encoder::char8, and encode. |
|
Write a char array to the current buffer-position Reimplemented from IWriter. Reimplemented in TextWriter. Definition at line 589 of file AbstractWriter.d. References AbstractWriter::Encoder::char16, and encode. |
|
Write a char array to the current buffer-position Reimplemented from IWriter. Reimplemented in TextWriter. Definition at line 601 of file AbstractWriter.d. References AbstractWriter::Encoder::char32, and encode. |
|
Definition at line 127 of file AbstractWriter.d. |
|
Definition at line 130 of file AbstractWriter.d. Referenced by this(). |
|
Definition at line 132 of file AbstractWriter.d. |
|
Definition at line 134 of file AbstractWriter.d. Referenced by opShl(), opShld(), opShlw(), and setEncoder(). |
|
Definition at line 136 of file AbstractWriter.d. Referenced by enableArrayPrefix(), and length(). |