Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Writer Class Reference

Inheritance diagram for Writer:

AbstractWriter DisplayWriter EndianWriter ColumnWriter FlushWriter HttpWriter TextWriter List of all members.

Public Types

typedef void function (void *dst, uint count) Mutator

Public Member Functions

 this (IBuffer buffer)
 this (IConduit conduit)
void write (void *src, uint count)
void write (void *src, uint count, int mask, Mutator mutate)
final void write (void *src, uint count, int mask, Mutator mutate)

Private Types

typedef opShl put

Private Member Functions

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 Private Member Functions

 this ()

Private Attributes

IBuffer buffer
Encoder encode

Static Private Attributes

INewlineWriter newline
IOException ovf

Detailed Description

Binary data Writer. Writers provide the means to append formatted data to an IBuffer, and expose a convenient method of handling a variety of data types. In addition to writing native types such as integer and char[], writers also process any class which has implemented the IWritable interface (one method).

See AbstractWriter for usage examples.

Definition at line 55 of file Writer.d.


Member Typedef Documentation

typedef void function(void* dst, uint count) Mutator
 

Definition at line 57 of file Writer.d.

typedef opShl put [inherited]
 

Reimplemented from IWriter.

Reimplemented in ColumnWriter, FlushWriter, and TextWriter.

Definition at line 98 of file AbstractWriter.d.

Referenced by AbstractWriter::cr(), DisplayWriter::fformat(), DisplayWriter::format(), AbstractWriter::length(), testBuffer(), testConduitFilters(), and testRandomAccess().


Member Function Documentation

this IBuffer  buffer  )  [inline]
 

Construct a Writer upon the provided IBuffer. All formatted output will be directed to this buffer.

Reimplemented from AbstractWriter.

Reimplemented in HttpWriter, DisplayWriter, FlushWriter, and EndianWriter.

Definition at line 66 of file Writer.d.

this IConduit  conduit  )  [inline]
 

Construct a Writer on the buffer associated with the given conduit.

Reimplemented in DisplayWriter, and FlushWriter.

Definition at line 94 of file Writer.d.

void write void *  src,
uint  count
[inline]
 

Definition at line 103 of file Writer.d.

Referenced by EndianWriter::bits16(), EndianWriter::bits32(), EndianWriter::bits64(), and EndianWriter::bits80().

void write void *  src,
uint  count,
int  mask,
Mutator  mutate
[inline]
 

Definition at line 116 of file Writer.d.

References IBuffer::flush(), IBuffer::getConduit(), IBuffer::grow(), and IBuffer::write().

final void write void *  src,
uint  count,
int  mask,
Mutator  mutate
[inline]
 

Definition at line 147 of file Writer.d.

References IBuffer::flush(), IBuffer::getConduit(), IBuffer::grow(), and IBuffer::writable().

this  )  [inline, static, inherited]
 

Construct some static exception instances, and create the public 'newline' instance.

Reimplemented in ColumnWriter.

Definition at line 145 of file AbstractWriter.d.

References AbstractWriter::newline, and AbstractWriter::ovf.

IBuffer getBuffer  )  [inline, inherited]
 

Return the associated buffer

Reimplemented from IWriter.

Definition at line 170 of file AbstractWriter.d.

void setEncoder IEncoder  e  )  [inline, inherited]
 

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(), AbstractWriter::encode, AbstractWriter::Encoder::encoders, and IEncoder::type().

IWriter flush  )  [inline, inherited]
 

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().

IWriter cr  )  [inline, inherited]
 

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.

References AbstractWriter::newline, and AbstractWriter::put.

void enableArrayPrefix bool  on  )  [inline, inherited]
 

Definition at line 228 of file AbstractWriter.d.

References AbstractWriter::prefixArray.

Referenced by DisplayWriter::this().

IWriter opShl IWritable  x  )  [inline, inherited]
 

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().

IWriter opShl bool  x  )  [inline, inherited]
 

Write a boolean value to the current buffer-position

Reimplemented from IWriter.

Definition at line 265 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int1.

IWriter opShl ubyte  x  )  [inline, inherited]
 

Write an unsigned byte value to the current buffer-position

Reimplemented from IWriter.

Definition at line 277 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int8u.

IWriter opShl byte  x  )  [inline, inherited]
 

Write a byte value to the current buffer-position

Reimplemented from IWriter.

Definition at line 289 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int8.

IWriter opShl ushort  x  )  [inline, inherited]
 

Write an unsigned short value to the current buffer-position

Reimplemented from IWriter.

Definition at line 301 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int16u.

IWriter opShl short  x  )  [inline, inherited]
 

Write a short value to the current buffer-position

Reimplemented from IWriter.

Definition at line 313 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int16.

IWriter opShl uint  x  )  [inline, inherited]
 

Write a unsigned int value to the current buffer-position

Reimplemented from IWriter.

Definition at line 325 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int32u.

IWriter opShl int  x  )  [inline, inherited]
 

Write an int value to the current buffer-position

Reimplemented from IWriter.

Definition at line 337 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int32.

IWriter opShl ulong  x  )  [inline, inherited]
 

Write an unsigned long value to the current buffer-position

Reimplemented from IWriter.

Definition at line 349 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int64u.

IWriter opShl long  x  )  [inline, inherited]
 

Write a long value to the current buffer-position

Reimplemented from IWriter.

Definition at line 361 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int64.

IWriter opShl float  x  )  [inline, inherited]
 

Write a float value to the current buffer-position

Reimplemented from IWriter.

Definition at line 373 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float32.

IWriter opShl double  x  )  [inline, inherited]
 

Write a double value to the current buffer-position

Reimplemented from IWriter.

Definition at line 385 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float64.

IWriter opShl real  x  )  [inline, inherited]
 

Write a real value to the current buffer-position

Reimplemented from IWriter.

Definition at line 397 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float80.

IWriter opShl char  x  )  [inline, inherited]
 

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 AbstractWriter::encode.

IWriter opShl wchar  x  )  [inline, inherited]
 

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 AbstractWriter::encode.

IWriter opShl dchar  x  )  [inline, inherited]
 

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 AbstractWriter::encode.

IWriter opShl byte[]  x  )  [inline, inherited]
 

Write a byte array to the current buffer-position

Reimplemented from IWriter.

Definition at line 445 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int8.

IWriter opShl ubyte[]  x  )  [inline, inherited]
 

Write an unsigned byte array to the current buffer-position

Reimplemented from IWriter.

Definition at line 457 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int8u.

IWriter opShl short[]  x  )  [inline, inherited]
 

Write a short array to the current buffer-position

Reimplemented from IWriter.

Definition at line 469 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int16.

IWriter opShl ushort[]  x  )  [inline, inherited]
 

Write an unsigned short array to the current buffer-position

Reimplemented from IWriter.

Definition at line 481 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int16u.

IWriter opShl int[]  x  )  [inline, inherited]
 

Write an int array to the current buffer-position

Reimplemented from IWriter.

Definition at line 493 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int32.

IWriter opShl uint[]  x  )  [inline, inherited]
 

Write an unsigned int array to the current buffer-position

Reimplemented from IWriter.

Definition at line 505 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int32u.

IWriter opShl long[]  x  )  [inline, inherited]
 

Write a long array to the current buffer-position

Reimplemented from IWriter.

Definition at line 517 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int64.

IWriter opShl ulong[]  x  )  [inline, inherited]
 

Write an unsigned long array to the current buffer-position

Reimplemented from IWriter.

Definition at line 529 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::int64u.

IWriter opShl float[]  x  )  [inline, inherited]
 

Write a float array to the current buffer-position

Reimplemented from IWriter.

Definition at line 541 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float32.

IWriter opShl double[]  x  )  [inline, inherited]
 

Write a double array to the current buffer-position

Reimplemented from IWriter.

Definition at line 553 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float64.

IWriter opShl real[]  x  )  [inline, inherited]
 

Write a real array to the current buffer-position

Reimplemented from IWriter.

Definition at line 565 of file AbstractWriter.d.

References AbstractWriter::encode, and AbstractWriter::Encoder::float80.

IWriter opShl char[]  x  )  [inline, inherited]
 

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 AbstractWriter::encode.

IWriter opShlw wchar[]  x  )  [inline, inherited]
 

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 AbstractWriter::encode.

IWriter opShld dchar[]  x  )  [inline, inherited]
 

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 AbstractWriter::encode.


Member Data Documentation

INewlineWriter newline [static, inherited]
 

Definition at line 127 of file AbstractWriter.d.

Referenced by AbstractWriter::cr(), and AbstractWriter::this().

IOException ovf [static, protected, inherited]
 

Definition at line 130 of file AbstractWriter.d.

Referenced by AbstractWriter::this().

IBuffer buffer [protected, inherited]
 

Definition at line 132 of file AbstractWriter.d.

Encoder encode [protected, inherited]
 

Definition at line 134 of file AbstractWriter.d.

Referenced by AbstractWriter::opShl(), AbstractWriter::opShld(), AbstractWriter::opShlw(), and AbstractWriter::setEncoder().


The documentation for this class was generated from the following file:
Generated on Tue Jan 25 21:18:46 2005 for Mango by doxygen 1.3.6