std.conv - D Programming Language - Digital Mars

D Programming Language 1.0

- Comments
- D
- Search
- Home

Last update Wed Sep 2 00:11:32 2009

# std.conv

Conversion building blocks. These differ from the C equivalents `atoi()` and `atol()` by checking for overflow and not allowing whitespace.
For conversion to signed types, the grammar recognized is:

    Integer:
        Sign UnsignedInteger
        UnsignedInteger

    Sign:
        +
        -

For conversion to signed types, the grammar recognized is:

    UnsignedInteger:
        DecimalDigit
        DecimalDigit UnsignedInteger

class ConvError: object.Error;
  Thrown on conversion errors, which happens on deviation from the grammar.
class ConvOverflowError: object.Error;
  Thrown on conversion overflow errors.
int toInt(char[] s);
uint toUint(char[] s);
long toLong(char[] s);
ulong toUlong(char[] s);
short toShort(char[] s);
ushort toUshort(char[] s);
byte toByte(char[] s);
ubyte toUbyte(char[] s);
float toFloat(char[] s);
double toDouble(char[] s);
real toReal(char[] s);
  Convert character string to the return type.

Copyright © 1999-2009 by Digital Mars, All Rights Reserved | Page generated by Ddoc.