cpp

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package cpp provides a documentation source adapter that parses C++ library source code from a local clone of any C++ GitHub repository (Boost, Qt, Abseil, etc.). It uses tree-sitter C++ grammar to extract classes, structs, functions, templates, namespaces, enums, type aliases, and concepts, and parses Doxygen documentation comments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAbseilFactory

func NewAbseilFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewAbseilFactory creates a Source for the Abseil C++ library.

func NewAsioFactory

func NewAsioFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewAsioFactory creates a Source for the Boost.Asio networking library. Replaces the boostorg/boost super-project, which is an empty shell of git submodules and contains no crawlable headers.

func NewCatch2Factory

func NewCatch2Factory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewCatch2Factory creates a Source for the Catch2 testing framework.

func NewCinderFactory

func NewCinderFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewCinderFactory creates a Source for the Cinder creative framework.

func NewCppCMSFactory

func NewCppCMSFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewCppCMSFactory creates a Source for the CppCMS web framework.

func NewCrowFactory

func NewCrowFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewCrowFactory creates a Source for the Crow micro web framework.

func NewDrogonFactory

func NewDrogonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewDrogonFactory creates a Source for the Drogon async web framework.

func NewEigenFactory

func NewEigenFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewEigenFactory creates a Source for the Eigen linear algebra library.

func NewFmtFactory

func NewFmtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewFmtFactory creates a Source for the fmt formatting library.

func NewGRPCFactory

func NewGRPCFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewGRPCFactory creates a Source for the gRPC C++ library.

func NewGoogleTestFactory

func NewGoogleTestFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewGoogleTestFactory creates a Source for Google Test.

func NewJUCEFactory

func NewJUCEFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewJUCEFactory creates a Source for the JUCE audio/app framework.

func NewLibstdcppFactory

func NewLibstdcppFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewLibstdcppFactory creates a Source for the GNU libstdc++ standard library.

func NewNlohmannJsonFactory

func NewNlohmannJsonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewNlohmannJsonFactory creates a Source for the nlohmann/json library.

func NewOatppFactory

func NewOatppFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewOatppFactory creates a Source for the Oat++ web framework.

func NewOpenCVFactory

func NewOpenCVFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewOpenCVFactory creates a Source for the OpenCV computer vision library.

func NewPistacheFactory

func NewPistacheFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewPistacheFactory creates a Source for the Pistache REST framework.

func NewPocoFactory

func NewPocoFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewPocoFactory creates a Source for the Poco C++ Libraries.

func NewQtFactory

func NewQtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewQtFactory creates a Source for the Qt framework.

func NewSpdlogFactory

func NewSpdlogFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewSpdlogFactory creates a Source for the spdlog logging library.

func NewTreeFrogFactory

func NewTreeFrogFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewTreeFrogFactory creates a Source for the TreeFrog MVC web framework.

func NewWtFactory

func NewWtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewWtFactory creates a Source for the Wt web toolkit framework.

func NewWxWidgetsFactory

func NewWxWidgetsFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)

NewWxWidgetsFactory creates a Source for the wxWidgets GUI framework.

Types

type Config

type Config struct {
	// RepoPath is the local filesystem path to the downloaded source.
	RepoPath string

	// LibraryID is the canonical library ID (e.g., "cpp/boost", "cpp/abseil").
	LibraryID string

	// Name is the display name (e.g., "Boost", "Abseil").
	Name string

	// Description is a short description of the library.
	Description string

	// SourceURL is the GitHub URL (e.g., "https://github.com/abseil/abseil-cpp").
	SourceURL string

	// Version is the library version tag.
	Version string

	// IncludeDirs lists relative directory paths that contain public headers.
	// If empty, defaults to {"include"}.
	IncludeDirs []string

	// SkipDirs lists relative directory paths to exclude from discovery.
	// Common patterns like "internal", "detail", "impl" are always skipped.
	SkipDirs []string

	// Ref is the git ref for source-code links. Defaults to "main".
	Ref string
}

Config holds the configuration for a C++ library source.

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the C++ documentation source adapter implementing source.Source.

func New

func New(cfg Config) *Source

New constructs a new C++ Source with the given config.

func (*Source) DetectWrapper

func (s *Source) DetectWrapper(method *source.Method) (bool, string, string)

DetectWrapper analyzes a method for wrapper/delegation patterns.

func (*Source) DiscoverEntities

func (s *Source) DiscoverEntities(ctx context.Context, fetch source.FetchFunc) ([]string, error)

DiscoverEntities walks the local repository and returns entity identifiers.

func (*Source) ID

func (s *Source) ID() string

ID returns the canonical library ID.

func (*Source) Meta

func (s *Source) Meta() source.LibraryMeta

Meta returns metadata for the library record.

func (*Source) ParseEntity

func (s *Source) ParseEntity(ctx context.Context, entityID string, content []byte) (*source.Entity, []string, error)

ParseEntity parses a single entity from file content.

func (*Source) ParseMethod

func (s *Source) ParseMethod(ctx context.Context, methodID string, content []byte) (*source.Method, error)

ParseMethod parses a single method/function from file content.

func (*Source) ParseSourceCode

func (s *Source) ParseSourceCode(entityID string, content []byte) (string, error)

ParseSourceCode extracts the source code of a specific entity.

func (*Source) ResolveWrapperURL

func (s *Source) ResolveWrapperURL(targetName, targetKind, entitySlug string) string

ResolveWrapperURL constructs a target identifier for a wrapped function.

Jump to

Keyboard shortcuts

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