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

Function parse_data_mtimes

src/resource/data_compiler.cpp:340–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340static void parse_data_mtimes(HashMap<StringId64, u64> &mtimes
341 , const HashMap<StringId64, DynamicString> &data_index
342 , Buffer &json
343 )
344{
345 TempAllocator128 ta;
346 JsonObject obj(ta);
347 sjson::parse(obj, json);
348
349 auto cur = json_object::begin(obj);
350 auto end = json_object::end(obj);
351 for (; cur != end; ++cur) {
352 JSON_OBJECT_SKIP_HOLE(obj, cur);
353
354 StringId64 id;
355 id.parse(cur->first.data());
356
357 // Skip reading data that belongs to non-existent source file.
358 if (!hash_map::has(data_index, id))
359 continue;
360
361 TempAllocator64 ta;
362 DynamicString mtime_json(ta);
363 sjson::parse_string(mtime_json, cur->second);
364
365 u64 mtime = strtoull(mtime_json.c_str(), NULL, 10);
366 hash_map::set(mtimes, id, mtime);
367 }
368}
369
370static void read_data_mtimes(HashMap<StringId64, u64> &mtimes
371 , FilesystemDisk &data_fs

Callers 1

read_data_mtimesFunction · 0.85

Calls 9

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

Tested by

no test coverage detected