 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
8 #ifndef SkDataTable_DEFINED
9 #define SkDataTable_DEFINED
12 #include "include/private/SkTDArray.h"
24 bool isEmpty()
const {
return 0 == fCount; }
29 int count()
const {
return fCount; }
44 const void*
at(
int index,
size_t* size =
nullptr)
const;
47 const T*
atT(
int index,
size_t* size =
nullptr)
const {
48 return reinterpret_cast<const T*
>(this->at(index, size));
55 const char*
atStr(
int index)
const {
57 const char* str = this->atT<const char>(index, &size);
62 typedef void (*FreeProc)(
void* context);
76 const size_t sizes[],
int count);
89 FreeProc proc,
void* context);
105 void* fFreeProcContext;
108 SkDataTable(
const void* array,
size_t elemSize,
int count,
109 FreeProc,
void* context);
110 SkDataTable(
const Dir*,
int count, FreeProc,
void* context);
113 friend class SkDataTableBuilder;
Definition: SkRefCnt.h:118
static sk_sp< SkDataTable > MakeCopyArray(const void *array, size_t elemSize, int count)
Return a new table that contains a copy of the data in array.
static sk_sp< SkDataTable > MakeEmpty()
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 int...
Definition: SkDataTable.h:55
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:215
#define SK_API
Definition: SkTypes.h:181
#define SkASSERT(cond)
Definition: SkTypes.h:460
static sk_sp< SkDataTable > MakeArrayProc(const void *array, size_t elemSize, int count, FreeProc proc, void *context)
const char * fElems
Definition: SkDataTable.h:101
const void * at(int index, size_t *size=nullptr) const
Return a pointer to the data of the index'th entry in the table.
Like SkData, SkDataTable holds an immutable data buffer.
Definition: SkDataTable.h:19
const T * atT(int index, size_t *size=nullptr) const
Definition: SkDataTable.h:47
size_t atSize(int index) const
Return the size of the index'th entry in the table.
const Dir * fDir
Definition: SkDataTable.h:100
bool isEmpty() const
Returns true if the table is empty (i.e.
Definition: SkDataTable.h:24
static sk_sp< SkDataTable > MakeCopyArrays(const void *const *ptrs, const size_t sizes[], int count)
Return a new DataTable that contains a copy of the data stored in each "array".
int count() const
Return the number of entries in the table.
Definition: SkDataTable.h:29