LLVM 20.0.0git
Public Member Functions | Friends | List of all members
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
 
Error getError () const
 Returns the last error reported, or else a generic error.
 
void printErrorContext (const Value &, llvm::raw_ostream &) const
 Print the root value with the error shown inline as a comment.
 

Friends

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 702 of file JSON.h.

Constructor & Destructor Documentation

◆ Root() [1/3]

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

Definition at line 710 of file JSON.h.

◆ Root() [2/3]

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

◆ Root() [3/3]

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

Member Function Documentation

◆ getError()

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

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

Definition at line 226 of file JSON.cpp.

References llvm::createStringError(), llvm::StringRef::empty(), llvm::inconvertibleErrorCode(), OS, and llvm::reverse().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ 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 307 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(), if(), llvm::json::OStream::object(), OS, and llvm::json::sortedElements().

Friends And Related Function Documentation

◆ Path::report

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

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