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

TextFormat Class Reference

List of all members.

Public Types

typedef format opCall

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 format = new TextFormat (256); // write text to Stdout Stdout (format ("%d green bottles, sitting on a wall\n", 10)); // or access the content, post formatting ... char[] text = format.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 70 of file TextFormat.d.


Member Typedef Documentation

typedef format opCall
 

Definition at line 72 of file TextFormat.d.


Member Function Documentation

this int  limit  )  [inline]
 

Set the maximum buffer length

Definition at line 83 of file TextFormat.d.

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

format a set of arguments

Definition at line 94 of file TextFormat.d.

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

format a va_list of arguments

Definition at line 109 of file TextFormat.d.

References content(), and version.

char [] content  )  [inline]
 

Address formatted output as a char[]

Definition at line 132 of file TextFormat.d.

Referenced by format().


Member Data Documentation

int count [private]
 

Definition at line 74 of file TextFormat.d.

char [] output [private]
 

Definition at line 75 of file TextFormat.d.


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 00:31:15 2005 for Mango by doxygen 1.3.6