MCPcopy Create free account
hub / github.com/LunarG/VulkanTools / CollectLayersPaths

Function CollectLayersPaths

vkconfig_core/path.cpp:600–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600std::vector<Path> CollectLayersPaths(const Path& directory) {
601 std::vector<Path> paths = CollectFilePaths(directory, "*json");
602
603 std::vector<Path> results;
604 for (std::size_t i = 0, n = paths.size(); i < n; ++i) {
605 const QJsonDocument& document = ::ParseJsonFile(paths[i].AbsolutePath().c_str());
606 if (document.isNull() || document.isEmpty()) {
607 continue;
608 }
609
610 const QJsonObject& json_root_object = document.object();
611 if (json_root_object.value("file_format_version") == QJsonValue::Undefined) {
612 continue; // Not a layer JSON file
613 }
614
615 if (json_root_object.value("layer") == QJsonValue::Undefined && json_root_object.value("layers") == QJsonValue::Undefined) {
616 continue;
617 }
618
619 results.push_back(paths[i]);
620 }
621
622 return results;
623}
624
625std::vector<Path> CollectDriversPaths(const Path& directory) {
626 std::vector<Path> paths = CollectFilePaths(directory, "*json");

Callers 2

Calls 3

CollectFilePathsFunction · 0.85
ParseJsonFileFunction · 0.85
AbsolutePathMethod · 0.80

Tested by

no test coverage detected