www.digitalmars.com Home | Search | D | Comments
Last update Mon Aug 22 2005
D
Language
Phobos
Comparisons


object

std
 std.base64
 std.boxer
 std.compiler
 std.conv
 std.ctype
 std.date
 std.file
 std.format
 std.gc
 std.intrinsic
 std.math
 std.md5
 std.mmfile
 std.openrj
 std.outbuffer
 std.path
 std.process
 std.random
 std.recls
 std.regexp
 std.socket
 std.socketstream
 std.stdint
 std.stdio
 std.cstream
 std.stream
 std.string
 std.system
 std.thread
 std.uri
 std.utf
 std.zip
 std.zlib

std.windows

std.linux

std.c
 std.c.stdio

std.c.windows

std.c.linux

std.conv

std.conv provides basic building blocks for conversions from strings to integral types. They differ from the C functions atoi() and atol() by not allowing whitespace or overflows.

For conversion to signed types, the grammar recognized is:

	Integer:
		Sign UnsignedInteger
		UnsignedInteger

	Sign:
		+
		-
	
For conversion to unsigned types, the grammar recognized is:
	UnsignedInteger:
		DecimalDigit
		DecimalDigit UnsignedInteger
	
Any deviation from that grammar causes a ConvError exception to be thrown. Any overflows cause a ConvOverflowError to be thrown.
byte toByte(char[] s)

ubyte toUbyte(char[] s)

short toShort(char[] s)

ushort toUshort(char[] s)

int toInt(char[] s)

uint toUint(char[] s)

long toLong(char[] s)

ulong toUlong(char[] s)

Feedback and Comments

Add feedback and comments regarding this page.
Copyright © 1999-2005 by Digital Mars, All Rights Reserved