Flutter Engine
The Flutter Engine
|
Go to the source code of this file.
Classes | |
class | SkAutoAsciiToLC |
Macros | |
#define | SkCastForQSort(compare) reinterpret_cast<int (*)(const void*, const void*)>(compare) |
Functions | |
template<typename T , typename K , typename LESS > | |
int | SkTSearch (const T base[], int count, const K &key, size_t elemSize, const LESS &less) |
template<typename T , bool(LESS)(const T &, const T &) > | |
int | SkTSearch (const T base[], int count, const T &target, size_t elemSize) |
template<typename T > | |
int | SkTSearch (const T base[], int count, const T &target, size_t elemSize) |
template<typename T , bool(LESS)(const T &, const T &) > | |
int | SkTSearch (T *base[], int count, T *target, size_t elemSize) |
int | SkStrSearch (const char *const *base, int count, const char target[], size_t target_len, size_t elemSize) |
int | SkStrSearch (const char *const *base, int count, const char target[], size_t elemSize) |
int | SkStrLCSearch (const char *const *base, int count, const char target[], size_t target_len, size_t elemSize) |
int | SkStrLCSearch (const char *const *base, int count, const char target[], size_t elemSize) |
Definition at line 130 of file SkTSearch.h.
Definition at line 74 of file SkTSearch.cpp.
int SkStrLCSearch | ( | const char *const * | base, |
int | count, | ||
const char | target[], | ||
size_t | target_len, | ||
size_t | elemSize | ||
) |
Like SkStrSearch, but treats target as if it were all lower-case. Assumes that base points to a table of lower-case strings.
Definition at line 64 of file SkTSearch.cpp.
Definition at line 58 of file SkTSearch.cpp.
int SkStrSearch | ( | const char *const * | base, |
int | count, | ||
const char | target[], | ||
size_t | target_len, | ||
size_t | elemSize | ||
) |
Definition at line 22 of file SkTSearch.cpp.
All of the SkTSearch variants want to return the index (0...N-1) of the found element, or the bit-not of where to insert the element.
At a simple level, if the return value is negative, it was not found.
For clients that want to insert the new element if it was not found, use the following logic:
int index = SkTSearch(...); if (index >= 0) { // found at index } else { index = ~index; // now we are positive // insert at index }
Definition at line 41 of file SkTSearch.h.
Definition at line 75 of file SkTSearch.h.