Om
1.0.0
A universal framework for multimedia simulation
|
A class that represents an immutable array of unsigned byte data. More...
#include <omData.h>
Public Member Functions | |
Data () | |
Create an empty Data object that doesn't hold any data. More... | |
Data (const UByte *newData, Size number) | |
Create a Data object by copying the specified number of bytes from the given data pointer. More... | |
Data (const util::Array< UByte > &array) | |
Create a Data object by copying the specified data array. More... | |
Data (const util::Array< UByte > &array, Size number) | |
Create a Data object by copying the specified number of bytes from the given data array. More... | |
Data (const Data &other) | |
~Data () | |
Destroy a Data object, deallocating the internal data array if the reference count reaches zero. More... | |
Data & | operator= (const Data &other) |
Assign the contents of another Data object to this object. More... | |
Size | getSize () const |
Return the number of bytes of data that this Data object holds. More... | |
Size | getSizeInBytes () const |
Return the number of bytes of data that this Data object holds. More... | |
const UByte * | getPointer () const |
Get a pointer to the internal array of bytes that this Data object holds. More... | |
operator const UByte * () const | |
Get a pointer to the internal array of bytes that this Data object holds. More... | |
const UByte & | operator() (Index index) const |
Access the byte at the specified index in the Data object's internal array. More... | |
Bool | equals (const Data &other) const |
Return whether or not the data contained in this Data object is identical to another's. More... | |
Bool | operator== (const Data &other) const |
Return whether or not the data contained in this Data object is identical to another's. More... | |
Bool | operator!= (const Data &other) const |
Return whether or not the data contained in this Data object is not identical to another's. More... | |
Data | concatenate (const Data &other) const |
Return a Data object containing the concatenation of this data and the specified data. More... | |
Data | operator+ (const Data &other) const |
Return a Data object containing the concatenation of this data and the specified data. More... | |
Hash | getHashCode () const |
Get a hash code for this Data object. More... | |
Static Public Member Functions | |
static Data | shallow (UByte *array, Size size) |
Create a data object from the specified byte array with the specified size. More... | |
A class that represents an immutable array of unsigned byte data.
The Data class is the data-oriented analogue to the GenericString class. It is designed to hold an opaque block of data resident in memory. A Data object could be used to hold anything: images, audio, even text. The internal array of data is reference-counted in order to reduce unintended copying.
|
inline |
Create an empty Data object that doesn't hold any data.
Create a Data object by copying the specified number of bytes from the given data pointer.
om::data::Data::Data | ( | const util::Array< UByte > & | array | ) |
Create a Data object by copying the specified data array.
om::data::Data::Data | ( | const util::Array< UByte > & | array, |
Size | number | ||
) |
Create a Data object by copying the specified number of bytes from the given data array.
|
inline |
om::data::Data::~Data | ( | ) |
Destroy a Data object, deallocating the internal data array if the reference count reaches zero.
Create a data object from the specified byte array with the specified size.
Once this method completes, it is expected that the Data object now owns the data array pointer and will free it upon destruction.
Assign the contents of another Data object to this object.
|
inline |
Return the number of bytes of data that this Data object holds.
|
inline |
Return the number of bytes of data that this Data object holds.
|
inline |
Get a pointer to the internal array of bytes that this Data object holds.
|
inline |
Get a pointer to the internal array of bytes that this Data object holds.
Access the byte at the specified index in the Data object's internal array.
Return whether or not the data contained in this Data object is identical to another's.
Return whether or not the data contained in this Data object is identical to another's.
Return whether or not the data contained in this Data object is not identical to another's.
Return a Data object containing the concatenation of this data and the specified data.
Return a Data object containing the concatenation of this data and the specified data.