FeatureSet ClassProperties::get_class_features()

in source/ClassProperties.cpp [321:352]


FeatureSet ClassProperties::get_class_features(
    const std::string& clazz,
    bool via_dependency) const {
  FeatureSet features;

  if (is_class_exported(clazz)) {
    features.add(features_.get("via-caller-exported"));
  }
  if (is_child_exposed(clazz)) {
    features.add(features_.get("via-child-exposed"));
  }
  if (is_class_unexported(clazz)) {
    features.add(features_.get("via-caller-unexported"));
  }
  if (has_permission(clazz)) {
    features.add(features_.get("via-caller-permission"));
  }
  if (has_protection_level(clazz)) {
    features.add(features_.get("via-caller-protection-level"));
  }

  // `via-public-dfa-scheme` feature only applies within the same class.
  if (!via_dependency && is_dfa_public(clazz)) {
    features.add(features_.get("via-public-dfa-scheme"));
  }
  if (via_dependency) {
    features.add(features_.get("via-dependency-graph"));
    features.add(features_.get(fmt::format("via-class:{}", clazz)));
  }

  return features;
}