- append
Data append(const(void)[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
- clear
void clear()
Undocumented in source. Be warned that the author may not have intended to support it.
- concat
Data concat(const(void)[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
- deleteContents
void deleteContents()
This used to be an unsafe method which deleted the wrapped data.
Now that Data is refcounted, this simply calls clear() and
additionally asserts that this Data is the only Data holding
a reference to the wrapper.
- opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
- opCat
Data opCat(const(T)[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCat
Data opCat(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCatAssign
Data opCatAssign(const(T)[] data)
Note that unlike opCat (a ~ b), opCatAssign (a ~= b) will preallocate.
- opCatAssign
Data opCatAssign(Data data)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCatAssign
Data opCatAssign(ubyte value)
Undocumented in source. Be warned that the author may not have intended to support it.
- opCat_r
Data opCat_r(const(T)[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
- opSlice
Data opSlice()
Undocumented in source. Be warned that the author may not have intended to support it.
- opSlice
Data opSlice(size_t x, size_t y)
Undocumented in source.
- popFront
Data popFront(size_t size)
Return a new Data for the first size bytes, and slice this instance from size to end.
- prepend
Data prepend(const(void)[] data)
Undocumented in source. Be warned that the author may not have intended to support it.
- capacity
size_t capacity [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- contents
const(void)[] contents [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- dup
Data dup [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- empty
bool empty [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- length
size_t length [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- length
size_t length [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
- mcontents
void[] mcontents [@property getter]
- mptr
void* mptr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- ptr
const(void)* ptr [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- toHeap
void[] toHeap [@property getter]
Put a copy of the data on D's managed heap, and return it.
Wrapper for data located in external memory, to prevent faux references. Represents a slice of data, which may or may not be in unmanaged memory. Data in unmanaged memory is bound to a DataWrapper class instance.
All operations on this class should be safe, except for accessing contents directly. All operations on contents must be accompanied by a live reference to the Data object, to keep a GC anchor towards the unmanaged data.
Concatenations and appends to Data contents will cause reallocations on the heap, consider using Data instead.
Be sure not to lose Data references while using their contents! For example, avoid code like this:
The Data return value may be unreachable once .contents is evaluated. Use .toHeap instead of .contents in such cases to get a safe heap copy.