26 : Stream(Data, Endian) {}
59 while (SrcReader.bytesRemaining() > 0) {
61 if (
auto EC = SrcReader.readLongestContiguousChunk(Chunk))
69 std::pair<BinaryStreamWriter, BinaryStreamWriter>
79 return std::make_pair(W1, W2);
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
BinaryStreamWriter()=default
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
uint32_t getLength() const
RefType drop_front(uint32_t N) const
Return a new BinaryStreamRef with the first N elements removed.
const unsigned char * bytes_end() const
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
Error writeFixedString(StringRef Str)
Write the the string Str to the underlying stream without a null terminator.
RefType slice(uint32_t Offset, uint32_t Len) const
Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elemen...
size_t size() const
size - Get the array size.
Error writeBytes(uint32_t Offset, ArrayRef< uint8_t > Data) const
Given an Offset into this WritableBinaryStreamRef and some input data, writes the data to the underly...
Error writeStreamRef(BinaryStreamRef Ref)
Efficiently reads all data from Ref, and writes it to this stream.
WritableBinaryStreamRef Stream
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the the integer Value to the underlying stream in the specified endianness. ...
Error writeCString(StringRef Str)
Write the the string Str to the underlying stream followed by a null terminator.
static ErrorSuccess success()
Create a success value.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
uint32_t getLength() const
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
Error padToAlignment(uint32_t Align)
std::pair< BinaryStreamWriter, BinaryStreamWriter > split(uint32_t Off) const
Splits the Writer into two Writers at a given offset.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const unsigned char * bytes_begin() const
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
RefType keep_front(uint32_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
A BinaryStream which can be read from as well as written to.