LLVM 22.0.0git
|
URI in "file" scheme for a file. More...
#include "llvm/Support/LSP/Protocol.h"
Public Member Functions | |
URIForFile ()=default | |
StringRef | file () const |
Returns the absolute path to the file. | |
StringRef | uri () const |
Returns the original uri of the file. | |
StringRef | scheme () const |
Return the scheme of the uri. | |
operator bool () const |
Static Public Member Functions | |
static llvm::Expected< URIForFile > | fromURI (StringRef uri) |
Try to build a URIForFile from the given URI string. | |
static llvm::Expected< URIForFile > | fromFile (StringRef absoluteFilepath, StringRef scheme="file") |
Try to build a URIForFile from the given absolute file path and optional scheme. | |
static void | registerSupportedScheme (StringRef scheme) |
Register a supported URI scheme. |
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) |
URI in "file" scheme for a file.
Definition at line 101 of file Protocol.h.
|
default |
References scheme(), and uri().
Referenced by fromURI(), operator!=, operator<, and operator==.
|
inline |
Returns the absolute path to the file.
Definition at line 114 of file Protocol.h.
|
static |
Try to build a URIForFile from the given absolute file path and optional scheme.
Definition at line 227 of file Protocol.cpp.
References fromURI(), llvm::Expected< T >::takeError(), and uriFromAbsolutePath().
|
static |
Try to build a URIForFile from the given URI string.
Definition at line 220 of file Protocol.cpp.
References parseFilePathFromURI(), llvm::StringRef::str(), llvm::Expected< T >::takeError(), and URIForFile().
Referenced by fromFile(), and llvm::lsp::fromJSON().
|
inlineexplicit |
Definition at line 122 of file Protocol.h.
|
static |
Register a supported URI scheme.
The protocol supports file by default, so this is only necessary for any additional schemes that a server wants to support.
Definition at line 238 of file Protocol.cpp.
References getSupportedSchemes(), and llvm::StringSet< AllocatorTy >::insert().
StringRef URIForFile::scheme | ( | ) | const |
Return the scheme of the uri.
Definition at line 236 of file Protocol.cpp.
References llvm::StringRef::split(), and uri().
Referenced by URIForFile().
|
inline |
Returns the original uri of the file.
Definition at line 117 of file Protocol.h.
Referenced by scheme(), and URIForFile().
|
friend |
Definition at line 127 of file Protocol.h.
References URIForFile().
|
friend |
Definition at line 130 of file Protocol.h.
References URIForFile().
|
friend |
Definition at line 124 of file Protocol.h.
References URIForFile().