diff -uNr dmd-0.113/dmd/html/d/changelog.html dmd-0.114/dmd/html/d/changelog.html --- dmd-0.113/dmd/html/d/changelog.html 2005-02-13 10:34:24.000000000 +0100 +++ dmd-0.114/dmd/html/d/changelog.html 2005-02-27 20:10:42.000000000 +0100 @@ -24,6 +24,7 @@
+

+ What's New for + D 0.114 +

+ +Feb 27, 2005 +

+ +

New/Changed Features

+ + +

Bugs Fixed

+ + +

What's New for D 0.113 @@ -105,10 +164,10 @@

New/Changed Features

Bugs Fixed

diff -uNr dmd-0.113/dmd/html/d/dcompiler.html dmd-0.114/dmd/html/d/dcompiler.html --- dmd-0.113/dmd/html/d/dcompiler.html 2004-09-01 10:17:12.000000000 +0200 +++ dmd-0.114/dmd/html/d/dcompiler.html 2005-02-13 11:58:00.000000000 +0100 @@ -14,7 +14,7 @@ [Home] [Search] [D] -
Last update Feb 5, 2004 +
Last update Feb 13, 2005

Compiler for D Programming Language

@@ -139,7 +139,7 @@
-g
add symbolic debug info
-gt
-
add trace profiling hooks +
add hooks for profiling
-inline
inline expand functions
-Ipath @@ -162,9 +162,10 @@ off when generating an object file name. -op will leave it on.
-release
-
compile release version +
compile release version, which means not generating + code for contracts and asserts
-unittest
-
compile in unittest code +
compile in unittest code, also turns on asserts
-v
verbose
-version=level
diff -uNr dmd-0.113/dmd/html/d/phobos.html dmd-0.114/dmd/html/d/phobos.html --- dmd-0.113/dmd/html/d/phobos.html 2005-02-07 18:11:12.000000000 +0100 +++ dmd-0.114/dmd/html/d/phobos.html 2005-02-26 10:37:56.000000000 +0100 @@ -18,7 +18,7 @@ [Search] [D] -
Last update Feb 7, 2005 +
Last update Feb 20, 2005

Phobos

D Runtime Library

@@ -199,10 +199,10 @@
Recursively search file system and (currently Windows only) FTP sites. -
std.regexp +
std.regexp
The usual regular expression functions. -
std.socket +
std.socket
Sockets.
std.socketstream @@ -217,7 +217,7 @@
std.stream
Stream I/O. -
std.string +
std.string
Basic string operations not covered by array ops.
std.system @@ -1516,635 +1516,6 @@
-

std.regexp

- -RegExp is a D class to handle regular expressions. -Regular expressions -are a powerful method of string pattern matching. The RegExp class is -the core foundation for adding powerful string pattern matching capabilities -to programs like grep, text editors, awk, sed, etc. The regular expression -language used is the same as that commonly used, however, some of the very -advanced forms may behave slightly differently. -

- -The RegExp class has these methods: - -

-
this(char[] pattern, char[] attributes) -
Create a new RegExp object. Compile pattern[] - with attributes[] into - an internal form for fast execution. - Throws a RegExpError if there are any compilation errors. -

- -

char[][] split(char[] string) -
Split string[] into an array of strings, - using the regular expression as the separator. - Returns array of slices in string[]. -

- -

int search(char[] string) -
Search string[] for match with regular expression. - - - - - -
Returns - Description -
>=0 - index of match -
-1 - no match -
-

- -

char[][] match(char[] string) -
Search string[] for match. - - - - - -
Attribute - Returns -
global - same as call to exec(string) -
not global - array of all matches -
-

- -

char[][] exec(char[] string) -
Search string[] for next match. - Returns array of slices into string[] representing matches. -

- -

int test(char[] string) -
Search string[] for next match. - - - - - -
Returns - Description -
0 - no match -
!=0 - match -
-

- - -

char[] replace(char[] string, char[] format) -
Find regular expression matches in string[]. - Replace those matches - with a new string composed of format[] - merged with the result of the matches. - - - - - -
Attribute - Action -
global - replace all matches -
not global - replace first match -
- Returns the new string. -

- -

