52 if (removeFromCacheEntryIdx < _cache.size()) {
53 _cache.erase(_cache.begin() + removeFromCacheEntryIdx, _cache.end());
63 if (removeFromCacheEntryIdx < _cache.size()) {
64 _cache.erase(_cache.begin() + removeFromCacheEntryIdx, _cache.end());
155 for (
auto i = 0; i < seekCount; i++) {
172 if (l < 1)
return -1;
174 if (u0 >= 0 && u0 <= 127) {
187 if (u0 >= 192 && u0 <= 223) {
191 return (u0 - 192) * 64 + (u1 - 128);
193 if (u0 == 0xed && (u1 & 0xa0) == 0xa0) {
206 if (u0 >= 224 && u0 <= 239) {
210 return (u0 - 224) * 4096 + (u1 - 128) * 64 + (u2 - 128);
219 if (u0 >= 240 && u0 <= 247) {
223 return (u0 - 240) * 262144 + (u1 - 128) * 4096 + (u2 - 128) * 64 + (u3 - 128);
244 if (
cache !=
nullptr) {
vector< UTF8PositionCacheEntry > characterCache
static constexpr int CACHE_ENTRY_SIZE
vector< UTF8PositionCacheEntry > binaryCache
void removeCache()
Remove cache.
void removeCache(int binaryIdx, int characterIdx)
Remove from cache by binary index.
UTF8 string character iterator.
int getBinaryPosition() const
void seekBinaryPosition(int position) const
Set underlying binary buffer position.
int getCharacterPosition() const
const string & stringReference
void addCacheEntry() const
Add cache entry.
void seekCharacterPosition(int position) const
Seek character position.
UTF8PositionCache * cache
UTF8PositionCacheEntry(int binaryPosition, int characterPosition)
#define FORBID_CLASS_COPY(CLASS)