The Data object holds a pointer and size information to an allocated memory data location.
see also ConstData, BufferedData
Usage examples:
#include "murl_data.h"
String s("abc");
String s = data.GetString();
for (
UInt32 i = 0; i < 100; i++)
{
}
data.ResizeData(byteArray.GetByteSize());
data.CopyFrom(byteArray.Begin(), byteArray.GetCount(), 0);
byteArray.Clear();
byteArray.SetCount(data.GetByteSize());
data.CopyTo(byteArray.Begin(), byteArray.GetCount(), 0);
DataType & Add()
Add a new item at the end of the array.
Definition: murl_array.h:467
Data()
The default constructor.
Definition: murl_data.h:477
Array< UInt8 > UInt8Array
An unsigned 8 bit integer array.
Definition: murl_types.h:270
MurlUInt32 UInt32
Unsigned 32 bit integer data type.
Definition: murl_types.h:152
String EncodeHex(const String &dataIn)
Encode a string to a Hex character string.
Data DecodeHex(const String &dataIn)
Decode a Hex character string.
|
| Data () |
| The default constructor.
|
|
| Data (const UInt64 byteSize) |
| Constructor allocating memory. More...
|
|
| Data (const void *data, UInt64 byteSize) |
| Constructor allocating memory and copying data. More...
|
|
| ~Data () override |
| The destructor. More...
|
|
void | ReleaseData () override |
| Release the data. More...
|
|
template<class DataType > |
DataType * | DetachData (UInt64 &byteSize) |
| Return the data memory and give up ownership. More...
|
|
UInt8 * | DetachData (UInt64 &byteSize) |
| Return the data memory and give up ownership. More...
|
|
void | AssignData (const void *data, UInt64 byteSize) override |
| Assign data by allocating memory and copying the data. More...
|
|
void | ObtainData (void *data, UInt64 byteSize) |
| Obtain a memory data location. More...
|
|
void | ObtainData (Data &data) |
| Obtain the memory from a data object. More...
|
|
void | ResizeData (UInt64 newByteSize) |
| Resize the memory. More...
|
|
virtual void | AppendData (const void *data, UInt64 byteSize) |
| Append data to the current memory. More...
|
|
| Data (const ConstData &data) |
| The copy constructor taking a ConstData object. More...
|
|
| Data (const MutableData &data) |
| The copy constructor taking a MutableData object. More...
|
|
| Data (const Data &data) |
| The copy constructor. More...
|
|
template<class DataType > |
| Data (const Array< DataType > &array) |
| The copy constructor taking an Array object. More...
|
|
| Data (const String &string) |
| The copy constructor taking a String object. More...
|
|
Data & | operator= (const ConstData &data) |
| Assignment operator taking a ConstData object. More...
|
|
Data & | operator= (const MutableData &data) |
| Assignment operator taking a MutableData object. More...
|
|
Data & | operator= (const Data &data) |
| Assignment operator. More...
|
|
Data & | operator= (const String &string) |
| Assignment operator taking a String object. More...
|
|
template<class DataType > |
Data & | operator= (const Array< DataType > &array) |
| Assignment operator taking an Array object. More...
|
|
Data & | operator+= (const ConstData &data) |
| In-place addition operator taking a ConstData object. More...
|
|
Data & | operator+= (const MutableData &data) |
| In-place addition operator taking a MutableData object. More...
|
|
Data & | operator+= (const Data &data) |
| In-place addition operator. More...
|
|
Data & | operator+= (const String &string) |
| In-place addition operator taking a String object. More...
|
|
template<class DataType > |
Data & | operator+= (const Array< DataType > &array) |
| In-place addition operator taking an Array object. More...
|
|
void | CollectObjectStatistics (IObjectStatistics *stat) const override |
| Implementation of IStatisticsObject::CollectObjectStatistics(). More...
|
|
| MutableData () |
| The default constructor.
|
|
| MutableData (void *data, UInt64 byteSize) |
| The constructor taking data and byte size. More...
|
|
| ~MutableData () override |
| The destructor.
|
|
template<class DataType > |
DataType * | GetMutableData () const |
| Get the pointer to the mutable memory data location. More...
|
|
UInt8 * | GetMutableData () const |
| Get the pointer to the mutable memory data location. More...
|
|
template<class DataType > |
DataType * | GetMutableData (UInt64 byteOffset) const |
| Get the pointer to the mutable memory data location including a byte offset. More...
|
|
UInt8 * | GetMutableData (UInt64 byteOffset) const |
| Get the pointer to the mutable memory data location including a byte offset. More...
|
|
UInt64 | CopyDataTo (MutableData &destination, UInt64 byteOffset) const |
| Copy the memory data to a destination data object. More...
|
|
UInt64 | CopyFrom (const void *source, UInt64 byteSize, UInt64 byteOffset) const |
| Copy the memory data from a source memory location. More...
|
|
UInt64 | CopyDataFrom (const ConstData &source, UInt64 byteOffset) const |
| Copy the memory data from a source data object. More...
|
|
| ConstData () |
| The default constructor.
|
|
| ConstData (const void *data, const UInt64 byteSize) |
| The constructor taking data and byte size. More...
|
|
| ~ConstData () override=default |
| The destructor.
|
|
Bool | IsEmpty () const |
| Check if the data object is empty. More...
|
|
UInt32 | GetByteSize32 () const |
| Get the 32 bit byte size of the memory data location. More...
|
|
UInt64 | GetByteSize () const |
| Get the byte size of the memory data location. More...
|
|
template<class DataType > |
const DataType * | GetData () const |
| Get the pointer to the memory data location. More...
|
|
const UInt8 * | GetData () const |
| Get the pointer to the memory data location. More...
|
|
template<class DataType > |
const DataType * | GetData (UInt64 byteOffset) const |
| Get the pointer to the memory data location including a byte offset. More...
|
|
const UInt8 * | GetData (UInt64 byteOffset) const |
| Get the pointer to the memory data location including a byte offset. More...
|
|
UInt64 | CopyTo (void *destination, UInt64 byteSize, UInt64 byteOffset) const |
| Copy the memory data to a destination. More...
|
|
String | GetString () const |
| Get a string from the memory data. More...
|
|
String | GetString (UInt64 length) const |
| Get a string from the memory data with length. More...
|
|
UInt64 | GetHashValue () const |
| Calculate the data hash value. More...
|
|
bool | operator== (const ConstData &rhs) const |
| Equal to comparison operator. More...
|
|
bool | operator!= (const ConstData &rhs) const |
| Not equal to comparison operator. More...
|
|
bool | operator== (const String &rhs) const |
| Equal to comparison operator with string. More...
|
|
bool | operator!= (const String &rhs) const |
| Not equal to comparison operator with string. More...
|
|
void | CollectObjectStatistics (IObjectStatistics *stat) const override |
| Implementation of IStatisticsObject::CollectObjectStatistics(). More...
|
|