MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _cpp_source_key

Function _cpp_source_key

graphify/extractors/resolution.py:4545–4558  ·  view source on GitHub ↗

Portable source/proof identity; the permitted corpus is checked separately.

(source_file: str | Path, root: Path)

Source from the content-addressed store, hash-verified

4543_DECLDEF_IMPL_SUFFIXES = frozenset({".m", ".mm", ".cpp", ".cc", ".cxx", ".c"})
4544
4545def _cpp_source_key(source_file: str | Path, root: Path) -> str:
4546 """Portable source/proof identity; the permitted corpus is checked separately."""
4547 if not source_file:
4548 return ""
4549 try:
4550 path = _resolve_cached(root / source_file)
4551 try:
4552 return os.path.relpath(path, _resolve_cached(root)).replace("\\", "/")
4553 except ValueError:
4554 # No relative path to a root on another Windows drive; the absolute
4555 # path is still a distinct identity for the file.
4556 return path.as_posix()
4557 except (OSError, RuntimeError, ValueError):
4558 return ""
4559
4560
4561def _cpp_reconciliation_paths(

Callers 5

extractFunction · 0.90
_cpp_exact_includesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected