Documentation
¶
Index ¶
- func FilterPublicHeaderFile(file FileEntry) bool
- func IsHeaderFile(name string) bool
- func ListFiles(dir string, recursive bool) iter.Seq2[FileEntry, error]
- func ListFilterFiles(dir string, recursive bool, filter FilterFunc) iter.Seq2[FileEntry, error]
- func ListIncludes(headerFile string, includeDirs []string) (includeFiles iter.Seq2[string, bool], err error)
- func ScanIncludes(content []byte) iter.Seq[Include]
- func TopHeaders(headerDir string, recursive, rel bool, includeDirs []string) (topHeaders []string, err error)
- type FileEntry
- type FilterFunc
- type Include
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterPublicHeaderFile ¶ added in v0.10.2
FilterPublicHeaderFile is a filter function that returns true if the given file is a public header file (i.e., it does not start with an underscore and has a header file extension).
func IsHeaderFile ¶
IsHeaderFile checks if the given file name has a header file extension.
func ListFiles ¶
ListFiles returns a sequence of files in the specified directory. If recursive is true, it includes files in subdirectories as well.
func ListFilterFiles ¶ added in v0.10.2
ListFilterFiles returns a sequence of files in the specified directory that satisfy the filter function. If recursive is true, it includes files in subdirectories as well.
func ListIncludes ¶
func ListIncludes(headerFile string, includeDirs []string) (includeFiles iter.Seq2[string, bool], err error)
ListIncludes lists the include files for the specified header file. It returns a sequence of include file paths and a boolean indicating whether the file was found. The include file path is the resolved path when ok is true, and the raw include filename otherwise.
func ScanIncludes ¶ added in v0.10.2
ScanIncludes scans the given content for `#include` directives and returns a sequence of Include objects.
It parses the file in a single pass, correctly handling `#include` directives with spaces or tabs between `#` and `include`, and ignoring any `#include` occurrences found within comments or string/character literals.
Types ¶
type FilterFunc ¶ added in v0.10.2
FilterFunc defines a function type used to filter files in a directory.