Like SkData, SkDataTable holds an immutable data buffer.
More...
#include <SkDataTable.h>
|
typedef void(* | FreeProc )(void *context) |
|
|
bool | isEmpty () const |
| Returns true if the table is empty (i.e. More...
|
|
int | count () const |
| Return the number of entries in the table. More...
|
|
size_t | atSize (int index) const |
| Return the size of the index'th entry in the table. More...
|
|
const void * | at (int index, size_t *size=NULL) const |
| Return a pointer to the data of the index'th entry in the table. More...
|
|
template<typename T > |
const T * | atT (int index, size_t *size=NULL) const |
|
const char * | atStr (int index) const |
| Returns the index'th entry as a c-string, and assumes that the trailing null byte had been copied into the table as well.
|
|
| SkRefCntBase () |
| Default construct, initializing the reference count to 1.
|
|
virtual | ~SkRefCntBase () |
| Destruct, asserting that the reference count is 1.
|
|
int32_t | getRefCnt () const |
| Return the reference count. More...
|
|
void | validate () const |
|
bool | unique () const |
| May return true if the caller is the only owner. More...
|
|
void | ref () const |
| Increment the reference count. More...
|
|
void | unref () const |
| Decrement the reference count. More...
|
|
|
| SkDataTable (const void *array, size_t elemSize, int count, FreeProc, void *context) |
|
| SkDataTable (const Dir *, int count, FreeProc, void *context) |
|
|
int | fCount |
|
size_t | fElemSize |
|
union { |
const Dir * fDir |
|
const char * fElems |
|
} | fU |
|
FreeProc | fFreeProc |
|
void * | fFreeProcContext |
|
|
void | internal_dispose_restore_refcnt_to_1 () const |
| Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More...
|
|
Like SkData, SkDataTable holds an immutable data buffer.
The data buffer is organized into a table of entries, each with a length, so the entries are not required to all be the same size.
const void* SkDataTable::at |
( |
int |
index, |
|
|
size_t * |
size = NULL |
|
) |
| const |
Return a pointer to the data of the index'th entry in the table.
The caller must ensure that index is valid for this table.
- Parameters
-
size | If non-null, this returns the byte size of this entry. This will be the same value that atSize(index) would return. |
size_t SkDataTable::atSize |
( |
int |
index | ) |
const |
Return the size of the index'th entry in the table.
The caller must ensure that index is valid for this table.
int SkDataTable::count |
( |
| ) |
const |
|
inline |
Return the number of entries in the table.
0 for an empty table
bool SkDataTable::isEmpty |
( |
| ) |
const |
|
inline |
Returns true if the table is empty (i.e.
has no entries).
static sk_sp<SkDataTable> SkDataTable::MakeCopyArray |
( |
const void * |
array, |
|
|
size_t |
elemSize, |
|
|
int |
count |
|
) |
| |
|
static |
Return a new table that contains a copy of the data in array.
- Parameters
-
array | contiguous array of data for all elements to be copied. |
elemSize | byte-length for a given element. |
count | the number of entries to be copied out of array. The number of bytes that will be copied is count * elemSize. |
static sk_sp<SkDataTable> SkDataTable::MakeCopyArrays |
( |
const void *const * |
ptrs, |
|
|
const size_t |
sizes[], |
|
|
int |
count |
|
) |
| |
|
static |
Return a new DataTable that contains a copy of the data stored in each "array".
- Parameters
-
ptrs | array of points to each element to be copied into the table. |
sizes | array of byte-lengths for each entry in the corresponding ptrs[] array. |
count | the number of array elements in ptrs[] and sizes[] to copy. |
The documentation for this class was generated from the following file: