LLVM 20.0.0git |
A class representing a position in aDataExtractor, as well as any error encountered during extraction.More...
#include "llvm/Support/DataExtractor.h"
Public Member Functions | |
Cursor (uint64_t Offset) | |
Construct a cursor for extraction from the given offset. | |
operator bool () | |
Checks whether the cursor is valid (i.e. | |
uint64_t | tell ()const |
Return the current position of thisCursor. | |
void | seek (uint64_t NewOffSet) |
Set the cursor to the new offset. This does not impact the error state. | |
Error | takeError () |
Return error contained inside thisCursor, if any. | |
Friends | |
class | DataExtractor |
A class representing a position in aDataExtractor, 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 anError 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 theCursor offset. After clearing the error flag, one can again use theCursor object for parsing.
Definition at line54 of fileDataExtractor.h.
| inlineexplicit |
Construct a cursor for extraction from the given offset.
Definition at line62 of fileDataExtractor.h.
| inlineexplicit |
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 calltakeError() instead.
Definition at line67 of fileDataExtractor.h.
| inline |
Set the cursor to the new offset. This does not impact the error state.
Definition at line74 of fileDataExtractor.h.
ReferencesOffset.
Referenced byllvm::ELFAttributeParser::parseSubsection().
| inline |
Return error contained inside thisCursor, if any.
Clears the internalCursor state.
Definition at line78 of fileDataExtractor.h.
Referenced byllvm::object::ELFFile< ELFT >::android_relas(),decodeBBAddrMapImpl(),llvm::object::decodeCrel(),llvm::ELFAttributeParser::parse(),llvm::DWARFDebugLine::LineTable::parse(),llvm::DWARFDebugLine::Prologue::parse(),llvm::ELFAttributeParser::parseSubsection(),llvm::ELFAttributeParser::~ELFAttributeParser(), andllvm::GCOVBuffer::~GCOVBuffer().
| inline |
Return the current position of thisCursor.
In the error state this is the position of theCursor before the first error was encountered.
Definition at line71 of fileDataExtractor.h.
ReferencesOffset.
Referenced bydecodeBBAddrMapImpl(),llvm::AMDGPUDisassembler::decodeKernelDescriptorDirective(),llvm::ELFAttributeParser::parse(),llvm::DWARFDebugLine::LineTable::parse(),llvm::DWARFDebugLine::Prologue::parse(),llvm::ELFAttributeParser::parseAttributeList(),llvm::ELFAttributeParser::parseSubsection(),llvm::GCOVFile::readGCDA(),llvm::GCOVFile::readGCNO(),llvm::GCOVBuffer::readInt(), andreadULEB128As().
| friend |
Definition at line58 of fileDataExtractor.h.