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

Styled::Style Struct Reference

List of all members.

Public Member Functions

void opCall (Utf8Sink utf8, char[] workspace, DblFormat dFormat=null)
void setFormat (char[] format)
void clear ()
int emit (char[] field)
char parse (char[] format)

Public Attributes

Utf8Sink utf8
int type
int width
int precision
Flags flags
char[] head
char[] tail
char[] meta
DblFormat dFormat
char[] workspace

Detailed Description

The state of a stylistic conversion. This can be embedded within a class, or instantiated on the stack. Be sure to initialize the Style via methods opCall() & setFormat()

Definition at line 98 of file Styled.d.


Member Function Documentation

void opCall Utf8Sink  utf8,
char[]  workspace,
DblFormat  dFormat = null
[inline]
 

Configure this Style with an output handler, a workspace area, and a floating point handler. The latter is optional.

Definition at line 119 of file Styled.d.

void setFormat char[]  format  )  [inline]
 

Set the format string for this Style

Definition at line 132 of file Styled.d.

void clear  )  [inline]
 

Clear the current state. This is typically used internally only.

Definition at line 144 of file Styled.d.

int emit char[]  field  )  [inline]
 

Emit a field, surrounded by optional prefix and postfix strings, and optionally padded with spaces.

Definition at line 158 of file Styled.d.

char parse char[]  format  )  [inline]
 

Parse a format specifier into its constituent flags and values. Syntax follows the traditional printf() approach, as follows:

[flags][width][.precision]type

Where 'type' is one of:

s : string format c : character format d : signed format u : unsigned format x : hexadecimal format X : uppercase hexadecimal format e : scientific notation f : floating point format g : 'e' or 'f', based upon width

Note that there are no variants on the format types ~ long, int, short, and byte differences are all handled internally.

The 'flags' supported:

space : prefix negative integer with one space; pad any type when combined with a width specifier

  • : left-align fields padded with spaces + : prefix positive integer with one '+' 0 : prefix integers with zeroes; requires a width specification # : prefix integers with a type specifier @ : Array specifier

The 'width' should be specified for either zero or space padding, and may be used with all formatting types.

A 'precision' can be used to stipulate the number of decimal-places, or a slice of a text string.

Note that the Format package supports array-output in addition to the usual printf() output.

Definition at line 247 of file Styled.d.


Member Data Documentation

Utf8Sink utf8
 

Definition at line 100 of file Styled.d.

int type
 

Definition at line 101 of file Styled.d.

int width
 

Definition at line 101 of file Styled.d.

int precision
 

Definition at line 101 of file Styled.d.

Flags flags
 

Definition at line 104 of file Styled.d.

char [] head
 

Definition at line 105 of file Styled.d.

char [] tail
 

Definition at line 105 of file Styled.d.

char [] meta
 

Definition at line 105 of file Styled.d.

DblFormat dFormat
 

Definition at line 108 of file Styled.d.

char [] workspace
 

Definition at line 109 of file Styled.d.


The documentation for this struct was generated from the following file:
Generated on Fri May 27 18:12:03 2005 for Mango by  doxygen 1.4.0