Added is_system header file property to JSON include diagram generator
This commit is contained in:
@@ -67,10 +67,10 @@ TEST_CASE("t40001", "[test-case][include]")
|
||||
REQUIRE(IsFolder(j, "include/lib1"));
|
||||
REQUIRE(IsFolder(j, "src"));
|
||||
|
||||
REQUIRE(IsFile(j, "include/lib1/lib1.h"));
|
||||
REQUIRE(IsFile(j, "include/t40001_include1.h"));
|
||||
REQUIRE(IsHeader(j, "include/lib1/lib1.h"));
|
||||
REQUIRE(IsHeader(j, "include/t40001_include1.h"));
|
||||
REQUIRE(IsFile(j, "src/t40001.cc"));
|
||||
REQUIRE(IsFile(j, "yaml-cpp/yaml.h"));
|
||||
REQUIRE(IsSystemHeader(j, "yaml-cpp/yaml.h"));
|
||||
|
||||
REQUIRE(IsFile(j, "string"));
|
||||
|
||||
|
||||
@@ -1391,6 +1391,20 @@ bool IsFile(const nlohmann::json &j, const std::string &name)
|
||||
return e && e->at("type") == "file";
|
||||
}
|
||||
|
||||
bool IsSystemHeader(const nlohmann::json &j, const std::string &name)
|
||||
{
|
||||
auto e = get_element(j, name);
|
||||
return e && e->at("type") == "file" && e->at("file_kind") == "header" &&
|
||||
e->at("is_system");
|
||||
}
|
||||
|
||||
bool IsHeader(const nlohmann::json &j, const std::string &name)
|
||||
{
|
||||
auto e = get_element(j, name);
|
||||
return e && e->at("type") == "file" && e->at("file_kind") == "header" &&
|
||||
!e->at("is_system");
|
||||
}
|
||||
|
||||
bool IsDeprecated(const nlohmann::json &j, const std::string &name)
|
||||
{
|
||||
auto e = get_element(j, expand_name(j, name));
|
||||
|
||||
Reference in New Issue
Block a user