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

TextFormat Class Reference

List of all members.

Public Member Functions

 this (int limit)
char[] format (char[] fmt,...)
char[] format (char[] fmt, va_list args)
char[] content ()

Private Attributes

int count
char[] output

Detailed Description

Constructs printf-style output. This is an adapter for "old" printf formatting, and writes it's output into a lookaside buffer. Content from the buffer can easily be passed to an IWriter instance.

// create a TextFormat instance TextFormat p = new TextFormat (256); // write text to Stdout Stdout << p.format ("%d green bottles, sitting on a wall\n", 10); // or access the content, post formatting ... char[] text = p.content;

This can be really handy when you wish to format text in conjunction with a Logger. Please note that the class is stateful, and therefore is not shareable across multiple threads.

Definition at line 67 of file TextFormat.d.


Member Function Documentation

this int  limit  )  [inline]
 

Set the maximum buffer length

Definition at line 78 of file TextFormat.d.

char [] format char[]  fmt,
... 
[inline]
 

format a set of arguments

Definition at line 89 of file TextFormat.d.

Referenced by testFormat().

char [] format char[]  fmt,
va_list  args
[inline]
 

format a va_list of arguments

Definition at line 104 of file TextFormat.d.

References content(), and version.

char [] content  )  [inline]
 

Address formatted output as a char[]

Definition at line 127 of file TextFormat.d.

Referenced by format().


Member Data Documentation

int count [private]
 

Definition at line 69 of file TextFormat.d.

char [] output [private]
 

Definition at line 70 of file TextFormat.d.


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