char[] replace(char[] format) -
After a match is found with test(), this function - will take the match results and, using the format[] - string, generate and return a new string. - The format commands are: - - - - - - - - - - - - - - - - - - - - - - - - -
Format - Description -
$$ - insert $ -
$& - insert the matched substring -
$` - insert the string that precedes the match -
$' - insert the string that following the match -
$n - replace with the nth parenthesized match, - n is 1..9 -
$nn - replace with the nnth parenthesized match, - nn is 01..99 -
$ - insert $ -
-

- -

char[] replaceOld(char[] format) -
Like replace(char[] format), but uses old style formatting: - - - - - - - - -
Format - Description -
& - replace with the match -
\n - replace with the nth parenthesized match, n is 1..9 -
\c - replace with char c. -
-

- - - -

- -
-

std.socket

- -
- -
enum AddressFamily -
The communication domain used to resolve an address: -

-

-
UNIX -
local communication -
INET -
internet protocol version 4 -
IPX -
novell IPX -
APPLETALK -
appletalk -
-

- -

enum SocketType -
Communication semantics: -

-

-
STREAM -
sequenced, reliable, two-way communication-based byte streams -
DGRAM -
connectionless, unreliable datagrams with a fixed maximum length; - data may be lost or arrive out of order -
RAW -
raw protocol access -
RDM -
reliably-delivered message datagrams -
SEQPACKET -
sequenced, reliable, two-way connection-based datagrams with a fixed - maximum length -
-

- -

enum ProtocolType -
Protocol: -

-

-
IP -
internet protocol -
ICMP -
internet control message protocol -
IGMP -
internet group management protocol -
GGP -
gateway to gateway protocol -
TCP -
transmission control protocol -
PUP -
PARC universal packet protocol -
UDP -
user datagram protocol -
IDP -
Xerox NS protocol -
-

- -


-
class AddressException : Exception -
Base exception thrown from an Address. -

- -

abstract class Address -
Address is an abstract class for representing a network addresses. -

-

-
AddressFamily addressFamily() -
Family of this address. -

- -

char[] toString() -
Human readable string representing this address. -
-

- -

class InternetAddress : Address -
InternetAddress is a class that represents an IPv4 (internet protocol - version 4) address and port. -

-

-
const uint ADDR_ANY -
Any IPv4 address number. -
const uint ADDR_NONE -
An invalid IPv4 address number. -
const ushort PORT_ANY -
Any IPv4 port number. -

- -

this(uint addr, ushort port) -
this(ushort port) -
Construct a new Address. addr may be ADDR_ANY (default) and port - may be PORT_ANY, and the actual numbers may not be known - until a connection is made. -
this(char[] addr, ushort port) -
addr may be an IPv4 address string in the dotted-decimal form - a.b.c.d, or a host name that will be resolved using an - InternetHost object. port may be PORT_ANY as stated above. -

- -

AddressFamily addressFamily() -
Overridden to return AddressFamily.INET. -
ushort port() -
Returns the IPv4 port number. -
uint addr() -
Returns the IPv4 address number. -

- -

char[] toAddrString() -
Human readable string representing the IPv4 address in - dotted-decimal form. -
char[] toPortString() -
Human readable string representing the IPv4 port. -
char[] toString() -
Human readable string representing the IPv4 address and port - in the form a.b.c.d:e. -

- -

static uint parse(char[] addr) -
Parse an IPv4 address string in the dotted-decimal form - a.b.c.d and return the number. If the string is not - a legitimate IPv4 address, ADDR_NONE is returned. -
-

- -


-
class HostException : Exception -
Base exception thrown from an InternetHost. -

- -

class InternetHost -
InternetHost is a class for resolving IPv4 addresses. -

-

-
char[] name -
char[][] aliases -
uint[] addrList -
These members are populated when one of the following - functions are called without failure: -

- -

bit getHostByName(char[] name) -
Resolve host name. Returns false if unable to resolve. -
bit getHostByAddr(uint addr) -
Resolve IPv4 address number. Returns false if unable to resolve. -
bit getHostByAddr(char[] addr) -
Same as previous, but addr is an IPv4 address string in the - dotted-decimal form a.b.c.d. Returns false if unable to resolve. -

-

-

- -


-
enum SocketShutdown -
How a socket is shutdown: -

-

-
RECEIVE -
socket receives are disallowed -
SEND -
socket sends are disallowed -
BOTH -
both RECEIVE and SEND -
-

- -

enum SocketFlags -
Flags may be OR'ed together: -

-

-
NONE -
no flags specified -
OOB -
out-of-band stream data -
PEEK -
peek at incoming data without removing it from the queue -
DONTROUTE -
data should not be subject to routing; - this flag may be ignored. -
-

- -

enum SocketOptionLevel -
The level at which a socket option is defined: -

-

-
SOCKET -
socket level -
IP -
internet protocol level -
TCP -
transmission control protocol level -
UDP -
user datagram protocol level -
-

- -

enum SocketOption -
Specifies a socket option: -

-

-
DEBUG -
record debugging information -
BROADCAST -
allow transmission of broadcast messages -
REUSEADDR -
allow local reuse of address -
LINGER -
linger on close if unsent data is present -
OOBINLINE -
receive out-of-band data in band -
SNDBUF -
send buffer size -
RCVBUF -
receive buffer size -
KEEPALIVE -
keep connection alive -
DONTROUTE -
do not route -
TCP_NODELAY -
disable the Nagle algorithm for send coalescing -
-

- - -

struct linger -
Linger information for use with SocketOption.LINGER. -

-

-
ushort on -
Nonzero for on. -
ushort time -
Linger time. -
-

- -

struct timeval -
Duration timeout value. -

-

-
int seconds -
Number of seconds. -
int microseconds -
Number of additional microseconds. -
-

- -

class SocketException : Exception -
Base exception thrown from a Socket. -

- -

class Socket -
Socket is a class that creates a network communication endpoint - using the Berkeley sockets interface. -

-

-
this(AddressFamily af, SocketType type, ProtocolType protocol) -
this(AddressFamily af, SocketType type) -
Create a blocking socket. If a single protocol type exists to support this socket type - within the address family, the ProtocolType may be omitted. -

- -

bit blocking -
Property to get or set whether the socket is blocking or nonblocking. -

- -

bit isAlive -
Property that indicates if this is a valid, alive 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. If the socket is blocking, connect waits for - the connection to be made. If the socket is nonblocking, connect returns - immediately and the connection attempt is still in progress. -

- -

void listen(int backlog) -
Listen for an incoming connection. bind must be called before you - can listen. The backlog is a request of how many pending incoming - connections are queued until accept'ed. -

- -

Socket accept() -
Accept an incoming connection. If the socket is blocking, accept - waits for a connection request. Throws SocketAcceptException if - unable to accept. -

- -

void shutdown(SocketShutdown how) -
Disables sends and/or receives. -

- -

void close() -
Immediately drop any connections and release socket resources. - Calling shutdown before close is recommended for - connection-oriented sockets. The Socket object is no longer - usable after close. -

- -

Address remoteAddress() -
Remote endpoint Address. -

- -

Address localAddress() -
Local endpoint Address. -

- -

const int ERROR -
Send or receive error code. -

- -

int send(void[] buf, SocketFlags flags) -
int send(void[] buf) -
Send data on the connection. Returns the number of bytes actually - sent, or ERROR on failure. If the socket is blocking and - there is no buffer space left, send waits. -

- -

int sendTo(void[] buf, SocketFlags flags, Address to) -
int sendTo(void[] buf, Address to) -
int sendTo(void[] buf, SocketFlags flags) -
int sendTo(void[] buf) -
Send data to a specific destination Address. - If the destination address is not specified, a connection must have - been made and that address is used. If the socket is blocking and - there is no buffer space left, sendTo waits. -

- -

int receive(void[] buf, SocketFlags flags) -
int receive(void[] buf) -
Receive data on the connection. Returns the number of bytes actually - received, 0 if the remote side has closed the connection, or ERROR - on failure. If the socket is blocking, receive waits until there - is data to be received. -

- -

int receiveFrom(void[] buf, SocketFlags flags, out Address from) -
int receiveFrom(void[] buf, out Address from) -
int receiveFrom(void[] buf, SocketFlags flags) -
int receiveFrom(void[] buf) -
Receive data and get the remote endpoint Address. Returns the number - of bytes actually received, 0 if the remote side has closed the connection, - or ERROR on failure. If the socket is blocking, receiveFrom - waits until there is data to be received. -

- -

int getOption(SocketOptionLevel level, SocketOption option, void[] result) -
Get a socket option. Returns the number of bytes written to result. -
int getOption(SocketOptionLevel level, SocketOption option, out int result) -
Same as previous, but for the common case of integer and boolean options. -

- -

void setOption(SocketOptionLevel level, SocketOption option, void[] value) -
Set a socket option. -
void setOption(SocketOptionLevel level, SocketOption option, int value) -
Same as previous, but for the common case of integer and boolean options. -

- -

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) -
Wait for a socket to change status. A wait timeout timeval or - int microseconds may be specified; if a timeout is not specified or the - timeval is null, the maximum timeout is used. The timeval timeout - has an unspecified value when select returns. Returns the number - of sockets with status changes, 0 on timeout, or -1 on interruption. - If the return value is greter than 0, the SocketSets are updated - to only contain the sockets having status changes. - For a connecting socket, a write status change means the connection - is established and it's able to send. For a listening socket, - a read status change means there is an incoming connection request and - it's able to accept. -

-

- -
class TcpSocket : Socket -
TcpSocket is a shortcut class for a TCP Socket. -

-

-
this() -
Constructs a blocking TCP Socket. -
this(InternetAddress connectTo) -
Constructs a blocking TCP Socket and connects to an InternetAddress. -

-

- -
class UdpSocket : Socket -
UdpSocket is a shortcut class for a UDP Socket. -

-

-
this() -
Constructs a blocking UDP Socket. -

-

- -

-
class SocketSet -
A collection of sockets for use with Socket.select. -

-

-
this(uint max) -
Set the maximum amount of sockets that may be added. -
this() -
Uses the default maximum for the system. -

- -

uint max -
Property to get the maximum amount of sockets that may be added - to this SocketSet. -

- -

void add(Socket s) -
Add a Socket to the collection. - Adding more than the maximum has dangerous side affects. -

- -

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 so that there are 0 Sockets - in the collection. -

-

- -
- -

Notes

- - For Win32 systems, link with ws2_32.lib. - -

Example

- - See /dmd/samples/d/listener.d. - -

std.socketstream

@@ -2838,241 +2209,6 @@

-

std.string

- -

To copy or not to copy?

- - When a function takes a string as a parameter, and returns a string, - is that string the same as the input string, modified in place, or - is it a modified copy of the input string? The D array convention is - "copy-on-write". This means that if no modifications are done, the - original string (or slices of it) can be returned. If any modifications - are done, the returned string is a copy. -

- -

- -
class StringException -
Thrown on errors in string functions. -

- -

const char[] hexdigits; -
"0123456789ABCDEF" -

- -

const char[] digits; -
"0123456789" -

- -

const char[] octdigits; -
"01234567" -

- -

const char[] lowercase; -
"abcdefghijklmnopqrstuvwxyz" -

- -

const char[] uppercase; -
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" -

- -

const char[] letters; -
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" -

- -

const char[] whitespace; -
" \t\v\r\n\f" -

- -

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. - Returns: -
-
<0 for (s1 < s2) -
=0 for (s1 == s2) -
>0 for (s1 > s2) -
-

- - -

int icmp(char[] s1, char[] s2) -
Same as cmp() but case insensitive. -

- -

char* toStringz(char[] string) -
Converts a D array of chars to a C-style 0 terminated string. -

- - -

int find(char[] s, dchar c) -
Find first occurrance of c in string s. - Return index in s where it is found. - Return -1 if not found. -

- -

int rfind(char[] s, dchar c) -
Find last occurrance of c in string s. - Return index in s where it is found. - Return -1 if not found. -

- -

int find(char[] s, char[] sub) -
Find first occurrance of sub[] in string s[]. - Return index in s[] where it is found. - Return -1 if not found. -

- -

int rfind(char[] s, char[] sub) -
Find last occurrance of sub in string s. - Return index in s where it is found. - Return -1 if not found. -

- -

int ifind(char[] s, dchar c) -
int irfind(char[] s, dchar c) -
int ifind(char[] s, char[] sub) -
int irfind(char[] s, char[] sub) -
Case insensitive versions. -

- -

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. - Remove leading and trailing whitespace. - Replace all sequences of whitespace with a single space. -

- -

char[] join(char[][] words, char[] sep) -
Concatenate all the strings together into one - string; use sep[] as the separator. -

- -

char[][] split(char[] s) -
Split s[] into an array of words, - using whitespace as the delimiter. -

- -

char[][] split(char[] s, char[] delim) -
Split s[] into an array of words, - using delim[] as the delimiter. -

- -

char[][] splitlines(char[] s) -
Split s[] into an array of lines, - using CR, LF, or CR-LF as the delimiter. -

- -

char[] stripl(char[] s) -
char[] stripr(char[] s) -
char[] strip(char[] s) -
Strips leading or trailing whitespace, or both. -

- -

char[] ljustify(char[] s, int width) -
char[] rjustify(char[] s, int width) -
char[] center(char[] s, int width) -
Left justify, right justify, or 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) -
Given a string[] with a slice[] into it, - replace slice[] with 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. - tabsize is the distance between tab stops. -

- -

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(). - Delete chars in delchars[]. -

- -

char[] toString(bit arg) -
char[] toString(char arg) -
char[] toString(byte arg) -
char[] toString(ubyte arg) -
char[] toString(short arg) -
char[] toString(ushort arg) -
char[] toString(int arg) -
char[] toString(uint arg) -
char[] toString(long arg) -
char[] toString(ulong arg) -
char[] toString(float arg) -
char[] toString(double arg) -
char[] toString(real arg) -
char[] toString(ifloat arg) -
char[] toString(idouble arg) -
char[] toString(ireal arg) -
char[] toString(cfloat arg) -
char[] toString(cdouble arg) -
char[] toString(creal arg) -
Convert arg to string. -

- -

char[] toString(long arg, uint radix) -
Convert arg to string in radix radix. - radix must be a value from 2 to 36. - arg is treated as a signed value only if radix is 10. - The characters A through Z are used to represent values 10 through - 36. -

- -

char[] toString(ulong arg, uint radix) -
Convert arg to string in radix radix. - radix must be a value from 2 to 36. - The characters A through Z are used to represent values 10 through - 36. -

- -

char[] toString(char* s) -
Convert C-style 0 terminated string s to char[] string. -

- -

- -

std.system

diff -uNr dmd-0.113/dmd/html/d/std_regexp.html dmd-0.114/dmd/html/d/std_regexp.html --- dmd-0.113/dmd/html/d/std_regexp.html 1970-01-01 01:00:00.000000000 +0100 +++ dmd-0.114/dmd/html/d/std_regexp.html 2005-02-22 10:57:24.000000000 +0100 @@ -0,0 +1,284 @@ + + + + + +Digital Mars - Phobos - std.regexp + + + +www.digitalmars.com + +[Home] +[Search] +[D] + +
Last update Feb 22, 2005 +
+ +

Phobos: std.regexp

+ +Regular expressions +are a powerful method of string pattern matching. +The regular expression +language used is the same as that commonly used, however, some of the very +advanced forms may behave slightly differently. +

+ +

+ +
int find(char[] string, char[] pattern, char[] attributes = null) +
Search string for first match + with regular expression pattern with attributes. + Returns index of match if found, -1 if no match. +

+ +

int rfind(char[] string, char[] pattern, char[] attributes = null) +
Search string for last match with regular expression + pattern with attributes. + Returns index of match if found, -1 if no match. +

+ +

RegExp search(char[] string, char[] pattern, char[] attributes = null) +
Search string for first match + with regular expression pattern with attributes. + Returns corresponding RegExp if found, null if not. +

+ +

char[] sub(char[] string, char[] pattern, char[] format, char[] attributes = null) +
Search string for matches with regular expression + pattern with attributes. + Replace each match with string generated from format. + Return the resulting string. +

+ +

char[] sub(char[] string, char[] pattern, char[] delegate(RegExp) dg, char[] attributes = null) +
Search string for matches with regular expression + pattern with attributes. + Pass each match to delegate dg. + Replace each match with the return value from dg. + Return the resulting string. +

+ +

char[][] split(char[] string, char[] pattern, char[] attributes = null) +
Split string into an array of strings, + using the regular expression pattern with attributes + as the separator. + Returns array of slices into string. +

+ + +

+ +RegExp is a D class to handle regular expressions. +It is +the core foundation for adding powerful string pattern matching capabilities +to programs like grep, text editors, awk, sed, etc. +The RegExp class has these methods: + +
+
this(char[] pattern, char[] attributes) +
Create a new RegExp object. Compile pattern + with attributes into + an internal form for fast execution. + Throws a RegExpError if there are any compilation errors. +

+ +

char[][] split(char[] string) +
Split string into an array of strings, + using the regular expression as the separator. + Returns array of slices in string. +

+ +

int find(char[] string) +
Search string for match with regular expression. + + + + + +
Returns + Description +
>=0 + index of match +
-1 + no match +
+

+ +

char[][] match(char[] string) +
Search string for match. + + + + + +
Attribute + Returns +
global + same as call to exec(string) +
not global + array of all matches +
+

+ +

char[][] exec(char[] string) +
Search string for next match. + Returns array of slices into string representing matches. +

+ +

int test(char[] string) +
Search string for next match. + + + + + +
Returns + Description +
0 + no match +
!=0 + match +
+

+ + +

char[] replace(char[] string, char[] format) +
Find regular expression matches in string. + Replace those matches + with a new string composed of format + merged with the result of the matches. + + + + + +
Attribute + Action +
global + replace all matches +
not global + replace first match +
+ Returns the new string. +

+ +

char[] replace(char[] format) +
After a match is found with test(), this function + will take the match results and, using the format + string, generate and return a new string. +

+ +

char[] replaceOld(char[] format) +
Like replace(char[] format), but uses old style formatting: + + + + + + + + +
Format + Description +
& + replace with the match +
\n + replace with the nth parenthesized match, n is 1..9 +
\c + replace with char c. +
+

+ + + +

+ +

attributes

+ + attributes are a string controlling the interpretation + of the regulat expression. It consists of a sequence of one or more + of the following characters: +

+ + + + + + + + +
Attribute + Action +
g + global; repeat over the whole input string +
i + case insensitive +
m + treat as multiple lines separated by newlines +
+ +

format

+ + format strings are a sequence of characters with embedded + format commands used to generate a new string from a regular + expression match. + The format commands are: +

+ + + + + + + + + + + + + + + + + + + + + + + + +
Format + Description +
$$ + insert $ +
$& + insert the matched substring +
$` + insert the string that precedes the match +
$' + insert the string that following the match +
$n + replace with the nth parenthesized match, + n is 1..9 +
$nn + replace with the nnth parenthesized match, + nn is 01..99 +
$ + insert $ +
+ + +


