MKoD - D Programming Language

D's Phobos Runtime Library Functions

Phobos - D's aka Mars runtime Library
  • std.base64 - Encode and Decode in the Base64 format
    • char[] encode( char[] str ) - Encode the string
    • char[] decode( char[] estr ) - Decode a string

  • std.compiler - Information about the D compiler implementation


  • std.conv - Conversion of strings to integers
    • byte toByte( char[] s ) - Convert character string to a byte
    • ubyte toUbyte( char[] s ) - Convert character string to a ubyte
    • int toInt( char[] s ) - Convert character string to a int
    • uint toUint( char[] s ) - Convert character string to a uint
    • long toLong( char[] s ) - Convert character string to a long
    • ulong toUlong( char[] s ) - Convert character string to a ulong
    • short toShort( char[] s ) - Convert character string to a short
    • ushort toUshort( char[] s ) - Convert character string to a ushort
    • float toFloat( char[] s ) - Convert character string to a float
    • double toDouble( char[] s ) - Convert character string to a double
    • real toReal( char[] s ) - Convert character string to a real

  • std.ctype - Simple character classification
    • int isalnum( dchar c ) - Is an ASCII Alphanumeric Character ( a..z, A..Z, 0..9 )
    • int isalpha( dchar c ) - Is an ASCII Alpha Character ( a..z, A..Z)
    • int iscntrl( dchar c ) - Is a Control Character
    • int isdigit( dchar c ) - Is a Digit ( 0..9 )
    • int islower( dchar c ) - Is an ASCII Lowercase Character ( a..z )
    • int ispunct( dchar c )
    • int isspace( dchar c ) - Is an Space Character
    • int isupper( dchar c ) - Is an ASCII Uppercase Character ( A..Z )
    • int isxdigit( dchar c ) - Is a Hexidecimal Charecter ( 0..9, a..f, A..F )
    • int isgraph( dchar c )
    • int isprint( dchar c )
    • int isascii( dchar c ) - Is an ASCII Character
    • dchar tolower( dchar c ) - Change a character to lowercase
    • dchar toupper( dchar c ) - Change a character to uppercase

  • std.date - Date and time functions. Support locales
    • char[] toString( d_time t ) - Converts t into a string of "Www Mmm dd hh:mm:ss GMT+-TZ yyyy"
    • char[] toDateString( d_time t ) - Converts the date portion into "Www Mmm dd yyyy"
    • char[] toTimeString( d_time t ) - Converts the time portion into "hh:mm:ss GMT+-TZ"
    • d_time parse( char[] s ) - Parses s as a textual date string, and returns it as a d_time
    • void toISO8601YearWeek( d_time t, out int year, out int week )
    • d_time getUTCtime() - Get current UTC time
    • d_time UTCtoLocalTime( d_time t ) - Convert from UTC time to local time
    • d_time LocalTimetoUTC( d_time t ) - Convert from local time to UTC time
    • d_time toDtime( DosFileTime time ) - Convert from DOS file date/time to d_time
    • DosFileTime toDosFileTime( d_time t ) - Convert from d_time to DOS file date/time

  • std.file - Basic file operations like read, write, append
    • void[] read( char[] name ) - Read file name[], return array of bytes read
    • void write( char[] name, void[] buffer ) - Write buffer[] to file name[]
    • void append( char[] name, void[] buffer ) - Append buffer[] to file name[]
    • void rename( char[] from, char[] to ) - Rename file from[] to to[]
    • void remove( char[] name ) - Delete file name[]
    • uint getSize( char[] name ) - Get size of file name[]
    • uint getAttributes( char[] name ) - Get file name[] attributes
    • int exists( char[] name ) - Does name[] exist (file or directory)?
    • int isfile( char[] name ) - Is name[] a file?
    • int isdir( char[] name ) - Is name[] a directory?
    • void chdir( char[] name ) - Change directory
    • void mkdir( char[] name ) - Make directory
    • void rmdir( char[] name ) - Remove directory
    • char[] getcwd() - Get current directory
    • char[][] listdir( char[] pathname ) - Return contents of directory

  • std.gc - Controls the Garbage Collector
    • void addRoot( void* p ) - Add p to list of roots
    • void removeRoot( void* p ) - Remove p from list of roots
    • void addRange( void* pbot, void* ptop ) - Add range to scan for roots
    • void removeRange( void* pbot ) - Remove range
    • void fullCollect() - Run a full garbage collection cycle
    • void genCollect() - Run a generational garbage collection cycle
    • void minimize() - Minimize physical memory usage
    • void disable() - Temporarilly disable garbage collection cycle
    • void enable() - Reenable garbage collection cycle

  • std.intrinsic - Compiler built in intrinsic functions
    • int bsf( uint v ) - Scans froward looking for the 1st set bit
    • int bsr( uint v ) - Scans backwards looking for the 1st set bit
    • int bt( uint* p, uint index ) - Tests the bit
    • int btc( uint* p, uint index ) - Tests and complements the bit
    • int btr( uint* p, uint index ) - Tests and resets (sets to 0) the bit
    • int bts( uint* p, uint index ) - Tests and sets the bit
    • ubyte bswap( uint x ) - Swaps bytes in a 4 byte uint end-to-end
    • ubyte inp( uint port_address ) - Reads I/O port at port_address
    • ushort inpw( uint port_address ) - Reads I/O port at port_address
    • uint inpl(uint port_address) - Reads I/O port at port_address
    • ubyte outp( uint port_address, ubyte value ) - Writes & returns value to I/O port at port_address
    • ushort outpw( uint port_address, ushort value ) - Writes & returns value to I/O port at port_address
    • uint outpl( uint port_address, uint value ) - Writes & returns value to I/O port at port_address
    • real cos( real )
    • real fabs( real )
    • real rint( real )
    • long rndtol( real )
    • real sin( real )
    • real sqrt( real )

  • std.math - Includes all the usual math functions like sin, cos, atan, etc
    • real acos( real )
    • real asin( real )
    • real atan( real )
    • real atan2( real, real )
    • real cos( real x ) - Compute cosine of x in radians
    • real sin( real x ) - Compute sine of x in radians
    • real tan( real x ) - Compute tangent of x in radians
    • real cosh( real )
    • real sinh( real )
    • real tanh( real )
    • real exp( real )
    • real frexp( real value, out int exp ) - Calculate and return x and exp
    • real ldexp( real n, int exp ) - Compute n * 2exp
    • real log10( real x ) - Calculate the base-10 logarithm of x
    • real modf( real, real* )
    • real pow( real, real )
    • real sqrt( real x ) - Compute square root of x
    • creal sqrt(creal x) - Compute square root of x
    • real ceil( real )
    • real floor( real )
    • real log1p( real x ) - Calcs the natural logarithm of 1 + x
    • real expm1( real x ) - Calcs the value of the natural log base (e) raised to the power of x, minus 1
    • real atof( char* )
    • real hypot( real x, real y ) - Cals the length of the hypotenuse of a right-angled triangle
    • int isnan( real e ) - Is number a nan?
    • int isfinite( real e ) - Is number finite?
    • int isnormal( float f )
    • int isnormal( double d )
    • int isnormal( real e ) - Is number normalized?
    • int issubnormal( float f )
    • int issubnormal( double d )
    • int issubnormal( real e ) - Is number subnormal?
    • int isinf( real e ) - Is number infinity?
    • int signbit( real e ) - Get sign bit
    • real copysign( real to, real from ) - Copy sign

  • std.math2 - Includes all the usual math functions like abs, sqr, feq, etc
    • bit feq( real, real ) - compare floats with given precision
    • bit feq( real, real, real ) - compare floats with given precision
    • int abs( int ) - Modulus
    • long abs( long ) - Modulus
    • real abs( real ) - Modulus
    • int sqr( int ) - Square
    • long sqr( long ) - Square
    • real sqr( real ) - Square
    • real trunc( real ) - Returns the integer part
    • real frac( real ) - Returns the fractional part
    • real poly( real, real[] ) - Polynomial of X
    • int sign( int ) - 0=0, +n=+1, -n=-1
    • int sign( long ) - 0=0, +n=+1, -n=-1
    • int sign( real ) - 0=0, +n=+1, -n=-1
    • real cycle2deg( real ) - Cycles to Degrees conversion
    • real cycle2rad( real ) - Cycles to Radians conversion
    • real cycle2grad( real ) - Cycles to Grads conversion
    • real deg2cycle( real ) - Degrees to Cycles conversion
    • real deg2rad( real ) - Degrees to Radians conversion
    • real deg2grad( real ) - Degrees to Grads conversion
    • real rad2deg( real ) - Radians to Degrees conversion
    • real rad2cycle( real ) - Radians to Cycles conversion
    • real rad2grad( real ) - Radians to Grads conversion
    • real grad2deg( real ) - Grads to Degrees conversion
    • real grad2cycle( real ) - Grads to Cycles conversion
    • real grad2rad( real ) - Grads to Radians conversion
    • real avg( real[] ) - Arithmetic average of values
    • int sum( int[] ) - Sum of values
    • long sum( long[] ) - Sum of values
    • real sum( real[] ) - Sum of values
    • int min( int[] ) - The smallest value
    • int min( long[] ) - The smallest value
    • int min( real[] ) - The smallest value
    • int min( int, int ) - The smallest value
    • int min( long, long ) - The smallest value
    • int min( real, real ) - The smallest value
    • int max( int[] ) - The largest value
    • int max( long[] ) - The largest value
    • int max( real[] ) - The largest value
    • int max( int, int ) - The largest value
    • int max( long, long ) - The largest value
    • int max( real, real ) - The largest value
    • real acot( real ) - Arccotangent
    • real asec( real ) - Arcsecant
    • real acosec( real ) - Arccosecant
    • real cot( real ) - Cotangent
    • real sec( real ) - Secant
    • real cosec( real ) - Cosecant
    • real coth( real ) - Hyperbolic cotangent
    • real sech( real ) - Hyperbolic secant
    • real cosech( real ) - Hyperbolic cosecant
    • real acosh( real ) - Hyperbolic arccosine
    • real asinh( real ) - Hyperbolic arcsine
    • real atanh( real ) - Hyperbolic arctangent
    • real acoth( real ) - Hyperbolic arccotangent
    • real asech( real ) - Hyperbolic arcsecant
    • real acosech( real ) - Hyperbolic arccosecant
    • real atof( char[] ) - Convert string to float
    • char[] toString( real ) - Convert float to string

  • std.md5 -Compute MD5 digests
    • void sum( ubyte[16] digest, void[] data ) - Compute MD5 digest from data
    • void printDigest( ubyte[16] digest ) - Print MD5 digest to standard output
    • struct MD5_CTX void start() - Begins an MD5 message-digest operation
    • struct MD5_CTX void update( void[] input )
    • struct MD5_CTX void finish(ubyte[16] digest)

  • std.mmfile - Memory mapped files
    • -= class MmFile members =-
    • this( char[] filename )
    • this( char[] filename, Mode mode, size_t size, void* address )
    • ~this()
    • void flush()
    • size_t length()
    • void[] opSlice()
    • void[] opSlice( size_t i1, size_t i2 )
    • ubyte opIndex( size_t i )
    • ubyte opIndex( size_t i, ubyte value )

  • object - The root class of the inheritance hierarchy
    • -= class Object members =-
    • static int printf( char* format, ... ); - C printf function
    • char[] toString() - Convert Object to a human readable string
    • uint toHash() - Compute hash function for Object
    • int cmp( Object obj ) - Compare with another Object obj
    • class ClassInfo - Runtime type information about a class
    • class Exception - All exceptions

  • std.outbuffer - Assemble data into an array of bytes
    • -= class OutBuffer members =-
    • void reserve( uint nbytes ) - Append data to the internal buffer
    • void write( ubyte[] bytes ) - Append data to the internal buffer
    • void write( ubyte b ) - Append data to the internal buffer
    • void write( byte b ) - Append data to the internal buffer
    • void write( char c ) - Append data to the internal buffer
    • void write( ushort w ) - Append data to the internal buffer
    • void write( short s ) - Append data to the internal buffer
    • void write( wchar c ) - Append data to the internal buffer
    • void write( uint w ) - Append data to the internal buffer
    • void write( int i ) - Append data to the internal buffer
    • void write( ulong l ) - Append data to the internal buffer
    • void write( long l ) - Append data to the internal buffer
    • void write( float f ) - Append data to the internal buffer
    • void write( double f ) - Append data to the internal buffer
    • void write( real f ) - Append data to the internal buffer
    • void write( char[] s ) - Append data to the internal buffer
    • void write( OutBuffer buf ) - Append data to the internal buffer
    • void fill0( uint nbytes ) - Append nbytes of 0 to the internal buffer
    • void alignSize( uint alignsize ) - 0-fill to align on an alignsize boundary
    • void align2() - Optimize common special case alignSize(2)
    • void align4() - Optimize common special case alignSize(4)
    • ubyte[] toBytes() - Convert internal buffer to array of bytes
    • char[] toString() - Convert internal buffer to array of chars
    • void vprintf( char[] format, va_list args ) - Append output of vprintf() to internal buffer
    • void printf( char[] format, ... ) - Append output of printf() to internal buffer
    • void spread( uint index, uint nbytes ) - At offset index into buffer

  • std.path - Manipulate file names, path names, etc
    • const char[] sep; - Character used to separate directory names in a path
    • const char[] altsep; - Alternate version of sep[], used in Windows
    • const char[] pathsep; - Path separator string
    • const char[] line sep; - String used to separate lines
    • const char[] curdir; - String representing the current directory
    • const char[] pardir; - String representing the parent directory
    • char[] getExt( char[] fullname) - Get extension
    • char[] getBaseName( char[] fullname ) - Get base name
    • char[] getDirName( char[] fullname ) - Get directory name
    • char[] getDrive( char[] fullname ) - Get drive
    • char[] defaultExt( char[] fullname, char[] ext ) - Put a default ext on fullname if it doesn't already have an ext
    • char[] addExt( char[] fullname, char[] ext ) - Add file extension or replace existing extension
    • int isabs( char[] path ) - Determine if absolute path name
    • char[] join( char[] p1, char[] p2 ) - Join two path components
    • int fncharmatch( dchar c1, dchar c2 ) - Match file name characters
    • int fnmatch( char[] name, char[] pattern ) - Match filename strings with pattern[], using the following wildcards

  • std.process - Creates and Destroys threads
    • int system( char[] command ) - Execute command in a command shell

  • std.random - Random number generation
    • void rand_seed( uint seed, uint index ) - The random number generator is seeded
    • uint rand() - Get next random number in sequence

  • std.regexp - The usual regular expression functions
    • -= class RegExp members =-
    • this( char[] pattern, char[] attributes ) - Create a new RegExp object
    • char[][] split( char[] string ) - Split string[] into an array of strings
    • int search( char[] string ) - Search string[] for match with regular expression
    • char[][] match( char[] string ) - Search string[] for match
    • char[][] exec( char[] string ) - Search string[] for next match
    • int test( char[] string ) - Search string[] for next match
    • char[] replace( char[] string, char[] format ) - Find regular expression matches in string[]
    • char[] replace( char[] format ) - After a match is found with test()
    • char[] replaceOld( char[] format ) - Like replace(char[] format), but uses old style formatting

  • std.socket - Sockets
    • -= class InternetAddress members =-
    • this( uint addr, ushort port ) - Construct a new Address
    • this( ushort port ) - Construct a new Address
    • this( char[] addr, ushort port ) - addr may be an IPv4 address string
    • AddressFamily addressFamily() - Overridden to return AddressFamily.INET
    • ushort port() - Returns the IPv4 port number
    • uint addr() - Returns the IPv4 address number
    • char[] toAddrString() - string in the IPv4 address dotted-decimal form
    • char[] toPortString() - string in the IPv4 port
    • char[] toString() - string in the IPv4 address and port (form a.b.c.d:e)
    • static uint parse( char[] addr ) - Parse an IPv4 addr string a.b.c.d and return the number


    • -= class InternetHost members =-
    • char[] name
    • char[][] aliases
    • uint[] addrList
    • bit getHostByName( char[] name ) - Resolve host name
    • bit getHostByAddr( uint addr ) - Resolve IPv4 address number
    • bit getHostByAddr( char[] addr ) - Resolve Pv4 address a.b.c.d


    • -= class Socket members =-
    • this( AddressFamily af, SocketType type, ProtocolType protocol ) - Create a blocking socket
    • this( AddressFamily af, SocketType type ) - Create a blocking socket
    • AddressFamily addressFamily() - Get the socket's address family
    • void bind( Address addr ) - Associate a local address with this socket
    • void connect( Address to ) - Establish a connection
    • void listen( int backlog ) - Listen for an incoming connection
    • Socket accept() - Accept an incoming connection
    • void shutdown( SocketShutdown how ) - Disables sends and/or receives
    • void close() - Immediately drop any connections and release resources
    • Address remoteAddress() - Remote endpoint Address
    • Address localAddress() - Local endpoint Address
    • int send( void[] buf, SocketFlags flags ) - Send data on the connection
    • int send( void[] buf ) - Send data on the connection
    • int sendTo( void[] buf, SocketFlags flags, Address to ) - Send data to a specific dest Addr
    • int sendTo( void[] buf, Address to ) - Send data to a specific dest Addr
    • int sendTo( void[] buf, SocketFlags flags ) - Send data to a specific dest Addr
    • int sendTo( void[] buf ) - Send data to a specific dest Addr
    • int receive( void[] buf, SocketFlags flags ) - Receive data on the connection
    • int receive( void[] buf ) - Receive data on the connection
    • int receiveFrom( void[] buf, SocketFlags flags, out Address from ) - Receive data & get the remote endpoint Addr
    • int receiveFrom( void[] buf, out Address from ) - Receive data & get the remote endpoint Addr
    • int receiveFrom( void[] buf, SocketFlags flags ) - Receive data & get the remote endpoint Addr
    • int receiveFrom( void[] buf ) - Receive data & get the remote endpoint Addr
    • int getOption( SocketOptionLevel level, SocketOption option, void[] result ) - Get a socket option
    • void setOption( SocketOptionLevel level, SocketOption option, int value )
    • static int select( SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, timeval* tv )
    • static int select( SocketSet checkRead, SocketSet checkWrite, SocketSet checkError, int microseconds )
    • static int select( SocketSet checkRead, SocketSet checkWrite, SocketSet checkError )


    • -= class TcpSocket : Socket members =-
    • this() - Constructs a blocking TCP Socket
    • this( InternetAddress connectTo ) - Constructs a blocking TCP Socket & connects to an InternetAddress


    • -= class UdpSocket : Socket members =-
    • this() - Constructs a blocking UDP Socket


    • -= class SocketSet members =-
    • this( uint max ) - Set the maximum amount of sockets that may be added
    • this() - Uses the default maximum for the system
    • void add( Socket s ) - Add a Socket to the collection
    • void remove( Socket s ) - Remove this Socket from the collection
    • int isSet( Socket s ) - Returns nonzero if this Socket is in the collection
    • void reset() - Reset the SocketSet to 0 Sockets in the collection

  • std.socketstream - Stream for a blocking, connected Socket
    • -= class SocketStream : std.stream.Stream members =-
    • this( Socket sock, std.stream.FileMode mode ) - specified Socket and FileMode flags
    • this( Socket sock ) - Uses mode FileMode.In | FileMode.Out
    • uint readBlock( void* buffer, uint size ) - Attempts to read the entire block, waiting if necessary
    • char[] readLine() - Read a line
    • wchar[] readLineW() - Read a line
    • uint writeBlock( void* buffer, uint size ) - Attempts to write the entire block, waiting if necessary
    • bit eof() - Returns true if a remote disconnection has been detected
    • char[] toString()
    • void close() - Close the Socket

  • std.stdint - Integral types for various purposes


  • std.stream
    • -= class Stream members =-
    • uint readBlock( void* buffer, uint size ) - Read up to size bytes into the buffer
    • void readExact( void* buffer, uint size ) - Read exactly size bytes into the buffer
    • uint read( ubyte[] buffer ) - Read a block of data big enough to fill the given array
    • void read( out byte x ) - Read a basic type or counted string
    • void read( out ubyte x ) - Read a basic type or counted string
    • void read( out short x ) - Read a basic type or counted string
    • void read( out ushort x ) - Read a basic type or counted string
    • void read( out int x ) - Read a basic type or counted string
    • void read( out uint x ) - Read a basic type or counted string
    • void read( out long x ) - Read a basic type or counted string
    • void read( out ulong x ) - Read a basic type or counted string
    • void read( out float x ) - Read a basic type or counted string
    • void read( out double x ) - Read a basic type or counted string
    • void read( out real x ) - Read a basic type or counted string
    • void read( out ireal x ) - Read a basic type or counted string
    • void read( out creal x ) - Read a basic type or counted string
    • void read( out char x ) - Read a basic type or counted string
    • void read( out wchar x ) - Read a basic type or counted string
    • void read( out char[] s ) - Read a basic type or counted string
    • void read( out wchar[] s ) - Read a basic type or counted string
    • char[] readLine() - Read a line that is terminated
    • wchar[] readLineW() - Read a line that is terminated
    • char[] readString( uint length ) - Read a string of the given length
    • char getc() - Read and return the next character in the stream
    • wchar getcw() - Read and return the next character in the stream
    • char ungetc( char c ) - Push a character back onto the stream
    • wchar ungetcw( wchar c ) - Push a character back onto the stream
    • int scanf( char[] fmt, ... ) - Scan a string from the input
    • int vscanf( char[] fmt, va_list args ) - Scan a string from the input
    • uint writeBlock( void* buffer, uint size ) - Write up to size bytes from buffer in the stream
    • void writeExact( void* buffer, uint size ) - Write exactly size bytes from buffer
    • uint write( ubyte[] buffer ) - Write as much of the buffer as possible
    • void write( byte x ) - Write a basic type or counted string
    • void write( ubyte x ) - Write a basic type or counted string
    • void write( short x ) - Write a basic type or counted string
    • void write( ushort x ) - Write a basic type or counted string
    • void write( int x ) - Write a basic type or counted string
    • void write( uint x ) - Write a basic type or counted string
    • void write( long x ) - Write a basic type or counted string
    • void write( ulong x ) - Write a basic type or counted string
    • void write( float x ) - Write a basic type or counted string
    • void write( double x ) - Write a basic type or counted string
    • void write( real x ) - Write a basic type or counted string
    • void write( ireal x ) - Write a basic type or counted string
    • void write( creal x ) - Write a basic type or counted string
    • void write( char x ) - Write a basic type or counted string
    • void write( wchar x ) - Write a basic type or counted string
    • void write( char[] s ) - Write a basic type or counted string
    • void write( wchar[] s ) - Write a basic type or counted string
    • void writeLine( char[] s ) - Write a line of text
    • void writeLineW( wchar[] s ) - Write a line of text
    • void writeString( char[] s ) - Write a string of text
    • void writeStringW( wchar[] s ) - Write a string of text
    • uint printf( char[] format, ... ) - Print a formatted string into the stream
    • uint vprintf( char[] format, va_list args ) - Print a formatted string into the stream
    • void copyFrom( Stream s ) - Copies all data from s into this stream
    • void copyFrom( Stream s, uint count ) - Copy a specified number of bytes from the given stream
    • ulong seek( long offset, SeekPos whence ) - Change the current position of the stream
    • ulong seekSet( long offset ) - Aliases for their normal seek counterparts
    • ulong seekCur( long offset ) - Aliases for their normal seek counterparts
    • ulong seekEnd( long offset ) - Aliases for their normal seek counterparts
    • ulong position() - Retrieve or set the file position
    • void position( ulong pos ) - Retrieve or set the file position
    • ulong size() - Retrieve the size of the stream in bytes
    • bit eof()
    • char[] toString() - Read the entire stream and return it as a string
    • uint toHash() - Get a hash of the stream by reading each byte


    • -= class File : Stream members =-
    • this()
    • this( char[] filename )
    • this( char[] filename, FileMode mode )
    • void open( char[] filename ) - Open a file for the stream
    • void open( char[] filename, FileMode mode ) - Open a file for the stream
    • void create( char[] filename ) - Create a file for the stream
    • void create( char[] filename, FileMode mode ) - Create a file for the stream
    • void close() - Close the current file if it is open
    • uint readBlock( void* buffer, uint size ) - Overrides of the Stream methods
    • uint writeBlock( void* buffer, uint size ) - Overrides of the Stream methods
    • ulong seek( long offset, SeekPos rel ) - Overrides of the Stream methods


    • -= class MemoryStream : Stream members =-
    • this() - Create an output buffer / setup for reading, writing, and seeking
    • this( ubyte[] data ) - Create an output buffer / setup for reading, writing, and seeking
    • ubyte[] data() - Get the current memory data in total
    • uint readBlock( void* buffer, uint size ) - Overrides of Stream methods
    • uint writeBlock( void* buffer, uint size ) - Overrides of Stream methods
    • ulong seek( long offset, SeekPos rel ) - Overrides of Stream methods
    • char[] toString() - Overrides of Stream methods


    • -= class SliceStream : Stream members =-
    • this( Stream base, int low )
    • this( Stream base, int low, int high )
    • uint readBlock( void* buffer, uint size ) - Overrides of Stream methods
    • uint writeBlock( void* buffer, uint size ) - Overrides of Stream methods
    • ulong seek( long offset, SeekPos rel ) - Overrides of Stream methods

  • std.string - Basic string operations not covered by array ops
    • long atoi(char[] s) - Convert string to integer
    • real atof(char[] s) - Convert string to real
    • int cmp( char[] s1, char[] s2 ) - Compare two strings
    • int icmp( char[] s1, char[] s2 ) - Case insensitive compare
    • char* toStringz( char[] string ) - Converts a D string to a C-style 0 terminated string
    • int find( char[] s, dchar c ) - Find first occurrance of c in string s
    • int rfind(char[] s, dchar c) - Find last occurrance of c in string s
    • int find( char[] s, char[] sub ) - Find first occurrance of sub[] in string s[]
    • int rfind( char[] s, char[] sub ) - Find last occurrance of sub in string s
    • int ifind(char[] s, dchar c) - Find first occurrance of c in string s (case insensitive)
    • int irfind(char[] s, dchar c) - Find last occurrance of c in string s (case insensitive)
    • int ifind(char[] s, char[] sub) - Find first occurrance of sub[] in string s[] (case insensitive)
    • int irfind(char[] s, char[] sub) - Find last occurrance of sub in string s (case insensitive)
    • char[] tolower( char[] s ) - Convert string to lower case
    • char[] toupper( char[] s ) - Convert string to upper case
    • char[] capitalize( char[] s ) - Capitalize first character of string
    • char[] capwords( char[] s ) - Capitalize all words in string
    • char[] join( char[][] words, char[] sep ) - Concatenate all the strings together into one string
    • char[][] split( char[] s ) - Split s[] into an array of words, using whitespace
    • char[][] split( char[] s, char[] delim ) - Split s[] into an array of words, using delim[]
    • char[][] splitlines( char[] s ) - Split s[] into an array of lines, using CR, LF, or CR-LF
    • char[] stripl( char[] s ) - Strips leading whitespace
    • char[] stripr( char[] s ) - Strips trailing whitespace
    • char[] strip( char[] s ) - Strips leading and trailing whitespace
    • char[] ljustify( char[] s, int width ) - Left justify
    • char[] rjustify( char[] s, int width ) - Right justify
    • char[] center( char[] s, int width ) - Center string in field width chars wide
    • char[] zfill( char[] s, int width ) - Same as rjustify(), but fill with '0's
    • char[] replace( char[] s, char[] from, char[] to ) - Replace occurrences of from[] with to[] in s[]
    • char[] replaceSlice( char[] string, char[] slice, char[] replacement )
    • char[] insert( char[] s, int index, char[] sub ) - Insert sub[] into s[] at location index
    • int count( char[] s, char[] sub ) - Count up all instances of sub[] in s[]
    • char[] expandtabs( char[] s, int tabsize ) - Replace tabs with the appropriate number of spaces
    • char[] maketrans( char[] from, char[] to ) - Construct translation table for translate()
    • char[] translate( char[] s, char[] transtab, char[] delchars ) - Translate characters in s[] using table created by maketrans()
    • char[] toString( uint u ) - Convert uint to string
    • char[] toString( char* s ) - Convert C-style 0 terminated string to D string
    • char[] format( ... ) -Format arguments into a string.
    • char[] sformat( char[], ... ) -Format arguments into string s which must be large enough to hold the result. Throws ArrayBoundsError if it is not. Returns s.

  • std.system - Inquire about the CPU, operating system


  • std.thread - One per thread. Operations to do on a thread
    • this() - Create a Thread that overrides main()
    • this( int (*fp)(void*), void* arg ) - Create a Thread that overrides run()
    • this( int delegate() dg ) - Create a Thread that overrides run()
    • thread_hdl hdl; - The handle to this thread assigned by the operating system
    • void start() - Create a new thread and start it running
    • int run(void* p) - Entry point for a thread
    • void wait() - Wait for this thread to terminate
    • void wait( unsigned milliseconds ) - Wait for this thread to terminate or until milliseconds time has elapsed
    • TS getState() - Returns the state of the thread
    • void setPriority( PRIORITY* p ) - Adjust the priority of this thread
    • static Thread getThis() - Returns a reference to the Thread
    • static Thread[] getAll() - Returns an array of all the threads currently running
    • void pause() - Suspend execution of this thread
    • void resume() - Resume execution of this thread
    • static void pauseAll() - Suspend execution of all threads but this thread
    • static void resumeAll() - Resume execution of all paused threads
    • static void yield() - Give up the remainder of this thread's time slice

  • std.uri - Encode and decode Uniform Resource Identifiers (URIs)
    • char[] decode( char[] encodedURI ) - Decodes the URI into a UTF-8 string and returns it
    • char[] decodeComponent( char[] encodedURIComponent ) - Decodes the URI into a UTF-8 string and returns it
    • char[] encode( char[] uri ) - Encodes the UTF-8 string uri into a URI and returns that URI
    • char[] encodeComponent( char[] uriComponent ) - Encodes the UTF-8 string uri into a URI and returns that URI

  • std.utf - Encode and decode utf character encodings
    • bit isValidDchar( dchar c ) - Test if c is a valid UTF-32 character
    • dchar decode( char[] s, inout uint idx ) - Decodes and returns character starting at s[idx]
    • dchar decode( wchar[] s, inout uint idx ) - Decodes and returns character starting at s[idx]
    • dchar decode( dchar[] s, inout uint idx ) - Decodes and returns character starting at s[idx]
    • void encode( inout char[] s, dchar c ) - Encodes character c and appends it to array s
    • void encode( inout wchar[] s, dchar c ) - Encodes character c and appends it to array s
    • void encode( inout dchar[] s, dchar c ) - Encodes character c and appends it to array s
    • void validate( char[] s ) - Checks to see if string is well formed or not
    • void validate( wchar[] s ) - Checks to see if string is well formed or not
    • void validate( dchar[] s ) - Checks to see if string is well formed or not
    • char[] toUTF8( char[] s ) - Encodes string s into UTF-8 and returns the encoded string
    • char[] toUTF8( wchar[] s ) - Encodes string s into UTF-8 and returns the encoded string
    • char[] toUTF8( dchar[] s ) - Encodes string s into UTF-8 and returns the encoded string
    • wchar[] toUTF16( char[] s ) - Encodes string s into UTF-16 and returns the encoded string
    • wchar* toUTF16z( char[] s ) - Encodes string s into UTF-16 and returns the encoded string
    • wchar[] toUTF16( wchar[] s ) - Encodes string s into UTF-16 and returns the encoded string
    • wchar[] toUTF16( dchar[] s ) - Encodes string s into UTF-16 and returns the encoded string
    • dchar[] toUTF32( char[] s ) - Encodes string s into UTF-32 and returns the encoded string
    • dchar[] toUTF32( wchar[] s ) - Encodes string s into UTF-32 and returns the encoded string
    • dchar[] toUTF32( dchar[] s ) - Encodes string s into UTF-32 and returns the encoded string

  • std.zip - Read and Write zip archives
    • -= class ZipArchive members =-
    • this() - Constructor used when creating a new archive
    • void addMember( ArchiveMember de ) - Add de to the archive
    • void deleteMember( ArchiveMember de ) - Delete de from the archive
    • void[] build() - Construct an archive out of the current members of the archive
    • this( void[] data ) - Constructor used when reading an existing archive
    • ubyte[] expand( ArchiveMember de ) - Decompress the contents of archive member de and return the expanded data
    • ubyte[] data - Read Only: array representing the entire contents of the archive
    • uint diskNumber - Read Only: 0 since multi-disk zip archives are not supported
    • uint diskStartDir - Read Only: 0 since multi-disk zip archives are not supported
    • uint numEntries - Read Only: number of ArchiveMembers in the directory
    • uint totalEntries - Read Only: same as totalEntries
    • char[] comment - Read/Write: the archive comment. (less than 65536 bytes)


    • -= class ArchiveMember members =-
    • ushort madeVersion - Read Only
    • ushort extractVersion - Read Only
    • ushort flags - Read/Write: normally set to 0
    • ushort compressionMethod - Read/Write: the only supported values are 0 (no compression) and 8 (deflate)
    • date.DosFileTime time - Read/Write: Last modified time of the member
    • uint crc32 - Read Only: cyclic redundancy check (CRC) value
    • uint compressedSize - Read Only: size of data of member in compressed form
    • uint expandedSize - Read Only: size of data of member in expanded form
    • ushort diskNumber - Read Only: should be 0
    • ushort internalAttributes - Read/Write
    • uint externalAttributes - Read/Write
    • char[] name - Read/Write: Usually the file name of the archive member
    • ubyte[] extra - Read/Write: extra data for this member
    • char[] comment - Read/Write: comment associated with this member
    • ubyte[] compressedData - Read Only: data of member in compressed form
    • ubyte[] expandedData - Read/Write: data of member in uncompressed form

  • std.zlib - Compression and Decompression of data
    • uint adler32( uint adler, void[] buf ) - Compute the Adler32 checksum of the data in buf[]
    • uint crc32( uint crc, void[] buf ) - Compute the CRC32 checksum of the data in buf[]
    • void[] compress( void[] buf ) - Compresses the data in buf[] using compression level level
    • void[] compress(void[] buf, int level ) - Compresses the data in buf[] using compression level level
    • void[] uncompress( void[] buf ) - Decompresses the data in buf[]
    • void[] uncompress( void[] buf, uint destbufsize ) - Decompresses the data in buf[]


    • -= class Compress members =-
    • this() - Construct
    • this( int level ) - Construct
    • void[] compress( void[] buf ) - Compress the data in buf and return the compressed data
    • void[] flush() - Compress and return any remaining data
    • void[] flush( int mode ) - Compress and return any remaining data


    • -= class UnCompress members =-
    • this()
    • this( uint destbufsize ) - Construct. destbufsize
    • void[] uncompress( void[] buf ) - Decompress the data in buf and return the decompressed data
    • void[] flush() - Decompress and return any remaining data

  • std.c.stdio - Interface to C stdio functions like printf()
    • int printf( char* format, ... ) - C printf() function

  • std.c.windows.windows - Interface to Windows APIs

  • std.c.linux - Interface to Linux APIs

Mars: fourth Rock from the Sun.