C and C++ Binaries C# Java

Description: Directories

API functions provide access to basic information about directories and support various traversals over the file system.

Language Module Support: Internal representation for directories is available for C/C++, binary, C#, and Java analyses.



Available Information

CodeSonar deduces a hierarchy of file system directories by inspecting the paths of all the source files contained in a project. In general, this deduced hierarchy will be a strict subset of the full file system structure, since directories will only be included if they directly or transitively contain source files belonging to the project.

API functions provide access to directory information as follows.

Given: Obtain:
<nothing>
  • The set of file system 'root' directories deduced by CodeSonar.
directory
  • Unnormalized directory path.
  • Normalized directory path.
    • Windows: this is the downcased version of the unnormalized directory path, with backslash directory separators replaced by forward slashes.
    • Mac: this is the downcased version of the unnormalized directory path.
    • Otherwise: this is the same as the unnormalized directory path.
  • Directory depth (distance from root).
  • The parent directory, if any.
  • The immediate child directories.
  • The source files immediately contained in the directory.

Links

By API implementation:

Language Directory Functionality and Types Provided By Directory Type
C++ class directory class directory
Python class directory class directory
C Header cs_directory.h typedef cs_directory

See also: