Skip to main content

parse_directory

Function parse_directory 

Source
pub fn parse_directory(
    root: &Path,
    args: &[String],
    parallel: bool,
    max_depth: Option<usize>,
    allow_system: bool,
) -> Result<Vec<(String, Vec<RawNode>)>, IcbError>
Expand description

Recursively discover C/C++ files under root and parse each one.

Only files with an extension in {c, cpp, cc, cxx, h, hpp} are processed. Symlinks are ignored to prevent infinite recursion.

§Arguments

  • root – Root directory for the walk.
  • args – Clang command‑line arguments shared by all files.
  • parallel – Distribute work across threads if true.
  • max_depth – Maximum directory depth (None for unlimited).
  • allow_system – Forwarded to parse_cpp_file.

§Errors

Returns IcbError::Io if the directory walk fails, or IcbError::Parse for the first file that fails.