clang-tools 20.0.0git
Public Member Functions | Static Public Attributes | List of all members
clang::clangd::TestScheme Class Reference

unittest: is a scheme that refers to files relative to testRoot(). More...

Inheritance diagram for clang::clangd::TestScheme:
Inheritance graph
[legend]

Public Member Functions

llvm::Expected< std::string > getAbsolutePath (llvm::StringRef, llvm::StringRef Body, llvm::StringRef HintPath) const override
 Returns the absolute path of the file corresponding to the URI authority+body in the file system.
 
llvm::Expected< URIuriFromAbsolutePath (llvm::StringRef AbsolutePath) const override
 
- Public Member Functions inherited from clang::clangd::URIScheme
virtual ~URIScheme ()=default
 
virtual llvm::Expected< std::string > getAbsolutePath (llvm::StringRef Authority, llvm::StringRef Body, llvm::StringRef HintPath) const =0
 Returns the absolute path of the file corresponding to the URI authority+body in the file system.
 
virtual llvm::Expected< URIuriFromAbsolutePath (llvm::StringRef AbsolutePath) const =0
 
virtual llvm::Expected< std::string > getIncludeSpelling (const URI &U) const
 Returns the include path of the file (e.g.
 

Static Public Attributes

static const char * Scheme = "unittest"
 

Detailed Description

unittest: is a scheme that refers to files relative to testRoot().

URI body is a path relative to testRoot() e.g. unittest:///x.h for /clangd-test/x.h.

Definition at line 106 of file TestFS.cpp.

Member Function Documentation

◆ getAbsolutePath()

llvm::Expected< std::string > clang::clangd::TestScheme::getAbsolutePath ( llvm::StringRef  Authority,
llvm::StringRef  Body,
llvm::StringRef  HintPath 
) const
inlineoverridevirtual

Returns the absolute path of the file corresponding to the URI authority+body in the file system.

See URI::resolve for semantics of HintPath.

Implements clang::clangd::URIScheme.

Definition at line 111 of file TestFS.cpp.

References clang::clangd::error(), clang::clangd::pathStartsWith(), clang::clangd::testPath(), and clang::clangd::testRoot().

◆ uriFromAbsolutePath()

llvm::Expected< URI > clang::clangd::TestScheme::uriFromAbsolutePath ( llvm::StringRef  AbsolutePath) const
inlineoverridevirtual

Implements clang::clangd::URIScheme.

Definition at line 124 of file TestFS.cpp.

References clang::clangd::error(), and clang::clangd::testRoot().

Member Data Documentation

◆ Scheme

const char * clang::clangd::TestScheme::Scheme = "unittest"
static

Definition at line 108 of file TestFS.cpp.


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