MLIR  16.0.0git
Public Member Functions | Static Public Member Functions | Friends | List of all members
mlir::lsp::URIForFile Class Reference

URI in "file" scheme for a file. More...

#include "Tools/lsp-server-support/Protocol.h"

Public Member Functions

 URIForFile ()=default
 
StringRef file () const
 Returns the absolute path to the file. More...
 
StringRef uri () const
 Returns the original uri of the file. More...
 
 operator bool () const
 

Static Public Member Functions

static llvm::Expected< URIForFilefromURI (StringRef uri)
 Try to build a URIForFile from the given URI string. More...
 
static llvm::Expected< URIForFilefromFile (StringRef absoluteFilepath)
 Try to build a URIForFile from the given absolute file path. More...
 

Friends

bool operator== (const URIForFile &lhs, const URIForFile &rhs)
 
bool operator!= (const URIForFile &lhs, const URIForFile &rhs)
 
bool operator< (const URIForFile &lhs, const URIForFile &rhs)
 

Detailed Description

URI in "file" scheme for a file.

Definition at line 99 of file Protocol.h.

Constructor & Destructor Documentation

◆ URIForFile()

mlir::lsp::URIForFile::URIForFile ( )
default

Referenced by fromURI().

Member Function Documentation

◆ file()

StringRef mlir::lsp::URIForFile::file ( ) const
inline

◆ fromFile()

llvm::Expected< URIForFile > URIForFile::fromFile ( StringRef  absoluteFilepath)
static

Try to build a URIForFile from the given absolute file path.

Definition at line 222 of file Protocol.cpp.

References fromURI(), uri(), and uriFromAbsolutePath().

Referenced by mlir::lsp::gatherIncludeFiles(), getLocationFromLoc(), getURIFromLoc(), and llvm::yaml::MappingTraits< YamlFileInfo >::mapping().

◆ fromURI()

llvm::Expected< URIForFile > URIForFile::fromURI ( StringRef  uri)
static

Try to build a URIForFile from the given URI string.

Definition at line 215 of file Protocol.cpp.

References parseFilePathFromURI(), and URIForFile().

Referenced by fromFile(), and mlir::lsp::fromJSON().

◆ operator bool()

mlir::lsp::URIForFile::operator bool ( ) const
inlineexplicit

Definition at line 115 of file Protocol.h.

◆ uri()

StringRef mlir::lsp::URIForFile::uri ( ) const
inline

Returns the original uri of the file.

Definition at line 113 of file Protocol.h.

Referenced by fromFile(), mlir::lsp::operator<<(), and mlir::lsp::toJSON().

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const URIForFile lhs,
const URIForFile rhs 
)
friend

Definition at line 120 of file Protocol.h.

◆ operator<

bool operator< ( const URIForFile lhs,
const URIForFile rhs 
)
friend

Definition at line 123 of file Protocol.h.

◆ operator==

bool operator== ( const URIForFile lhs,
const URIForFile rhs 
)
friend

Definition at line 117 of file Protocol.h.


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