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

Integer.d File Reference

Go to the source code of this file.

Functions

struct IntegerTemplate (T)
typedef IntegerTemplate (char) Integer

Variables

module mango convert Integer
import mango convert Atoi


Detailed Description

Copyright (c) 2004 Kris Bell

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for damages of any kind arising from the use of this software.

Permission is hereby granted to anyone to use this software for any purpose, including commercial applications, and to alter it and/or redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment within documentation of said product would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any distribution of the source.

4. Derivative works are permitted, but they must carry this notice in full and credit the original source.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Version:
Initial version, Nov 2005
Author:
Kris

Definition in file Integer.d.


Function Documentation

struct IntegerTemplate  ) 
 

A set of functions for converting between string and integer values.

Declare stylistic flags

Format numeric values into the provided output buffer. The traditional printf() conversion specifiers are adhered to, and the following types are supported:

u - unsigned decimal d - signed decimal o - octal x - lowercase hexadecimal X - uppercase hexadecimal b - binary

Modifiers supported include:

# : prefix the conversion with a type identifier + : prefix positive decimals with a '+' space : prefix positive decimals with one space 0 : left-pad the number with zeros

These modifiers are specifed via the 'flags' provided, and are represented via these identifiers:

# : Flags.Hash + : Flags.Plus space : Flags.Space 0 : Flags.Zero

The provided 'dst' buffer should be sufficiently large enough to house the output. A 64-element array is often the maximum required (for a padded binary 64-bit string)

Parse an integer value from the provided 'src' string. The string is also inspected for a radix (defaults to 10), which can be overridden by setting 'radix' to non-zero.

A non-null 'ate' will return the number of characters used to construct the returned value.

Throw a format error. This is used by a number of other modules in this package

Definition at line 51 of file Integer.d.

References assert(), Atoi, AtoiTemplate(), Format, Integer, and IntegerTemplate().

Referenced by FormatStructTemplate(), and IntegerTemplate().

typedef IntegerTemplate char   ) 
 


Variable Documentation

module mango convert Integer
 

Definition at line 40 of file Integer.d.

import mango convert Atoi
 

Definition at line 42 of file Integer.d.


Generated on Sat Dec 24 17:28:35 2005 for Mango by  doxygen 1.4.0