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 ¶
- func NewAbseilFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewAsioFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewCatch2Factory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewCinderFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewCppCMSFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewCrowFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewDrogonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewEigenFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewFmtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewGRPCFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewGoogleTestFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewJUCEFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewLibstdcppFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewNlohmannJsonFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewOatppFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewOpenCVFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewPistacheFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewPocoFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewQtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewSpdlogFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewTreeFrogFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewWtFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- func NewWxWidgetsFactory(repoPath string, opts registry.FactoryOptions) (source.Source, error)
- type Config
- type Source
- func (s *Source) DetectWrapper(method *source.Method) (bool, string, string)
- func (s *Source) DiscoverEntities(ctx context.Context, fetch source.FetchFunc) ([]string, error)
- func (s *Source) ID() string
- func (s *Source) Meta() source.LibraryMeta
- func (s *Source) ParseEntity(ctx context.Context, entityID string, content []byte) (*source.Entity, []string, error)
- func (s *Source) ParseMethod(ctx context.Context, methodID string, content []byte) (*source.Method, error)
- func (s *Source) ParseSourceCode(entityID string, content []byte) (string, error)
- func (s *Source) ResolveWrapperURL(targetName, targetKind, entitySlug string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAbseilFactory ¶
NewAbseilFactory creates a Source for the Abseil C++ library.
func NewAsioFactory ¶
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 ¶
NewCatch2Factory creates a Source for the Catch2 testing framework.
func NewCinderFactory ¶
NewCinderFactory creates a Source for the Cinder creative framework.
func NewCppCMSFactory ¶
NewCppCMSFactory creates a Source for the CppCMS web framework.
func NewCrowFactory ¶
NewCrowFactory creates a Source for the Crow micro web framework.
func NewDrogonFactory ¶
NewDrogonFactory creates a Source for the Drogon async web framework.
func NewEigenFactory ¶
NewEigenFactory creates a Source for the Eigen linear algebra library.
func NewFmtFactory ¶
NewFmtFactory creates a Source for the fmt formatting library.
func NewGRPCFactory ¶
NewGRPCFactory creates a Source for the gRPC C++ library.
func NewGoogleTestFactory ¶
NewGoogleTestFactory creates a Source for Google Test.
func NewJUCEFactory ¶
NewJUCEFactory creates a Source for the JUCE audio/app framework.
func NewLibstdcppFactory ¶
NewLibstdcppFactory creates a Source for the GNU libstdc++ standard library.
func NewNlohmannJsonFactory ¶
NewNlohmannJsonFactory creates a Source for the nlohmann/json library.
func NewOatppFactory ¶
NewOatppFactory creates a Source for the Oat++ web framework.
func NewOpenCVFactory ¶
NewOpenCVFactory creates a Source for the OpenCV computer vision library.
func NewPistacheFactory ¶
NewPistacheFactory creates a Source for the Pistache REST framework.
func NewPocoFactory ¶
NewPocoFactory creates a Source for the Poco C++ Libraries.
func NewQtFactory ¶
NewQtFactory creates a Source for the Qt framework.
func NewSpdlogFactory ¶
NewSpdlogFactory creates a Source for the spdlog logging library.
func NewTreeFrogFactory ¶
NewTreeFrogFactory creates a Source for the TreeFrog MVC web framework.
func NewWtFactory ¶
NewWtFactory creates a Source for the Wt web toolkit framework.
func NewWxWidgetsFactory ¶
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 (*Source) DetectWrapper ¶
DetectWrapper analyzes a method for wrapper/delegation patterns.
func (*Source) DiscoverEntities ¶
DiscoverEntities walks the local repository and returns entity identifiers.
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 ¶
ParseSourceCode extracts the source code of a specific entity.
func (*Source) ResolveWrapperURL ¶
ResolveWrapperURL constructs a target identifier for a wrapped function.