Copyright (c) 2004-2005 by Digital Mars, All Rights Reserved + + + + + diff -uNr dmd-0.113/dmd/html/d/std_socket.html dmd-0.114/dmd/html/d/std_socket.html --- dmd-0.113/dmd/html/d/std_socket.html 1970-01-01 01:00:00.000000000 +0100 +++ dmd-0.114/dmd/html/d/std_socket.html 2005-02-26 10:49:28.000000000 +0100 @@ -0,0 +1,473 @@ + + + +Digital Mars - Phobos - std.socket + + + +www.digitalmars.com + +[Home] +[Search] +[D] + +
Last update Feb 26, 2005 +
+ +

Phobos: std.socket

+ +
+ +
enum AddressFamily +
The communication domain used to resolve an address: +

+

+
UNIX +
local communication +
INET +
internet protocol version 4 +
IPX +
novell IPX +
APPLETALK +
appletalk +
+

+ +

enum SocketType +
Communication semantics: +

+

+
STREAM +
sequenced, reliable, two-way communication-based byte streams +
DGRAM +
connectionless, unreliable datagrams with a fixed maximum length; + data may be lost or arrive out of order +
RAW +
raw protocol access +
RDM +
reliably-delivered message datagrams +
SEQPACKET +
sequenced, reliable, two-way connection-based datagrams with a fixed + maximum length +
+

+ +

enum ProtocolType +
Protocol: +

+

+
IP +
internet protocol +
ICMP +
internet control message protocol +
IGMP +
internet group management protocol +
GGP +
gateway to gateway protocol +
TCP +
transmission control protocol +
PUP +
PARC universal packet protocol +
UDP +
user datagram protocol +
IDP +
Xerox NS protocol +
+

+ +


+
class AddressException : Exception +
Base exception thrown from an Address. +

+ +

abstract class Address +
Address is an abstract class for representing a network addresses. +

+

+
AddressFamily addressFamily() +
Family of this address. +

+ +

char[] toString() +
Human readable string representing this address. +
+

+ +

class InternetAddress : Address +
InternetAddress is a class that represents an IPv4 (internet protocol + version 4) address and port. +

+

+
const uint ADDR_ANY +
Any IPv4 address number. +
const uint ADDR_NONE +
An invalid IPv4 address number. +
const ushort PORT_ANY +
Any IPv4 port number. +

+ +

this(uint addr, ushort port) +
this(ushort port) +
Construct a new Address. addr may be ADDR_ANY (default) and port + may be PORT_ANY, and the actual numbers may not be known + until a connection is made. +
this(char[] addr, ushort port) +
addr may be an IPv4 address string in the dotted-decimal form + a.b.c.d, or a host name that will be resolved using an + InternetHost object. port may be PORT_ANY as stated above. +

+ +

AddressFamily addressFamily() +
Overridden to return AddressFamily.INET. +
ushort port() +
Returns the IPv4 port number. +
uint addr() +
Returns the IPv4 address number. +

+ +

char[] toAddrString() +
Human readable string representing the IPv4 address in + dotted-decimal form. +
char[] toPortString() +
Human readable string representing the IPv4 port. +
char[] toString() +
Human readable string representing the IPv4 address and port + in the form a.b.c.d:e. +

+ +

static uint parse(char[] addr) +
Parse an IPv4 address string in the dotted-decimal form + a.b.c.d and return the number. If the string is not + a legitimate IPv4 address, ADDR_NONE is returned. +
+

+ +


+
class HostException : Exception +
Base exception thrown from an InternetHost. +

+ +

class InternetHost +
InternetHost is a class for resolving IPv4 addresses. +

+

+
char[] name +
char[][] aliases +
uint[] addrList +
These members are populated when one of the following + functions are called without failure: +

+ +

bit getHostByName(char[] name) +
Resolve host name. Returns false if unable to resolve. +
bit getHostByAddr(uint addr) +
Resolve IPv4 address number. Returns false if unable to resolve. +
bit getHostByAddr(char[] addr) +
Same as previous, but addr is an IPv4 address string in the + dotted-decimal form a.b.c.d. Returns false if unable to resolve. +

+

+

+ +


+
enum SocketShutdown +
How a socket is shutdown: +

+

+
RECEIVE +
socket receives are disallowed +
SEND +
socket sends are disallowed +
BOTH +
both RECEIVE and SEND +
+

+ +

enum SocketFlags +
Flags may be OR'ed together: +

+

+
NONE +
no flags specified +
OOB +
out-of-band stream data +
PEEK +
peek at incoming data without removing it from the queue +
DONTROUTE +
data should not be subject to routing; + this flag may be ignored. +
+

+ +

enum SocketOptionLevel +
The level at which a socket option is defined: +

+

+
SOCKET +
socket level +
IP +
internet protocol level +
TCP +
transmission control protocol level +
UDP +
user datagram protocol level +
+

+ +

enum SocketOption +
Specifies a socket option: +

+

+
DEBUG +
record debugging information +
BROADCAST +
allow transmission of broadcast messages +
REUSEADDR +
allow local reuse of address +
LINGER +
linger on close if unsent data is present +
OOBINLINE +
receive out-of-band data in band +
SNDBUF +
send buffer size +
RCVBUF +
receive buffer size +
KEEPALIVE +
keep connection alive +
DONTROUTE +
do not route +
TCP_NODELAY +
disable the Nagle algorithm for send coalescing +
+

+ + +

struct linger +
Linger information for use with SocketOption.LINGER. +

+

+
ushort on +
Nonzero for on. +
ushort time +
Linger time. +
+

+ +

struct timeval +
Duration timeout value. +

+

+
int seconds +
Number of seconds. +
int microseconds +
Number of additional microseconds. +
+

+ +

class SocketException : Exception +
Base exception thrown from a Socket. +

+ +

class Socket +
Socket is a class that creates a network communication endpoint + using the Berkeley sockets interface. +

+

+
this(AddressFamily af, SocketType type, ProtocolType protocol) +
this(AddressFamily af, SocketType type) +
Create a blocking socket. If a single protocol type exists to support this socket type + within the address family, the ProtocolType may be omitted. +

+ +

bit blocking +
Property to get or set whether the socket is blocking or nonblocking. +

+ +

bit isAlive +
Property that indicates if this is a valid, alive 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. If the socket is blocking, connect waits for + the connection to be made. If the socket is nonblocking, connect returns + immediately and the connection attempt is still in progress. +

+ +

void listen(int backlog) +
Listen for an incoming connection. bind must be called before you + can listen. The backlog is a request of how many pending incoming + connections are queued until accept'ed. +

+ +

Socket accept() +
Accept an incoming connection. If the socket is blocking, accept + waits for a connection request. Throws SocketAcceptException if + unable to accept. +

+ +

void shutdown(SocketShutdown how) +
Disables sends and/or receives. +

+ +

void close() +
Immediately drop any connections and release socket resources. + Calling shutdown before close is recommended for + connection-oriented sockets. The Socket object is no longer + usable after close. +

+ +

Address remoteAddress() +
Remote endpoint Address. +

+ +

Address localAddress() +
Local endpoint Address. +

+ +

const int ERROR +
Send or receive error code. +

+ +

int send(void[] buf, SocketFlags flags) +
int send(void[] buf) +
Send data on the connection. Returns the number of bytes actually + sent, or ERROR on failure. If the socket is blocking and + there is no buffer space left, send waits. +

+ +

int sendTo(void[] buf, SocketFlags flags, Address to) +
int sendTo(void[] buf, Address to) +
int sendTo(void[] buf, SocketFlags flags) +
int sendTo(void[] buf) +
Send data to a specific destination Address. + If the destination address is not specified, a connection must have + been made and that address is used. If the socket is blocking and + there is no buffer space left, sendTo waits. +

+ +

int receive(void[] buf, SocketFlags flags) +
int receive(void[] buf) +
Receive data on the connection. Returns the number of bytes actually + received, 0 if the remote side has closed the connection, or ERROR + on failure. If the socket is blocking, receive waits until there + is data to be received. +

+ +

int receiveFrom(void[] buf, SocketFlags flags, out Address from) +
int receiveFrom(void[] buf, out Address from) +
int receiveFrom(void[] buf, SocketFlags flags) +
int receiveFrom(void[] buf) +
Receive data and get the remote endpoint Address. Returns the number + of bytes actually received, 0 if the remote side has closed the connection, + or ERROR on failure. If the socket is blocking, receiveFrom + waits until there is data to be received. +

+ +

int getOption(SocketOptionLevel level, SocketOption option, void[] result) +
Get a socket option. Returns the number of bytes written to result. +
int getOption(SocketOptionLevel level, SocketOption option, out int result) +
Same as previous, but for the common case of integer and boolean options. +

+ +

