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=nullptr) 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=nullptr) 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. More...
|
|
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...
|
|
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.
◆ FreeProc
typedef void(* SkDataTable::FreeProc) (void *context) |
◆ at()
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.
- Parameters
-
size | If non-null, this returns the byte size of this entry. This will be the same value that atSize(index) would return. |
◆ atSize()
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.
◆ atStr()
const char* SkDataTable::atStr |
( |
int |
index | ) |
const |
|
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.
◆ atT()
template<typename T >
const T* SkDataTable::atT |
( |
int |
index, |
|
|
size_t * |
size = nullptr |
|
) |
| const |
|
inline |
◆ count()
int SkDataTable::count |
( |
| ) |
const |
|
inline |
Return the number of entries in the table.
0 for an empty table
◆ isEmpty()
bool SkDataTable::isEmpty |
( |
| ) |
const |
|
inline |
Returns true if the table is empty (i.e.
has no entries).
◆ MakeArrayProc()
static sk_sp<SkDataTable> SkDataTable::MakeArrayProc |
( |
const void * |
array, |
|
|
size_t |
elemSize, |
|
|
int |
count, |
|
|
FreeProc |
proc, |
|
|
void * |
context |
|
) |
| |
|
static |
◆ MakeCopyArray()
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. |
◆ MakeCopyArrays()
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. |
◆ MakeEmpty()
◆ ref()
void SkRefCntBase::ref |
( |
| ) |
const |
|
inlineinherited |
Increment the reference count.
Must be balanced by a call to unref().
◆ unique()
bool SkRefCntBase::unique |
( |
| ) |
const |
|
inlineinherited |
May return true if the caller is the only owner.
Ensures that all previous owner's actions are complete.
◆ unref()
void SkRefCntBase::unref |
( |
| ) |
const |
|
inlineinherited |
Decrement the reference count.
If the reference count is 1 before the decrement, then delete the object. Note that if this is the case, then the object needs to have been allocated via new, and not on the stack.
◆ SkDataTableBuilder
friend class SkDataTableBuilder |
|
friend |
◆ fDir
const Dir* SkDataTable::fDir |
◆ fElems
const char* SkDataTable::fElems |
The documentation for this class was generated from the following file: