LLVM: llvm::DataExtractor::Cursor Class Reference (original) (raw)
A class representing a position in a DataExtractor, as well as any error encountered during extraction. More...
#include "[llvm/Support/DataExtractor.h](DataExtractor%5F8h%5Fsource.html)"
| 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 this Cursor. | |
| 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 this Cursor, if any. |
| Friends | |
|---|---|
| class | DataExtractor |
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.
Definition at line 51 of file DataExtractor.h.
| llvm::DataExtractor::Cursor::Cursor ( uint64_t Offset) | inlineexplicit |
|---|
◆ operator bool()
| llvm::DataExtractor::Cursor::operator bool ( ) | 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 call takeError() instead.
Definition at line 64 of file DataExtractor.h.
◆ seek()
| void llvm::DataExtractor::Cursor::seek ( uint64_t NewOffSet) | inline |
|---|
Set the cursor to the new offset. This does not impact the error state.
Definition at line 71 of file DataExtractor.h.
◆ takeError()
| Error llvm::DataExtractor::Cursor::takeError ( ) | inline |
|---|
◆ tell()
| uint64_t llvm::DataExtractor::Cursor::tell ( ) const | inline |
|---|
◆ DataExtractor
The documentation for this class was generated from the following file:
- include/llvm/Support/DataExtractor.h