clang-tools 10.0.0

Public Member Functions | Static Public Attributes | List of all members
clang::clangd::FileDistance Class Reference

`#include <FileDistance.h>`

Collaboration diagram for clang::clangd::FileDistance:
[legend]

## Public Member Functions
| FileDistance (llvm::StringMap< SourceParams > Sources, const FileDistanceOptions &Opts={})
unsigned | distance (llvm::StringRef Path)

## Static Public Attributes
static constexpr unsigned | Unreachable = std::numeric_limits<unsigned>::max()
static const llvm::hash_code | RootHash

## Detailed Description

Definition at line 72 of file FileDistance.h.

## Constructor & Destructor Documentation

## ◆ FileDistance()

clang::clangd::FileDistance::FileDistance | ( | llvm::StringMap< SourceParams > | Sources,
|  | const FileDistanceOptions & | Opts = `{}`
| ) |  |

Definition at line 58 of file FileDistance.cpp.

## Member Function Documentation

## ◆ distance()

unsigned clang::clangd::FileDistance::distance | ( | llvm::StringRef | Path | ) |

Definition at line 118 of file FileDistance.cpp.

References clang::clangd::FileDistanceOptions::AllowDownTraversalFromRoot, clang::clangd::canonicalize(), dlog, clang::clangd::FileDistanceOptions::DownCost, clang::clangd::hash_value(), RootHash, and Unreachable.

Referenced by clang::clangd::URIDistance::distance(), and clang::clangd::ScopeDistance::distance().

## Member Data Documentation

## ◆ RootHash

const llvm::hash_code clang::clangd::FileDistance::RootHash
| static

Initial value:
=
llvm::hash_value(llvm::StringRef("/"))

Definition at line 75 of file FileDistance.h.

Referenced by distance().

## ◆ Unreachable

constexpr const unsigned clang::clangd::FileDistance::Unreachable = std::numeric_limits<unsigned>::max()
| static

Definition at line 74 of file FileDistance.h.

Referenced by distance(), and clang::clangd::scopeBoost().

The documentation for this class was generated from the following files:

- FileDistance.h
- FileDistance.cpp