LLVM 22.0.0git
llvm::json::Path::Root Class Reference

The root is the trivial Path to the root value. More...

#include "llvm/Support/JSON.h"

Public Member Functions

 Root (llvm::StringRef Name="")
 Root (Root &&)=delete
Rootoperator= (Root &&)=delete
 Root (const Root &)=delete
Rootoperator= (const Root &)=delete
LLVM_ABI Error getError () const
 Returns the last error reported, or else a generic error.
LLVM_ABI void printErrorContext (const Value &, llvm::raw_ostream &) const
 Print the root value with the error shown inline as a comment.

Friends

LLVM_ABI friend void Path::report (llvm::StringLiteral Message)

Detailed Description

The root is the trivial Path to the root value.

It also stores the latest reported error and the path where it occurred.

Definition at line 713 of file JSON.h.

Constructor & Destructor Documentation

◆ Root() [1/3]

llvm::json::Path::Root::Root ( llvm::StringRef Name = "")
inline

Definition at line 721 of file JSON.h.

Referenced by operator=(), operator=(), Root(), and Root().

◆ Root() [2/3]

llvm::json::Path::Root::Root ( Root && )
delete

References Root().

◆ Root() [3/3]

llvm::json::Path::Root::Root ( const Root & )
delete

References Root().

Member Function Documentation

◆ getError()

Error llvm::json::Path::Root::getError ( ) const

Returns the last error reported, or else a generic error.

Definition at line 219 of file JSON.cpp.

References llvm::createStringError(), llvm::inconvertibleErrorCode(), and llvm::reverse().

Referenced by llvm::lsp::MessageHandler::parse().

◆ operator=() [1/2]

Root & llvm::json::Path::Root::operator= ( const Root & )
delete

References LLVM_ABI, and Root().

◆ operator=() [2/2]

Root & llvm::json::Path::Root::operator= ( Root && )
delete

References Root().

◆ printErrorContext()

void llvm::json::Path::Root::printErrorContext ( const Value & R,
llvm::raw_ostream & OS ) const

Print the root value with the error shown inline as a comment.

Unrelated parts of the value are elided for brevity, e.g. { "id": 42, "name": /* expected string *‍/ null, "properties": { ... } }

Definition at line 300 of file JSON.cpp.

References A(), llvm::json::abbreviate(), llvm::json::abbreviateChildren(), llvm::json::OStream::array(), llvm::json::OStream::attributeBegin(), llvm::json::OStream::attributeEnd(), llvm::json::OStream::comment(), llvm::json::OStream::object(), llvm::json::Path::Path(), and llvm::json::sortedElements().

Referenced by llvm::lsp::MessageHandler::parse().

◆ Path::report

LLVM_ABI friend void Path::report ( llvm::StringLiteral Message)
friend

References LLVM_ABI.


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