class Path::Root

Declaration

class Path::Root { /* full declaration omitted */ };

Description

The root is the trivial Path to the root value. It also stores the latest reported error and the path where it occurred.

Declared at: llvm/include/llvm/Support/JSON.h:678

Member Variables

private llvm::StringRef Name
private llvm::StringLiteral ErrorMessage
private std::vector<Path::Segment> ErrorPath

Method Overview

  • public Root(llvm::StringRef Name = "")
  • public Root(llvm::json::Path::Root &&)
  • public Root(const llvm::json::Path::Root &)
  • public llvm::Error getError() const
  • public void printErrorContext(const llvm::json::Value &, llvm::raw_ostream &) const

Methods

Root(llvm::StringRef Name = "")

Declared at: llvm/include/llvm/Support/JSON.h:686

Parameters

llvm::StringRef Name = ""

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

Declared at: llvm/include/llvm/Support/JSON.h:688

Parameters

llvm::json::Path::Root&&

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

Declared at: llvm/include/llvm/Support/JSON.h:690

Parameters

const llvm::json::Path::Root&

llvm::Error getError() const

Description

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

Declared at: llvm/include/llvm/Support/JSON.h:694

void printErrorContext(const llvm::json::Value&,
                       llvm::raw_ostream&) const

Description

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": { ... } }

Declared at: llvm/include/llvm/Support/JSON.h:702

Parameters

const llvm::json::Value&
llvm::raw_ostream&