LLVM  14.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. More...
 
void printErrorContext (const Value &, llvm::raw_ostream &) const
 Print the root value with the error shown inline as a comment. More...
 

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

Constructor & Destructor Documentation

◆ Root() [1/3]

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

Definition at line 651 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 222 of file JSON.cpp.

References llvm::createStringError(), llvm::StringRef::empty(), llvm::inconvertibleErrorCode(), llvm::reverse(), S, and llvm::raw_string_ostream::str().

◆ 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 llvm::json::OStream::array(), llvm::json::OStream::attributeBegin(), llvm::json::OStream::attributeEnd(), llvm::json::OStream::comment(), llvm::StringRef::equals(), llvm::json::Value::getAsArray(), llvm::json::Value::getAsObject(), if(), llvm::RISCVFenceField::O, llvm::json::OStream::object(), llvm::json::Path::Path(), and S.

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: