9#ifndef LLVM_LIB_CAS_BUILTINCAS_H
10#define LLVM_LIB_CAS_BUILTINCAS_H
45 bool RequiresNullTerminator)
const final {
55 "unknown object '" +
ID.toString() +
"'");
60 "corrupt object '" +
ID.toString() +
"'");
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
Unique identifier for a CAS object.
Handle to a loaded object in a ObjectStore instance.
Content-addressable storage for objects.
CASContext for LLVM builtin CAS using BLAKE3 hash type.
Common base class for builtin CAS implementations using the same CASContext.
virtual Expected< ObjectRef > storeFromNullTerminatedRegion(ArrayRef< uint8_t > ComputedHash, sys::fs::mapped_file_region Map)
Error createUnknownObjectError(const CASID &ID) const
Error createCorruptStorageError() const
virtual ArrayRef< char > getDataConst(ObjectHandle Node) const =0
Both builtin CAS implementations provide lifetime for free, so this can be const, and readData() and ...
Error validate(const CASID &ID) final
Validate the underlying object referred by CASID.
uint64_t getDataSize(ObjectHandle Node) const final
Get the size of some data.
Expected< CASID > parseID(StringRef Reference) final
Get a CASID from a ID, which should have been generated by CASID::print().
Error createCorruptObjectError(const CASID &ID) const
Expected< ObjectRef > store(ArrayRef< ObjectRef > Refs, ArrayRef< char > Data) final
Store object into ObjectStore.
ArrayRef< char > getData(ObjectHandle Node, bool RequiresNullTerminator) const final
virtual Expected< ObjectRef > storeImpl(ArrayRef< uint8_t > ComputedHash, ArrayRef< ObjectRef > Refs, ArrayRef< char > Data)=0
This class represents a memory mapped file.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.