Flutter Engine
The Flutter Engine
|
#include <SkDataTable.h>
Public Types | |
typedef void(* | FreeProc) (void *context) |
Public Member Functions | |
bool | isEmpty () const |
int | count () const |
size_t | atSize (int index) const |
const void * | at (int index, size_t *size=nullptr) const |
template<typename T > | |
const T * | atT (int index, size_t *size=nullptr) const |
const char * | atStr (int index) const |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
virtual | ~SkRefCntBase () |
bool | unique () const |
void | ref () const |
void | unref () const |
Static Public Member Functions | |
static sk_sp< SkDataTable > | MakeEmpty () |
static sk_sp< SkDataTable > | MakeCopyArrays (const void *const *ptrs, const size_t sizes[], int count) |
static sk_sp< SkDataTable > | MakeCopyArray (const void *array, size_t elemSize, int count) |
static sk_sp< SkDataTable > | MakeArrayProc (const void *array, size_t elemSize, int count, FreeProc proc, void *context) |
Friends | |
class | SkDataTableBuilder |
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.
Definition at line 23 of file SkDataTable.h.
typedef void(* SkDataTable::FreeProc) (void *context) |
Definition at line 66 of file SkDataTable.h.
const void * SkDataTable::at | ( | int | index, |
size_t * | size = nullptr |
||
) | 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.
size | If non-null, this returns the byte size of this entry. This will be the same value that atSize(index) would return. |
Definition at line 67 of file SkDataTable.cpp.
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.
Definition at line 57 of file SkDataTable.cpp.
|
inline |
Returns the index'th entry as a c-string, and assumes that the trailing null byte had been copied into the table as well.
Definition at line 59 of file SkDataTable.h.
|
inline |
Definition at line 51 of file SkDataTable.h.
|
inline |
Return the number of entries in the table. 0 for an empty table
Definition at line 33 of file SkDataTable.h.
|
inline |
Returns true if the table is empty (i.e. has no entries).
Definition at line 28 of file SkDataTable.h.
|
static |
Definition at line 130 of file SkDataTable.cpp.
|
static |
Return a new table that contains a copy of the data in array.
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. |
Definition at line 118 of file SkDataTable.cpp.
|
static |
Return a new DataTable that contains a copy of the data stored in each "array".
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. |
Definition at line 92 of file SkDataTable.cpp.
|
static |
Definition at line 85 of file SkDataTable.cpp.
|
friend |
Definition at line 117 of file SkDataTable.h.
const Dir* SkDataTable::fDir |
Definition at line 104 of file SkDataTable.h.
const char* SkDataTable::fElems |
Definition at line 105 of file SkDataTable.h.