MCPcopy Create free account
hub / github.com/ddnet/ddnet / str_utf8_stats

Function str_utf8_stats

src/base/str.cpp:1253–1271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1251}
1252
1253void str_utf8_stats(const char *str, size_t max_size, size_t max_count, size_t *size, size_t *count)
1254{
1255 const char *cursor = str;
1256 *size = 0;
1257 *count = 0;
1258 while(*size < max_size && *count < max_count)
1259 {
1260 if(str_utf8_decode(&cursor) == 0)
1261 {
1262 break;
1263 }
1264 if((size_t)(cursor - str) >= max_size)
1265 {
1266 break;
1267 }
1268 *size = cursor - str;
1269 ++(*count);
1270 }
1271}
1272
1273size_t str_utf8_offset_bytes_to_chars(const char *str, size_t byte_offset)
1274{

Callers 4

SetRangeMethod · 0.85
UpdateStrDataMethod · 0.85
LoadSkinPartMethod · 0.85
TESTFunction · 0.85

Calls 1

str_utf8_decodeFunction · 0.85

Tested by 1

TESTFunction · 0.68