cpp

package
v0.4.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cpp implements a gorisk analyzer for C/C++ projects. It supports vcpkg.json, conanfile.py, and conanfile.txt.

Package cpp implements a gorisk analyzer for C/C++ projects. It supports vcpkg.json, conanfile.py, and conanfile.txt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildIRGraph

func BuildIRGraph(g *graph.DependencyGraph) ir.IRGraph

BuildIRGraph constructs a function-level IR graph from a DependencyGraph by recursively parsing C/C++ source files in each package directory.

func Detect

func Detect(dir string) capability.CapabilitySet

Detect walks C/C++ source files in dir and returns the combined capability set.

func DetectFunctions

func DetectFunctions(dir, pkgName string, files []string) (map[string]ir.FunctionCaps, []ir.CallEdge, error)

DetectFunctions parses C/C++ source files in dir and returns per-function capability sets and call edges.

Types

type Adapter

type Adapter struct{}

Adapter implements the analyzer.Adapter interface for C/C++ projects.

func (Adapter) Load

func (Adapter) Load(dir string) (*graph.DependencyGraph, error)

Load parses the C/C++ dependency manifest in dir, detects capabilities from source files, and returns a *graph.DependencyGraph.

func (Adapter) Name

func (Adapter) Name() string

Name returns the language identifier for this adapter.

type CppFunction

type CppFunction struct {
	Name      string
	StartLine int
	EndLine   int
	Body      string
}

CppFunction represents a C/C++ function found in source.

type CppPackage

type CppPackage struct {
	Name         string
	Version      string
	Direct       bool
	Dependencies []string
}

CppPackage represents a C/C++ dependency extracted from a package manifest.

func Load

func Load(dir string) (pkgs []CppPackage, retErr error)

Load detects and parses the C/C++ dependency manifest in dir. Priority: vcpkg.json → conanfile.py → conanfile.txt Load never panics; it returns a structured error on failure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL