Mercurial > projects > dwt-linux
comparison dwt/browser/InputStream.d @ 343:96243e3ebcf0
Mozilla.d compiles successfully :)
author | John Reimer <terminal.node@gmail.com> |
---|---|
date | Mon, 27 Oct 2008 06:28:02 -0700 |
parents | 942da4b6558a |
children | 5abc6f7f7a95 |
comparison
equal
deleted
inserted
replaced
342:8d03ae013e53 | 343:96243e3ebcf0 |
---|---|
19 import XPCOM = dwt.internal.mozilla.XPCOM; | 19 import XPCOM = dwt.internal.mozilla.XPCOM; |
20 //import dwt.internal.mozilla.XPCOMObject; | 20 //import dwt.internal.mozilla.XPCOMObject; |
21 import dwt.internal.mozilla.nsID; | 21 import dwt.internal.mozilla.nsID; |
22 import dwt.internal.mozilla.nsIInputStream; | 22 import dwt.internal.mozilla.nsIInputStream; |
23 import dwt.internal.mozilla.nsISupports; | 23 import dwt.internal.mozilla.nsISupports; |
24 import dwt.internal.mozilla.Common; | |
24 | 25 |
25 class InputStream : nsIInputStream { | 26 class InputStream : nsIInputStream { |
26 //XPCOMObject inputStream; | 27 //XPCOMObject inputStream; |
27 int refCount = 0; | 28 int refCount = 0; |
28 | 29 |
118 } | 119 } |
119 *_retval = max; | 120 *_retval = max; |
120 return XPCOM.NS_OK; | 121 return XPCOM.NS_OK; |
121 } | 122 } |
122 | 123 |
123 nsresult ReadSegments (nsWriteSegFun aWriter, void* aClosure, PRUint32 aCount, PRUint32* _retval) { | 124 nsresult ReadSegments (nsWriteSegmentFun aWriter, void* aClosure, PRUint32 aCount, PRUint32* _retval) { |
124 int max = Math.min (aCount, buffer is null ? 0 : buffer.length - index); | 125 int max = Math.min (aCount, buffer is null ? 0 : buffer.length - index); |
125 PRUint32 cnt = max; | 126 PRUint32 cnt = max; |
126 while (cnt > 0) { | 127 while (cnt > 0) { |
127 PRUint32 aWriteCount; | 128 PRUint32 aWriteCount; |
128 nsresult rc = aWrite (cast(nsIInputStream)this, aClosure, buffer.ptr, index, cnt, &aWriteCount); | 129 nsresult rc = aWrite (cast(nsIInputStream)this, aClosure, buffer.ptr, index, cnt, &aWriteCount); |