| 294 | } |
| 295 | |
| 296 | static 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 | |
| 325 | static void read_data_index(HashMap<StringId64, DynamicString> &index |
| 326 | , FilesystemDisk &data_fs |
no test coverage detected