MCPcopy Create free account
hub / github.com/crownengine/crown / parse_data_index

Function parse_data_index

src/resource/data_compiler.cpp:296–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296static void parse_data_index(HashMap<StringId64, DynamicString> &index
297 , const SourceIndex &sources
298 , Buffer &json
299 )
300{
301 TempAllocator512 ta;
302 JsonObject obj(ta);
303 sjson::parse(obj, json);
304
305 auto cur = json_object::begin(obj);
306 auto end = json_object::end(obj);
307 for (; cur != end; ++cur) {
308 JSON_OBJECT_SKIP_HOLE(obj, cur);
309
310 TempAllocator256 ta;
311 DynamicString path(ta);
312 sjson::parse_string(path, cur->second);
313
314 // Skip reading data that belongs to non-existent source file.
315 if (!hash_map::has(sources._paths, path))
316 continue;
317
318 StringId64 id;
319 id.parse(cur->first.data());
320
321 hash_map::set(index, id, path);
322 }
323}
324
325static void read_data_index(HashMap<StringId64, DynamicString> &index
326 , FilesystemDisk &data_fs

Callers 1

read_data_indexFunction · 0.85

Calls 8

setClass · 0.85
parseFunction · 0.70
beginFunction · 0.50
endFunction · 0.50
parse_stringFunction · 0.50
hasFunction · 0.50
parseMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected