Inheritance diagram for MappedBuffer:
Public Member Functions | |
this () | |
void | close () |
void | flush () |
void | setPosition (uint position) |
long | seek (long offset, ISeekable.SeekAnchor anchor) |
uint | writable () |
protected void | copy (void *src, uint size) |
int | write (int(*dg)(void[])) |
IBuffer | compress () |
IBuffer | clear () |
void | setConduit (IConduit conduit) |
Private Member Functions | |
this (uint capacity=0) | |
this (void[] data) | |
this (void[] data, uint readable) | |
IBuffer | create () |
void[] | getContent () |
IBuffer | setValidContent (void[] data) |
IBuffer | setContent (void[] data, uint readable) |
bool | grow (uint size) |
void[] | get (uint size, bool eat=true) |
IBuffer | append (void[] src) |
char[] | toString () |
bool | skip (int size) |
uint | readable () |
int | read (int(*dg)(void[])) |
uint | getLimit () |
uint | getCapacity () |
uint | getPosition () |
IConduit | getConduit () |
Static Private Attributes | |
package EofException | eof |
package IOException | udf |
package IOException | ovf |
Definition at line 675 of file Buffer.d.
|
Construct an empty MappedBuffer Reimplemented from Buffer. |
|
Close this mapped buffer Referenced by MappedFile::VersionWindows::~this(). |
|
Flush any dirty content out to the drive Reimplemented from Buffer. |
|
Set the read/write position |
|
Seek to the specified position within the buffer, and return the byte offset of the new location (relative to zero). |
|
Return count of writable bytes available in buffer. This is calculated simply as capacity() - limit() Reimplemented from Buffer. |
|
Bulk copy of data from 'src'. Position is adjusted by 'size' bytes. Reimplemented from Buffer. |
|
Exposes the raw data buffer at the current write position, The delegate is provided with a void[] representing space available within the buffer at the current write position. The delegate should return the appropriate number of bytes if it writes valid content, or IConduit.Eof on error. Returns whatever the delegate returns. Reimplemented from Buffer. Definition at line 775 of file Buffer.d. References assert(). |
|
Prohibit compress() from doing anything at all. Reimplemented from Buffer. |
|
Prohibit clear() from doing anything at all. Reimplemented from Buffer. |
|
Prohibit the setting of another IConduit Reimplemented from Buffer. Definition at line 815 of file Buffer.d. References assert(). |
|
Construct a Buffer with the specified number of bytes. Reimplemented in GrowableBuffer. |
|
Prime buffer with an application-supplied array. There is no readable data present, and writing begins at position 0. |
|
Prime buffer with an application-supplied array, and indicate how much readable data is already there. A write operation will begin writing immediately after the existing content. Definition at line 215 of file Buffer.d. References Buffer::setContent(). |
|
Create an instance of an IBuffer. Use this when you don't know anything about the concrete implementation, and have only the IBuffer interface available Returns a Buffer with no content. Reimplemented from IBuffer. |
|
Return the backing array Reimplemented from IBuffer. |
|
Set the backing array with all content readable. Writing to this will either flush it to an associated conduit, or raise an Eof condition. Use IBuffer.clear() to reset the content (make it all writable). Reimplemented from IBuffer. Definition at line 255 of file Buffer.d. References Buffer::setContent(). Referenced by StartLine::VersionUseTokenizer::parse(), ResponseLine::parse(), MappedFile::VersionWindows::this(), and FileBucket::Record::write(). |
|
Set the backing array with some content readable. Writing to this will either flush it to an associated conduit, or raise an Eof condition. Use IBuffer.clear() to reset the content (make it all writable). Reimplemented from IBuffer. Definition at line 269 of file Buffer.d. Referenced by Buffer::append(), FileBucket::Record::read(), Buffer::setValidContent(), and Buffer::this(). |
|
Overridable method to grow the buffer size when it becomes full. Default is to not grow at all. Reimplemented from IBuffer. Reimplemented in GrowableBuffer. Definition at line 288 of file Buffer.d. Referenced by Buffer::append(). |
|
Read a chunk of data from the buffer, loading from the conduit as necessary. The specified number of bytes is loaded into the buffer, and marked as having been read when the 'eat' parameter is set true. When 'eat' is set false, the read position is not adjusted. Returns the corresponding buffer slice when successful, or null if there's not enough data available (Eof; Eob). Reimplemented from IBuffer. Definition at line 319 of file Buffer.d. References Buffer::compress(). Referenced by Buffer::skip(). |
|
Append an array of data to this buffer, and flush to the conduit as necessary. Returns a chaining reference if all data was written; throws an IOException indicating eof or eob if not. This is often used in lieu of a Writer. Reimplemented from IBuffer. Definition at line 360 of file Buffer.d. References Buffer::copy(), IBuffer::flush(), Buffer::grow(), and Buffer::setContent(). Referenced by FilePath::toString(). |
|
Return a char[] slice of the buffer up to the limit of valid content. Reimplemented from IBuffer. Definition at line 397 of file Buffer.d. Referenced by VirtualCache::put(). |
|
Skip ahead by the specified number of bytes, streaming from the associated conduit as necessary. Can also reverse the read position by 'size' bytes. This may be used to support lookahead-type operations. Returns true if successful, false otherwise. Reimplemented from IBuffer. Definition at line 414 of file Buffer.d. References Buffer::get(). |
|
Return count of readable bytes remaining in buffer. This is calculated simply as limit() - position() Reimplemented from IBuffer. Definition at line 436 of file Buffer.d. Referenced by Buffer::compress(). |
|
Exposes the raw data buffer at the current read position. The delegate is provided with a void[] representing the available data, and should return zero to leave the current read position intact. If the delegate consumes data, it should return the number of bytes consumed; or IConduit.Eof to indicate an error. Returns whatever the delegate returns. Reimplemented from IBuffer. Definition at line 492 of file Buffer.d. References assert(). |
|
Returns the limit of readable content within this buffer Reimplemented from IBuffer. |
|
Returns the total capacity of this buffer Reimplemented from IBuffer. |
|
Returns the current read-position within this buffer Reimplemented from IBuffer. Definition at line 583 of file Buffer.d. Referenced by Cluster::broadcast(), and ResponseLine::parse(). |
|
Returns the conduit associated with this buffer. Returns null if the buffer is purely memory based; that is, it's not backed by some external medium. Buffers do not require an external conduit to operate, but it can be convenient to associate one. For example, methods read and write use it to import/export content as necessary. Reimplemented from IBuffer. Definition at line 600 of file Buffer.d. Referenced by HttpMessage::getConduit(). |
|
|
|
|
|
|