void setOption(SocketOptionLevel level, SocketOption option, void[] value) +
Set a socket option. +
void setOption(SocketOptionLevel level, SocketOption option, int value) +
Same as previous, but for the common case of integer and boolean options. +

+ +

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) +
Wait for a socket to change status. A wait timeout timeval or + int microseconds may be specified; if a timeout is not specified or the + timeval is null, the maximum timeout is used. The timeval timeout + has an unspecified value when select returns. Returns the number + of sockets with status changes, 0 on timeout, or -1 on interruption. + If the return value is greter than 0, the SocketSets are updated + to only contain the sockets having status changes. + For a connecting socket, a write status change means the connection + is established and it's able to send. For a listening socket, + a read status change means there is an incoming connection request and + it's able to accept. +

+

+ +
class TcpSocket : Socket +
TcpSocket is a shortcut class for a TCP Socket. +

+

+
this() +
Constructs a blocking TCP Socket. +
this(InternetAddress connectTo) +
Constructs a blocking TCP Socket and connects to an InternetAddress. +

+

+ +
class UdpSocket : Socket +
UdpSocket is a shortcut class for a UDP Socket. +

+

+
this() +
Constructs a blocking UDP Socket. +

+

+ +

+
class SocketSet +
A collection of sockets for use with Socket.select. +

+

+
this(uint max) +
Set the maximum amount of sockets that may be added. +
this() +
Uses the default maximum for the system. +

+ +

uint max +
Property to get the maximum amount of sockets that may be added + to this SocketSet. +

+ +

void add(Socket s) +
Add a Socket to the collection. + Adding more than the maximum has dangerous side affects. +

+ +

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 so that there are 0 Sockets + in the collection. +

+

+ +
+ +

Notes

+ + For Win32 systems, link with ws2_32.lib. + +

Example

+ + See /dmd/samples/d/listener.d. + +
written by Christopher E. Miller + + + + + diff -uNr dmd-0.113/dmd/html/d/std_string.html dmd-0.114/dmd/html/d/std_string.html --- dmd-0.113/dmd/html/d/std_string.html 1970-01-01 01:00:00.000000000 +0100 +++ dmd-0.114/dmd/html/d/std_string.html 2005-02-23 16:33:28.000000000 +0100 @@ -0,0 +1,397 @@ + + + + + +Digital Mars - Phobos - std.string + + + +www.digitalmars.com + +[Home] +[Search] +[D] + +
Last update Feb 20, 2005 +
+ +

Phobos: std.string

+ +

To copy or not to copy?

+ + When a function takes a string as a parameter, and returns a string, + is that string the same as the input string, modified in place, or + is it a modified copy of the input string? The D array convention is + "copy-on-write". This means that if no modifications are done, the + original string (or slices of it) can be returned. If any modifications + are done, the returned string is a copy. +

+ +

+ +
class StringException +
Thrown on errors in string functions. +

+ +

const char[] hexdigits; +
"0123456789ABCDEF" +

+ +

const char[] digits; +
"0123456789" +

+ +

const char[] octdigits; +
"01234567" +

+ +

const char[] lowercase; +
"abcdefghijklmnopqrstuvwxyz" +

+ +

const char[] uppercase; +
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +

+ +

const char[] letters; +
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" +

+ +

const char[] whitespace; +
" \t\v\r\n\f" +

+ +

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. + Returns: +
+
<0 for (s1 < s2) +
=0 for (s1 == s2) +
>0 for (s1 > s2) +
+

+ + +

int icmp(char[] s1, char[] s2) +
Same as cmp() but case insensitive. +

+ +

char* toStringz(char[] s) +
Converts a D array of chars to a C-style 0 terminated string. +

+ + +

int find(char[] s, dchar c) +
Find first occurrance of c in string s. + Return index in s where it is found. + Return -1 if not found. +

+ +

int rfind(char[] s, dchar c) +
Find last occurrance of c in string s. + Return index in s where it is found. + Return -1 if not found. +

+ +

int find(char[] s, char[] sub) +
Find first occurrance of sub in string s. + Return index in s[] where it is found. + Return -1 if not found. +

+ +

int rfind(char[] s, char[] sub) +
Find last occurrance of sub in string s. + Return index in s where it is found. + Return -1 if not found. +

+ +

int ifind(char[] s, dchar c) +
int irfind(char[] s, dchar c) +
int ifind(char[] s, char[] sub) +
int irfind(char[] s, char[] sub) +
Case insensitive versions. +

+ +

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. + Remove leading and trailing whitespace. + Replace all sequences of whitespace with a single space. +

+ +

char[] join(char[][] words, char[] sep) +
Concatenate all the strings together into one + string; use sep[] as the separator. +

+ +

char[][] split(char[] s) +
Split s[] into an array of words, + using whitespace as the delimiter. +

+ +

char[][] split(char[] s, char[] delim) +
Split s[] into an array of words, + using delim[] as the delimiter. +

+ +

char[][] splitlines(char[] s) +
Split s[] into an array of lines, + using CR, LF, or CR-LF as the delimiter. +

+ +

char[] stripl(char[] s) +
char[] stripr(char[] s) +
char[] strip(char[] s) +
Strips leading or trailing whitespace, or both. +

+ +

char[] chomp(char[] s, char[] delimiter = null) +
Returns s sans trailing delimiter, if any. + If delimiter is null, any trailing CR, LF, or CRLF + is removed. +

+ +

char[] chop(char[] s) +
Returns s sans trailing character, if there is one. + If last two characters are CR-LF, then both are removed. +

+ +

char[] ljustify(char[] s, int width) +
char[] rjustify(char[] s, int width) +
char[] center(char[] s, int width) +
Left justify, right justify, or center string s + 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[] s, char[] slice, char[] replacement) +
Given a string s with a slice into it, + replace slice[] with 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. + tabsize is the distance between tab stops. +

+ +

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(). + Delete chars in delchars. + Note: This only works if s is ASCII. + Use tr for full UCS character support. +

+ +

char[] toString(bit arg) +
char[] toString(char arg) +
char[] toString(byte arg) +
char[] toString(ubyte arg) +
char[] toString(short arg) +
char[] toString(ushort arg) +
char[] toString(int arg) +
char[] toString(uint arg) +
char[] toString(long arg) +
char[] toString(ulong arg) +
char[] toString(float arg) +
char[] toString(double arg) +
char[] toString(real arg) +
char[] toString(ifloat arg) +
char[] toString(idouble arg) +
char[] toString(ireal arg) +
char[] toString(cfloat arg) +
char[] toString(cdouble arg) +
char[] toString(creal arg) +
Convert arg to string. +

+ +

char[] toString(long arg, uint radix) +
Convert arg to string in radix radix. + radix must be a value from 2 to 36. + arg is treated as a signed value only if radix is 10. + The characters A through Z are used to represent values 10 through + 36. +

+ +

char[] toString(ulong arg, uint radix) +
Convert arg to string in radix radix. + radix must be a value from 2 to 36. + The characters A through Z are used to represent values 10 through + 36. +

+ +

char[] toString(char* s) +
Convert C-style 0 terminated string s to char[] string. +

+ +

char[] format(...) +
Format arguments into a string. +

+ +

char[] sformat(char[] s, ...) +
Format arguments into string s which must be large + enough to hold the result. Throws ArrayBoundsError if it is not. + Returns s. +

+ +

char[] succ(char[] s) +
Return string that is the 'successor' to s. + If the rightmost character is a-zA-Z0-9, it is incremented within + its case or digits. If it generates a carry, the process is + repeated with the one to its immediate left. +
+	succ(null);	// returns null	
+	succ("!@#$%");	// returns "!@#$%"
+	succ("1");	// returns "2"
+	succ("9");	// returns "10"
+	succ("999");	// returns "1000"
+	succ("zz99");	// returns "aaa00"
+

+ + +

char[] tr(char[] str, char[] from, char[] to, char[] modifiers = null) +
Replaces characters in str that are in from + with corresponding characters in to and returns the resulting + string. +

+ + modifiers is a string of modifier characters: +

+ + + + + + + + +
Modifier + Description +
c + Complement the list of characters in from +
d + Removes matching characters with no corresponding + replacement in to +
s + Removes adjacent duplicates in the replaced characters +
+

+ + If modifier d is present, then the number of characters + in to may be only 0 or 1. +

+ + If modifier d is not present and to is null, + then to is taken to be the same as from. +

+ + If modifier d is not present and to is shorter + than from, then to is extended by replicating the + last character in to. +

+ + Both from and to may contain ranges using the - + character, for example a-d is synonymous with abcd. + Neither accept a leading ^ as meaning the complement of + the string (use the c modifier for that). +

+ +

+ +

Patterns

+ + A pattern is an array of characters much like a character + class in regular expressions. A sequence of characters + can be given, such as "abcde". The '-' can represent a range + of characters, as "a-e" represents the same pattern as "abcde". + "a-fA-F0-9" represents all the hex characters. + If the first character of a pattern is '^', then the pattern + is negated, i.e. "^0-9" means any character except a digit. + The following functions use patterns. +

+ + Note: In the future, the pattern syntax may be improved + to be more like regular expression character classes. + +

+ +
int inPattern(dchar c, char[] pattern) +
Returns 1 if c is in pattern, 0 if not. +

+ +

int inPatterns(dchar c, char[][] patterns) +
Returns 1 if c is in each of the patterns + in patterns, 0 if not. +

+ +

size_t countchars(char[] s, char[] pattern) +
Returns number of characters in s that match + pattern. +

+ +

char[] removechars(char[] s, char[] pattern) +
Return a string consisting of s with all the characters + that match pattern removed. +

+ +

char[] squeeze(char[] s, char[] pattern = null) +
Return a string consisting of s with all the + multiple sequences of characters + that match pattern are removed. + If pattern is null, it defaults to all characters. +
+	squeeze("hello goodbye")	// returns "helo godbye"
+	squeeze("hello goodbye", "le")	// returns "helo goodbye"
+

+ + +

+ +
Copyright (c) 2004-2005 by Digital Mars, All Rights Reserved + + + + + diff -uNr dmd-0.113/dmd/html/d/toc.html dmd-0.114/dmd/html/d/toc.html --- dmd-0.113/dmd/html/d/toc.html 2005-02-09 17:48:52.000000000 +0100 +++ dmd-0.114/dmd/html/d/toc.html 2005-02-13 12:02:24.000000000 +0100 @@ -59,7 +59,6 @@ · FAQ
· Style Guide
· Example: wc
-· D Compiler
· Future
· D Change Log
· Tech Tips
@@ -68,6 +67,9 @@
Tools
+· DMD D Compiler
+· GDC D Compiler
+· Linker
· Profiler