MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / get_message_value_list

Method get_message_value_list

compat/optimized_translation_extractor.cpp:330–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void OptimizedTranslationExtractor::get_message_value_list(List<StringName> *r_messages) const {
331 int htsize = hash_table.size();
332
333 if (htsize == 0) {
334 return;
335 }
336
337 const int *htr = hash_table.ptr();
338 const uint32_t *htptr = (const uint32_t *)&htr[0];
339 const int *btr = bucket_table.ptr();
340 const uint32_t *btptr = (const uint32_t *)&btr[0];
341 const uint8_t *sr = strings.ptr();
342 const char *sptr = (const char *)&sr[0];
343
344 for (int i = 0; i < htsize; i++) {
345 uint32_t p = htptr[i];
346 if (p == 0xFFFFFFFF) {
347 continue;
348 }
349 const Bucket &bucket = *(const Bucket *)&btptr[p];
350 for (int j = 0; j < bucket.size; j++) {
351 String rstr;
352 if (bucket.elem[j].comp_size == bucket.elem[j].uncomp_size) {
353 rstr.append_utf8(&sptr[bucket.elem[j].str_offset], bucket.elem[j].uncomp_size);
354 } else {
355 CharString uncomp;
356 uncomp.resize_uninitialized(bucket.elem[j].uncomp_size + 1);
357 smaz_decompress(&sptr[bucket.elem[j].str_offset], bucket.elem[j].comp_size, uncomp.ptrw(), bucket.elem[j].uncomp_size);
358 rstr.append_utf8(uncomp.get_data());
359 }
360 r_messages->push_back(rstr);
361 }
362 }
363}
364
365String OptimizedTranslationExtractor::get_message_multipart_str(const char *part1, const char *part2, const char *part3, const char *part4, const char *part5, const char *part6) const {
366 int htsize = hash_table.size();

Callers

nothing calls this directly

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
get_dataMethod · 0.45

Tested by

no test coverage detected