class Path

Declaration

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

Description

A "cursor" marking a position within a Value. The Value is a tree, and this is the path from the root to the current node. This is used to associate errors with particular subobjects.

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

Member Variables

private const llvm::json::Path* Parent
private llvm::json::Path::Segment Seg

Method Overview

  • public Path(llvm::json::Path::Root & R)
  • private Path(const llvm::json::Path * Parent, llvm::json::Path::Segment S)
  • public llvm::json::Path field(llvm::StringRef Field) const
  • public llvm::json::Path index(unsigned int Index) const
  • public void report(llvm::StringLiteral Message)

Methods

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

Description

The root may be treated as a Path.

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

Parameters

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

Path(const llvm::json::Path* Parent,
     llvm::json::Path::Segment S)

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

Parameters

const llvm::json::Path* Parent
llvm::json::Path::Segment S

llvm::json::Path field(
    llvm::StringRef Field) const

Description

Derives a path for an object field: this.Field

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

Parameters

llvm::StringRef Field

llvm::json::Path index(unsigned int Index) const

Description

Derives a path for an array element: this[Index]

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

Parameters

unsigned int Index

void report(llvm::StringLiteral Message)

Description

Records that the value at the current path is invalid. Message is e.g. "expected number" and becomes part of the final error. This overwrites any previously written error message in the root.

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

Parameters

llvm::StringLiteral Message