class DataExtractor::Cursor

Declaration

class DataExtractor::Cursor { /* full declaration omitted */ };

Description

A class representing a position in a DataExtractor, as well as any error encountered during extraction. It enables one to extract a sequence of values without error-checking and then checking for errors in bulk at the end. The class holds an Error object, so failing to check the result of the parse will result in a runtime error. The error flag is sticky and will cause all subsequent extraction functions to fail without even attempting to parse and without updating the Cursor offset. After clearing the error flag, one can again use the Cursor object for parsing.

Declared at: llvm/include/llvm/Support/DataExtractor.h:54

Method Overview

Methods

Cursor(uint64_t Offset)

Description

Construct a cursor for extraction from the given offset.

Declared at: llvm/include/llvm/Support/DataExtractor.h:62

Parameters

uint64_t Offset

bool operator bool()

Description

Checks whether the cursor is valid (i.e. no errors were encountered). In case of errors, this does not clear the error flag -- one must call takeError() instead.

Declared at: llvm/include/llvm/Support/DataExtractor.h:67

llvm::Error takeError()

Description

Return error contained inside this Cursor, if any. Clears the internal Cursor state.

Declared at: llvm/include/llvm/Support/DataExtractor.h:75

uint64_t tell() const

Description

Return the current position of this Cursor. In the error state this is the position of the Cursor before the first error was encountered.

Declared at: llvm/include/llvm/Support/DataExtractor.h:71