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

TextWriter Class Reference

Inheritance diagram for TextWriter:

DisplayWriter List of all members.

Public Types

typedef DisplayWriter put put

Public Member Functions

 this (IBuffer buffer, char[] delimiter)
char[] toString ()
void suppress (byte count)
IWriter put (IWritable x)
IWriter put (char[] x)

Private Member Functions

final void delimit ()
 this (IBuffer buffer)
 this (IConduit conduit)
void setPrecision (uint digits)
void format (char[] fmt, void *src)
void format (void *src, uint count, uint width, char[] fmt)
void int8f (ubyte *src, uint count, char[] fmt)
void int16f (ushort *src, uint count, char[] fmt)
void int1 (void *src, uint count)
void int8 (void *src, uint count)
void int8u (void *src, uint count)
void int16 (void *src, uint count)
void int16u (void *src, uint count)
void int32 (void *src, uint count)
void int32u (void *src, uint count)
void int64 (void *src, uint count)
void int64u (void *src, uint count)
void float32 (void *src, uint count)
void float64 (void *src, uint count)
void float80 (void *src, uint count)

Static Private Member Functions

 this ()

Private Attributes

byte ignore
char[] delimiter
public class VersionWin32
typedef _vsnprintf 
vsnprintf

Detailed Description

Print readable output to an IWriter seperated by delimiters. Note that the delimiter should be chosen such that it doesn't conflict with any other characters being written. For example, by choosing a comma-delimiter, you should ensure a comma is not output within a text string (so the output can be easily tokenized when read).

Definition at line 50 of file TextWriter.d.


Member Typedef Documentation

typedef DisplayWriter put put
 

Definition at line 55 of file TextWriter.d.


Member Function Documentation

this IBuffer  buffer,
char[]  delimiter
[inline]
 

Construct a TextWriter using the provided buffer. Output is seperated with the given delimiter string.

Definition at line 64 of file TextWriter.d.

References delimiter.

char [] toString  )  [inline]
 

Return the name of this writer

Reimplemented from DisplayWriter.

Definition at line 74 of file TextWriter.d.

void suppress byte  count  )  [inline]
 

Reset this writer, so it won't emit the specified series of subsequent delimeters

Definition at line 86 of file TextWriter.d.

References ignore.

Referenced by put().

IWriter put IWritable  x  )  [inline]
 

Intercept the IWritable method to catch newlines

Reimplemented from AbstractWriter.

Definition at line 97 of file TextWriter.d.

References suppress().

IWriter put char[]  x  )  [inline]
 

Intercept the output so we can append a delimiter.

Todo:
  • add the equivalent intercepts for wchar[] and dchar[] methods. I think it's perhaps OK to restrict delimiters to char[] only.

Reimplemented from AbstractWriter.

Definition at line 117 of file TextWriter.d.

References delimit().

final void delimit  )  [inline, private]
 

write a delimiter after each token

Definition at line 130 of file TextWriter.d.

References delimiter, and ignore.

Referenced by put().

this IBuffer  buffer  )  [inline, inherited]
 

Construct a DisplayWriter upon the specified IBuffer

Reimplemented from Writer.

Reimplemented in HttpWriter.

Definition at line 68 of file DisplayWriter.d.

References AbstractWriter::enableArrayPrefix().

this IConduit  conduit  )  [inline, inherited]
 

Construct a DisplayWriter upon the specified IConduit

Reimplemented from Writer.

Definition at line 96 of file DisplayWriter.d.

this  )  [inline, static, inherited]
 

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

Reimplemented in ColumnWriter.

Definition at line 159 of file AbstractWriter.d.

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

void setPrecision uint  digits  )  [inline, inherited]
 

Set the number of floating point digits

Definition at line 116 of file DisplayWriter.d.

Referenced by testColumn().

void format char[]  fmt,
void *  src
[inline, inherited]
 

Convert to a string and send back through the framework such that it may be intercepted by a subclass.

Definition at line 128 of file DisplayWriter.d.

References DisplayWriter::encode, AbstractWriter::put(), and DisplayWriter::vsnprintf.

Referenced by DisplayWriter::float32(), DisplayWriter::float64(), DisplayWriter::float80(), DisplayWriter::format(), DisplayWriter::int16f(), DisplayWriter::int32(), DisplayWriter::int32u(), DisplayWriter::int64(), DisplayWriter::int64u(), and DisplayWriter::int8f().

void format void *  src,
uint  count,
uint  width,
char[]  fmt
[inline, inherited]
 

Definition at line 169 of file DisplayWriter.d.

References DisplayWriter::format().

void int8f ubyte *  src,
uint  count,
char[]  fmt
[inline, inherited]
 

Definition at line 137 of file DisplayWriter.d.

References DisplayWriter::format().

Referenced by DisplayWriter::int8(), and DisplayWriter::int8u().

void int16f ushort *  src,
uint  count,
char[]  fmt
[inline, inherited]
 

Definition at line 153 of file DisplayWriter.d.

References DisplayWriter::format().

Referenced by DisplayWriter::int16(), and DisplayWriter::int16u().

void int1 void *  src,
uint  count
[inline, inherited]
 

Definition at line 184 of file DisplayWriter.d.

void int8 void *  src,
uint  count
[inline, inherited]
 

Definition at line 202 of file DisplayWriter.d.

References DisplayWriter::int8f().

void int8u void *  src,
uint  count
[inline, inherited]
 

Definition at line 211 of file DisplayWriter.d.

References DisplayWriter::int8f().

void int16 void *  src,
uint  count
[inline, inherited]
 

Definition at line 220 of file DisplayWriter.d.

References DisplayWriter::int16f().

void int16u void *  src,
uint  count
[inline, inherited]
 

Definition at line 229 of file DisplayWriter.d.

References DisplayWriter::int16f().

void int32 void *  src,
uint  count
[inline, inherited]
 

Definition at line 238 of file DisplayWriter.d.

References DisplayWriter::format().

void int32u void *  src,
uint  count
[inline, inherited]
 

Definition at line 247 of file DisplayWriter.d.

References DisplayWriter::format().

void int64 void *  src,
uint  count
[inline, inherited]
 

Definition at line 256 of file DisplayWriter.d.

References DisplayWriter::format().

void int64u void *  src,
uint  count
[inline, inherited]
 

Definition at line 265 of file DisplayWriter.d.

References DisplayWriter::format().

void float32 void *  src,
uint  count
[inline, inherited]
 

Definition at line 274 of file DisplayWriter.d.

References DisplayWriter::format().

void float64 void *  src,
uint  count
[inline, inherited]
 

Definition at line 283 of file DisplayWriter.d.

References DisplayWriter::format().

void float80 void *  src,
uint  count
[inline, inherited]
 

Definition at line 292 of file DisplayWriter.d.

References DisplayWriter::format().


Member Data Documentation

byte ignore [private]
 

Definition at line 52 of file TextWriter.d.

Referenced by delimit(), and suppress().

char [] delimiter [private]
 

Definition at line 53 of file TextWriter.d.

Referenced by delimit(), and this().

public class VersionWin32 typedef _vsnprintf vsnprintf [inherited]
 

Definition at line 59 of file DisplayWriter.d.

Referenced by DisplayWriter::format().


The documentation for this class was generated from the following file:
Generated on Sun Nov 7 19:07:12 2004 for Mango by doxygen 1.3.6