LLVM 22.0.0git
Transport.cpp File Reference
#include "llvm/Support/LSP/Transport.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LSP/Logging.h"
#include "llvm/Support/LSP/Protocol.h"
#include <atomic>
#include <optional>
#include <system_error>
#include <utility>

Go to the source code of this file.

Functions

static llvm::json::Object encodeError (llvm::Error Error)
 Encode the given error as a JSON object.
llvm::Error decodeError (const llvm::json::Object &O)
 Decode the given JSON object into an error.
LogicalResult readLine (std::FILE *In, SmallVectorImpl< char > &Out)
 Tries to read a line up to and including
.

Function Documentation

◆ decodeError()

llvm::Error decodeError ( const llvm::json::Object & O)

Decode the given JSON object into an error.

Definition at line 168 of file Transport.cpp.

References llvm::inconvertibleErrorCode(), llvm::make_error(), and llvm::StringRef::str().

◆ encodeError()

llvm::json::Object encodeError ( llvm::Error Error)
static

Encode the given error as a JSON object.

Definition at line 150 of file Transport.cpp.

References llvm::handleErrors(), llvm::Error::success(), llvm::toString(), and llvm::lsp::UnknownErrorCode.

Referenced by llvm::lsp::JSONTransport::reply().

◆ readLine()

LogicalResult readLine ( std::FILE * In,
SmallVectorImpl< char > & Out )