LLVM 22.0.0git
FileOffset.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9/// \file
10/// This file declares interface for FileOffset that represent stored data at an
11/// offset from the beginning of a file.
12///
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CAS_FILEOFFSET_H
16#define LLVM_CAS_FILEOFFSET_H
17
18#include <cstdlib>
19
20namespace llvm::cas {
21
22/// FileOffset is a wrapper around `uint64_t` to represent the offset of data
23/// from the beginning of the file.
25public:
26 uint64_t get() const { return Offset; }
27
28 explicit operator bool() const { return Offset; }
29
30 FileOffset() = default;
31 explicit FileOffset(uint64_t Offset) : Offset(Offset) {}
32
33private:
34 uint64_t Offset = 0;
35};
36
37} // namespace llvm::cas
38
39#endif // LLVM_CAS_FILEOFFSET_H
uint64_t get() const
Definition FileOffset.h:26
FileOffset(uint64_t Offset)
Definition FileOffset.h:31
@ Offset
Definition DWP.cpp:477